diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..d1c5362 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,54 @@ +# Displays in the badge in Readme.md +name: Latest SDK Build + +on: + push: + branches: + - main + - 'release/**' + pull_request: + branches: + - main + - 'release/**' + +env: + CARGO_TERM_COLOR: always + +jobs: + rust: + name: Build + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: 1.18 + + - name: Build + run: | + export VERSION=`echo $GITHUB_REF | sed -e "s/refs\/heads\///g" -e "s/release\///g"` + sed -i "s/0.0.0/${VERSION}/g" src/version.go + make install + make test + + - name: Create Github Release and Tag + if: github.repository_owner == 'Authress' && github.ref != 'refs/heads/main' && github.event_name == 'push' + run: | + branchId="${GITHUB_REF/refs\/heads\/release\//}" + export VERSION="v${branchId}.${GITHUB_RUN_NUMBER}" + echo "VERSION=${VERSION}" >> $GITHUB_ENV + echo Building version: ${{ env.VERSION }} + + # We need to commit the changes in the version to the version.go or else the published version won't contain this change. + git commit -m"Creating version ${VERSION}" + git tag $VERSION + git push origin $VERSION + + # Force the GOPROXY to update the cache + GOPROXY=proxy.golang.org go list -m authress/authress-sdk.go@${VERSION} + + # - name: Publish SDK + # if: github.repository_owner == 'Authress' && github.ref != 'refs/heads/main' && github.event_name == 'push' + # run: \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..daf913b --- /dev/null +++ b/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# 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 OpenAPI Generator 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/.openapi-generator/FILES b/.openapi-generator/FILES new file mode 100644 index 0000000..c65ec57 --- /dev/null +++ b/.openapi-generator/FILES @@ -0,0 +1,179 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +api/openapi.yaml +api_access_records.go +api_accounts.go +api_applications.go +api_connections.go +api_extensions.go +api_groups.go +api_invites.go +api_resource_permissions.go +api_roles.go +api_service_clients.go +api_tenants.go +api_user_permissions.go +api_users.go +client.go +configuration.go +docs/AccessRecord.md +docs/AccessRecordAccount.md +docs/AccessRecordCollection.md +docs/AccessRecordsAPI.md +docs/AccessRequest.md +docs/AccessRequestCollection.md +docs/AccessRequestResponse.md +docs/AccessTemplate.md +docs/Account.md +docs/AccountCollection.md +docs/AccountLinks.md +docs/AccountsAPI.md +docs/ApplicationDelegation.md +docs/ApplicationsAPI.md +docs/ClaimRequest.md +docs/Client.md +docs/ClientAccessKey.md +docs/ClientCollection.md +docs/ClientOptions.md +docs/CollectionLinks.md +docs/Connection.md +docs/ConnectionCollection.md +docs/ConnectionData.md +docs/ConnectionDefaultConnectionProperties.md +docs/ConnectionUserDataConfiguration.md +docs/ConnectionsAPI.md +docs/Extension.md +docs/ExtensionApplication.md +docs/ExtensionClient.md +docs/ExtensionCollection.md +docs/ExtensionsAPI.md +docs/Group.md +docs/GroupCollection.md +docs/GroupsAPI.md +docs/Identity.md +docs/IdentityCollection.md +docs/IdentityRequest.md +docs/Invite.md +docs/InvitesAPI.md +docs/Link.md +docs/LinkedGroup.md +docs/Links.md +docs/OAuthAuthorizeResponse.md +docs/OAuthTokenRequest.md +docs/OAuthTokenResponse.md +docs/Pagination.md +docs/PaginationNext.md +docs/PermissionCollection.md +docs/PermissionCollectionAccount.md +docs/PermissionObject.md +docs/PermissionedResource.md +docs/PermissionedResourceCollection.md +docs/Resource.md +docs/ResourcePermission.md +docs/ResourcePermissionsAPI.md +docs/ResourceUsersCollection.md +docs/Role.md +docs/RoleCollection.md +docs/RolesAPI.md +docs/ServiceClientsAPI.md +docs/Statement.md +docs/Tenant.md +docs/TenantCollection.md +docs/TenantConnection.md +docs/TenantData.md +docs/TenantsAPI.md +docs/TokenRequest.md +docs/User.md +docs/UserConnectionCredentials.md +docs/UserIdentity.md +docs/UserIdentityCollection.md +docs/UserPermissionsAPI.md +docs/UserResourcesCollection.md +docs/UserRole.md +docs/UserRoleCollection.md +docs/UserToken.md +docs/UsersAPI.md +git_push.sh +go.mod +go.sum +model_access_record.go +model_access_record_account.go +model_access_record_collection.go +model_access_request.go +model_access_request_collection.go +model_access_request_response.go +model_access_template.go +model_account.go +model_account_collection.go +model_account_links.go +model_application_delegation.go +model_claim_request.go +model_client.go +model_client_access_key.go +model_client_collection.go +model_client_options.go +model_collection_links.go +model_connection.go +model_connection_collection.go +model_connection_data.go +model_connection_default_connection_properties.go +model_connection_user_data_configuration.go +model_extension.go +model_extension_application.go +model_extension_client.go +model_extension_collection.go +model_group.go +model_group_collection.go +model_identity.go +model_identity_collection.go +model_identity_request.go +model_invite.go +model_link.go +model_linked_group.go +model_links.go +model_o_auth_authorize_response.go +model_o_auth_token_request.go +model_o_auth_token_response.go +model_pagination.go +model_pagination_next.go +model_permission_collection.go +model_permission_collection_account.go +model_permission_object.go +model_permissioned_resource.go +model_permissioned_resource_collection.go +model_resource.go +model_resource_permission.go +model_resource_users_collection.go +model_role.go +model_role_collection.go +model_statement.go +model_tenant.go +model_tenant_collection.go +model_tenant_connection.go +model_tenant_data.go +model_token_request.go +model_user.go +model_user_connection_credentials.go +model_user_identity.go +model_user_identity_collection.go +model_user_resources_collection.go +model_user_role.go +model_user_role_collection.go +model_user_token.go +response.go +test/api_access_records_test.go +test/api_accounts_test.go +test/api_applications_test.go +test/api_connections_test.go +test/api_extensions_test.go +test/api_groups_test.go +test/api_invites_test.go +test/api_resource_permissions_test.go +test/api_roles_test.go +test/api_service_clients_test.go +test/api_tenants_test.go +test/api_user_permissions_test.go +test/api_users_test.go +utils.go diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION new file mode 100644 index 0000000..fff4bdd --- /dev/null +++ b/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.3.0-SNAPSHOT \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..b2d376d --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,8 @@ +{ + "cSpell.words": [ + "chrono", + "permissioned", + "reqwest", + "urlencode" + ] +} \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0c874d2 --- /dev/null +++ b/Makefile @@ -0,0 +1,13 @@ +default: install + +tidy: + go mod tidy + +install: + go install . + +test: + go test -count=1 -parallel=4 ./... + +integration: + ENV=test go test -count=1 -parallel=4 -timeout 10m -v ./... \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..de577fd --- /dev/null +++ b/README.md @@ -0,0 +1,35 @@ +
+ +
+ + +# Authress SDK for Go + + + + +This is the Authress SDK used to integrate with the authorization as a service provider Authress at https://authress.io. + + +## How to use the SDK + +### Install + +```sh +cargo add authress +``` + +### Reference Guide + +See the SDK reference guide for a examples of commonly executed blocks with descriptions. + +[SDK Documentation](./docs/README.md) + +### Contribution Guide + +[Developing for the Go SDK](./contributing.md) diff --git a/contributing.md b/contributing.md new file mode 100644 index 0000000..779fd65 --- /dev/null +++ b/contributing.md @@ -0,0 +1,61 @@ + +## Using the OpenAPI Generator to generate new models + +#### Start container +```sh +podman pull docker://openapitools/openapi-generator-online +``` + +#### Start container at port 8888 and save the container id +```sh +CID=$(podman run -d -p 8888:8080 openapitools/openapi-generator-online) +sleep 10 + +# Execute an HTTP request to generate a Ruby client +curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{"openAPIUrl": "https://api.authress.io/", "options": { "useSingleRequestParameter": true, "packageName": "authress", "packageVersion": "99.99.99" } }' 'http://localhost:8888/api/gen/clients/go' + + +# RESPONSE: { "link":"http://localhost:8888/api/gen/download/b11ce82c-37dd-448b-b51b-d42bf3f04c2e" } +``` + +### Download the generated zip file +```sh + +wget RESPONSE_LINK + +# Unzip the file +unzip SHA + +# Shutdown the openapi generator image +podman stop $CID && podman rm $CID +``` + +### Common review items +* [ ] Inputs to Constructor are (string: authress_api_url, string: service_client_access_key) +* [ ] authress_api_url should sanitize https:// prefix and remove trailing `/`s +* [ ] Add authentication to the configuration class. +* [ ] Change configuration class name to be `AuthressSettings` + * Specify all the inputs to be consistent across languages +* [ ] constructors for classes should only have relevant input properties, for instances `links` are not required. +* [ ] Update documentation + * Make sure markdown is valid + * Remove unnecessary links + * Add first class examples to readme.md + api documentation + * Find failed UserId, RoleId, TenantId, GroupId, Action properties and convert them to strings +* [ ] Remove any unnecessary validations from object and parameter injection, often there are some even when properties are allowed to be null +* [ ] The service client code to generate a JWT from private key needs to be added +* [ ] Add UnauthorizedError type to the authorizeUser function +* [ ] GET query parameters should be an object +* [ ] Top level tags from the API should accessible from the base class: `authressClient.accessRecords.getRecords(...)` +* [ ] Automatic Retry + * [ ] Automatic fallback to cache +* [ ] `OptimisticPerformanceHandler` - Automatic fallback to cache on timeout reached +* [ ] In memory caching for authorization checks - memoize +* [ ] Unsigned int for all limits +* [ ] readonly properties are never specified as required for request bodies +* [ ] Update Documentation for the API +* [ ] Validate all enums are enums and can be null when they should be. +* [ ] Remove LocalHost from the docs +* [ ] Tests +* [x] If-unmodified-since should called `expectedLastModifiedTime`, accept string or dateTime and convert this to an ISO String +* [ ] Update OAuth2 openapi authentication references in the documentation \ No newline at end of file diff --git a/docs/AccessRecord.md b/docs/AccessRecord.md new file mode 100644 index 0000000..f4613fc --- /dev/null +++ b/docs/AccessRecord.md @@ -0,0 +1,408 @@ +# AccessRecord + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**RecordId** | Pointer to **string** | Unique identifier for the record, can be specified on record creation. | [optional] +**Name** | **string** | A helpful name for this record | +**Description** | Pointer to **NullableString** | More details about this record | [optional] +**Capacity** | Pointer to **float32** | Percentage capacity of record that is filled. | [optional] [readonly] +**LastUpdated** | Pointer to **time.Time** | The expected last time the record was updated | [optional] [readonly] +**Status** | Pointer to **string** | Current status of the access record. | [optional] [readonly] +**Account** | Pointer to [**AccessRecordAccount**](AccessRecordAccount.md) | | [optional] +**Users** | Pointer to [**[]User**](User.md) | The list of users this record applies to | [optional] +**Admins** | Pointer to [**[]User**](User.md) | The list of admin that can edit this record even if they do not have global record edit permissions. | [optional] +**Groups** | Pointer to [**[]LinkedGroup**](LinkedGroup.md) | The list of groups this record applies to. Users in these groups will be receive access to the resources listed. | [optional] +**Statements** | [**[]Statement**](Statement.md) | A list of statements which match roles to resources. | +**Links** | Pointer to [**AccountLinks**](AccountLinks.md) | | [optional] +**Tags** | Pointer to **map[string]string** | The tags associated with this resource, this property is an map. { key1: value1, key2: value2 } | [optional] + +## Methods + +### NewAccessRecord + +`func NewAccessRecord(name string, statements []Statement, ) *AccessRecord` + +NewAccessRecord instantiates a new AccessRecord object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAccessRecordWithDefaults + +`func NewAccessRecordWithDefaults() *AccessRecord` + +NewAccessRecordWithDefaults instantiates a new AccessRecord object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetRecordId + +`func (o *AccessRecord) GetRecordId() string` + +GetRecordId returns the RecordId field if non-nil, zero value otherwise. + +### GetRecordIdOk + +`func (o *AccessRecord) GetRecordIdOk() (*string, bool)` + +GetRecordIdOk returns a tuple with the RecordId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRecordId + +`func (o *AccessRecord) SetRecordId(v string)` + +SetRecordId sets RecordId field to given value. + +### HasRecordId + +`func (o *AccessRecord) HasRecordId() bool` + +HasRecordId returns a boolean if a field has been set. + +### GetName + +`func (o *AccessRecord) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *AccessRecord) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *AccessRecord) SetName(v string)` + +SetName sets Name field to given value. + + +### GetDescription + +`func (o *AccessRecord) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *AccessRecord) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *AccessRecord) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *AccessRecord) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### SetDescriptionNil + +`func (o *AccessRecord) SetDescriptionNil(b bool)` + + SetDescriptionNil sets the value for Description to be an explicit nil + +### UnsetDescription +`func (o *AccessRecord) UnsetDescription()` + +UnsetDescription ensures that no value is present for Description, not even an explicit nil +### GetCapacity + +`func (o *AccessRecord) GetCapacity() float32` + +GetCapacity returns the Capacity field if non-nil, zero value otherwise. + +### GetCapacityOk + +`func (o *AccessRecord) GetCapacityOk() (*float32, bool)` + +GetCapacityOk returns a tuple with the Capacity field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCapacity + +`func (o *AccessRecord) SetCapacity(v float32)` + +SetCapacity sets Capacity field to given value. + +### HasCapacity + +`func (o *AccessRecord) HasCapacity() bool` + +HasCapacity returns a boolean if a field has been set. + +### GetLastUpdated + +`func (o *AccessRecord) GetLastUpdated() time.Time` + +GetLastUpdated returns the LastUpdated field if non-nil, zero value otherwise. + +### GetLastUpdatedOk + +`func (o *AccessRecord) GetLastUpdatedOk() (*time.Time, bool)` + +GetLastUpdatedOk returns a tuple with the LastUpdated field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastUpdated + +`func (o *AccessRecord) SetLastUpdated(v time.Time)` + +SetLastUpdated sets LastUpdated field to given value. + +### HasLastUpdated + +`func (o *AccessRecord) HasLastUpdated() bool` + +HasLastUpdated returns a boolean if a field has been set. + +### GetStatus + +`func (o *AccessRecord) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *AccessRecord) GetStatusOk() (*string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *AccessRecord) SetStatus(v string)` + +SetStatus sets Status field to given value. + +### HasStatus + +`func (o *AccessRecord) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + +### GetAccount + +`func (o *AccessRecord) GetAccount() AccessRecordAccount` + +GetAccount returns the Account field if non-nil, zero value otherwise. + +### GetAccountOk + +`func (o *AccessRecord) GetAccountOk() (*AccessRecordAccount, bool)` + +GetAccountOk returns a tuple with the Account field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccount + +`func (o *AccessRecord) SetAccount(v AccessRecordAccount)` + +SetAccount sets Account field to given value. + +### HasAccount + +`func (o *AccessRecord) HasAccount() bool` + +HasAccount returns a boolean if a field has been set. + +### GetUsers + +`func (o *AccessRecord) GetUsers() []User` + +GetUsers returns the Users field if non-nil, zero value otherwise. + +### GetUsersOk + +`func (o *AccessRecord) GetUsersOk() (*[]User, bool)` + +GetUsersOk returns a tuple with the Users field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsers + +`func (o *AccessRecord) SetUsers(v []User)` + +SetUsers sets Users field to given value. + +### HasUsers + +`func (o *AccessRecord) HasUsers() bool` + +HasUsers returns a boolean if a field has been set. + +### SetUsersNil + +`func (o *AccessRecord) SetUsersNil(b bool)` + + SetUsersNil sets the value for Users to be an explicit nil + +### UnsetUsers +`func (o *AccessRecord) UnsetUsers()` + +UnsetUsers ensures that no value is present for Users, not even an explicit nil +### GetAdmins + +`func (o *AccessRecord) GetAdmins() []User` + +GetAdmins returns the Admins field if non-nil, zero value otherwise. + +### GetAdminsOk + +`func (o *AccessRecord) GetAdminsOk() (*[]User, bool)` + +GetAdminsOk returns a tuple with the Admins field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAdmins + +`func (o *AccessRecord) SetAdmins(v []User)` + +SetAdmins sets Admins field to given value. + +### HasAdmins + +`func (o *AccessRecord) HasAdmins() bool` + +HasAdmins returns a boolean if a field has been set. + +### SetAdminsNil + +`func (o *AccessRecord) SetAdminsNil(b bool)` + + SetAdminsNil sets the value for Admins to be an explicit nil + +### UnsetAdmins +`func (o *AccessRecord) UnsetAdmins()` + +UnsetAdmins ensures that no value is present for Admins, not even an explicit nil +### GetGroups + +`func (o *AccessRecord) GetGroups() []LinkedGroup` + +GetGroups returns the Groups field if non-nil, zero value otherwise. + +### GetGroupsOk + +`func (o *AccessRecord) GetGroupsOk() (*[]LinkedGroup, bool)` + +GetGroupsOk returns a tuple with the Groups field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGroups + +`func (o *AccessRecord) SetGroups(v []LinkedGroup)` + +SetGroups sets Groups field to given value. + +### HasGroups + +`func (o *AccessRecord) HasGroups() bool` + +HasGroups returns a boolean if a field has been set. + +### SetGroupsNil + +`func (o *AccessRecord) SetGroupsNil(b bool)` + + SetGroupsNil sets the value for Groups to be an explicit nil + +### UnsetGroups +`func (o *AccessRecord) UnsetGroups()` + +UnsetGroups ensures that no value is present for Groups, not even an explicit nil +### GetStatements + +`func (o *AccessRecord) GetStatements() []Statement` + +GetStatements returns the Statements field if non-nil, zero value otherwise. + +### GetStatementsOk + +`func (o *AccessRecord) GetStatementsOk() (*[]Statement, bool)` + +GetStatementsOk returns a tuple with the Statements field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatements + +`func (o *AccessRecord) SetStatements(v []Statement)` + +SetStatements sets Statements field to given value. + + +### GetLinks + +`func (o *AccessRecord) GetLinks() AccountLinks` + +GetLinks returns the Links field if non-nil, zero value otherwise. + +### GetLinksOk + +`func (o *AccessRecord) GetLinksOk() (*AccountLinks, bool)` + +GetLinksOk returns a tuple with the Links field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLinks + +`func (o *AccessRecord) SetLinks(v AccountLinks)` + +SetLinks sets Links field to given value. + +### HasLinks + +`func (o *AccessRecord) HasLinks() bool` + +HasLinks returns a boolean if a field has been set. + +### GetTags + +`func (o *AccessRecord) GetTags() map[string]string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *AccessRecord) GetTagsOk() (*map[string]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *AccessRecord) SetTags(v map[string]string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *AccessRecord) HasTags() bool` + +HasTags returns a boolean if a field has been set. + +### SetTagsNil + +`func (o *AccessRecord) SetTagsNil(b bool)` + + SetTagsNil sets the value for Tags to be an explicit nil + +### UnsetTags +`func (o *AccessRecord) UnsetTags()` + +UnsetTags ensures that no value is present for Tags, not even an explicit nil + +[[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/docs/AccessRecordAccount.md b/docs/AccessRecordAccount.md new file mode 100644 index 0000000..023fe65 --- /dev/null +++ b/docs/AccessRecordAccount.md @@ -0,0 +1,51 @@ +# AccessRecordAccount + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AccountId** | **string** | | + +## Methods + +### NewAccessRecordAccount + +`func NewAccessRecordAccount(accountId string, ) *AccessRecordAccount` + +NewAccessRecordAccount instantiates a new AccessRecordAccount object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAccessRecordAccountWithDefaults + +`func NewAccessRecordAccountWithDefaults() *AccessRecordAccount` + +NewAccessRecordAccountWithDefaults instantiates a new AccessRecordAccount object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAccountId + +`func (o *AccessRecordAccount) GetAccountId() string` + +GetAccountId returns the AccountId field if non-nil, zero value otherwise. + +### GetAccountIdOk + +`func (o *AccessRecordAccount) GetAccountIdOk() (*string, bool)` + +GetAccountIdOk returns a tuple with the AccountId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccountId + +`func (o *AccessRecordAccount) SetAccountId(v string)` + +SetAccountId sets AccountId field to given value. + + + +[[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/docs/AccessRecordCollection.md b/docs/AccessRecordCollection.md new file mode 100644 index 0000000..8de1c66 --- /dev/null +++ b/docs/AccessRecordCollection.md @@ -0,0 +1,98 @@ +# AccessRecordCollection + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Records** | [**[]AccessRecord**](AccessRecord.md) | A list of access records | +**Pagination** | Pointer to [**Pagination**](Pagination.md) | | [optional] +**Links** | [**CollectionLinks**](CollectionLinks.md) | | + +## Methods + +### NewAccessRecordCollection + +`func NewAccessRecordCollection(records []AccessRecord, links CollectionLinks, ) *AccessRecordCollection` + +NewAccessRecordCollection instantiates a new AccessRecordCollection object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAccessRecordCollectionWithDefaults + +`func NewAccessRecordCollectionWithDefaults() *AccessRecordCollection` + +NewAccessRecordCollectionWithDefaults instantiates a new AccessRecordCollection object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetRecords + +`func (o *AccessRecordCollection) GetRecords() []AccessRecord` + +GetRecords returns the Records field if non-nil, zero value otherwise. + +### GetRecordsOk + +`func (o *AccessRecordCollection) GetRecordsOk() (*[]AccessRecord, bool)` + +GetRecordsOk returns a tuple with the Records field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRecords + +`func (o *AccessRecordCollection) SetRecords(v []AccessRecord)` + +SetRecords sets Records field to given value. + + +### GetPagination + +`func (o *AccessRecordCollection) GetPagination() Pagination` + +GetPagination returns the Pagination field if non-nil, zero value otherwise. + +### GetPaginationOk + +`func (o *AccessRecordCollection) GetPaginationOk() (*Pagination, bool)` + +GetPaginationOk returns a tuple with the Pagination field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPagination + +`func (o *AccessRecordCollection) SetPagination(v Pagination)` + +SetPagination sets Pagination field to given value. + +### HasPagination + +`func (o *AccessRecordCollection) HasPagination() bool` + +HasPagination returns a boolean if a field has been set. + +### GetLinks + +`func (o *AccessRecordCollection) GetLinks() CollectionLinks` + +GetLinks returns the Links field if non-nil, zero value otherwise. + +### GetLinksOk + +`func (o *AccessRecordCollection) GetLinksOk() (*CollectionLinks, bool)` + +GetLinksOk returns a tuple with the Links field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLinks + +`func (o *AccessRecordCollection) SetLinks(v CollectionLinks)` + +SetLinks sets Links field to given value. + + + +[[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/docs/AccessRecordsAPI.md b/docs/AccessRecordsAPI.md new file mode 100644 index 0000000..a2ab578 --- /dev/null +++ b/docs/AccessRecordsAPI.md @@ -0,0 +1,780 @@ +# \AccessRecordsAPI + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateClaim**](AccessRecordsAPI.md#CreateClaim) | **Post** /v1/claims | Create resource Claim +[**CreateRecord**](AccessRecordsAPI.md#CreateRecord) | **Post** /v1/records | Create access record +[**CreateRequest**](AccessRecordsAPI.md#CreateRequest) | **Post** /v1/requests | Create access request +[**DeleteRecord**](AccessRecordsAPI.md#DeleteRecord) | **Delete** /v1/records/{recordId} | Deletes access record +[**DeleteRequest**](AccessRecordsAPI.md#DeleteRequest) | **Delete** /v1/requests/{requestId} | Deletes access request +[**GetRecord**](AccessRecordsAPI.md#GetRecord) | **Get** /v1/records/{recordId} | Retrieve access record +[**GetRecords**](AccessRecordsAPI.md#GetRecords) | **Get** /v1/records | List access records +[**GetRequest**](AccessRecordsAPI.md#GetRequest) | **Get** /v1/requests/{requestId} | Retrieve access request +[**GetRequests**](AccessRecordsAPI.md#GetRequests) | **Get** /v1/requests | List access requests +[**RespondToAccessRequest**](AccessRecordsAPI.md#RespondToAccessRequest) | **Patch** /v1/requests/{requestId} | Approve or deny access request +[**UpdateRecord**](AccessRecordsAPI.md#UpdateRecord) | **Put** /v1/records/{recordId} | Update access record + + + +## CreateClaim + +> map[string]interface{} CreateClaim(ctx).ClaimRequest(claimRequest).Execute() + +Create resource Claim + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + claimRequest := *openapiclient.NewClaimRequest("CollectionResource_example", "ResourceId_example") // ClaimRequest | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AccessRecordsAPI.CreateClaim(context.Background()).ClaimRequest(claimRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AccessRecordsAPI.CreateClaim``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateClaim`: map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `AccessRecordsAPI.CreateClaim`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateClaimRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **claimRequest** | [**ClaimRequest**](ClaimRequest.md) | | + +### Return type + +**map[string]interface{}** + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/links+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) + + +## CreateRecord + +> AccessRecord CreateRecord(ctx).AccessRecord(accessRecord).Execute() + +Create access record + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + accessRecord := *openapiclient.NewAccessRecord("Name_example", []openapiclient.Statement{*openapiclient.NewStatement([]string{"Roles_example"}, []openapiclient.Resource{*openapiclient.NewResource("/organizations/org_a/documents/doc_1")})}) // AccessRecord | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AccessRecordsAPI.CreateRecord(context.Background()).AccessRecord(accessRecord).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AccessRecordsAPI.CreateRecord``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateRecord`: AccessRecord + fmt.Fprintf(os.Stdout, "Response from `AccessRecordsAPI.CreateRecord`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateRecordRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **accessRecord** | [**AccessRecord**](AccessRecord.md) | | + +### Return type + +[**AccessRecord**](AccessRecord.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/links+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) + + +## CreateRequest + +> AccessRequest CreateRequest(ctx).AccessRequest(accessRequest).Execute() + +Create access request + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + accessRequest := *openapiclient.NewAccessRequest("RequestId_example", *openapiclient.NewAccessTemplate([]openapiclient.User{*openapiclient.NewUser("oauth|userId")}, []openapiclient.Statement{*openapiclient.NewStatement([]string{"Roles_example"}, []openapiclient.Resource{*openapiclient.NewResource("/organizations/org_a/documents/doc_1")})})) // AccessRequest | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AccessRecordsAPI.CreateRequest(context.Background()).AccessRequest(accessRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AccessRecordsAPI.CreateRequest``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateRequest`: AccessRequest + fmt.Fprintf(os.Stdout, "Response from `AccessRecordsAPI.CreateRequest`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateRequestRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **accessRequest** | [**AccessRequest**](AccessRequest.md) | | + +### Return type + +[**AccessRequest**](AccessRequest.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/links+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) + + +## DeleteRecord + +> DeleteRecord(ctx, recordId).Execute() + +Deletes access record + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + recordId := "recordId_example" // string | The identifier of the access record. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.AccessRecordsAPI.DeleteRecord(context.Background(), recordId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AccessRecordsAPI.DeleteRecord``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**recordId** | **string** | The identifier of the access record. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteRecordRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[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) + + +## DeleteRequest + +> DeleteRequest(ctx, requestId).Execute() + +Deletes access request + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + requestId := "requestId_example" // string | The identifier of the access request. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.AccessRecordsAPI.DeleteRequest(context.Background(), requestId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AccessRecordsAPI.DeleteRequest``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**requestId** | **string** | The identifier of the access request. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteRequestRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[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) + + +## GetRecord + +> AccessRecord GetRecord(ctx, recordId).Execute() + +Retrieve access record + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + recordId := "recordId_example" // string | The identifier of the access record. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AccessRecordsAPI.GetRecord(context.Background(), recordId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AccessRecordsAPI.GetRecord``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetRecord`: AccessRecord + fmt.Fprintf(os.Stdout, "Response from `AccessRecordsAPI.GetRecord`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**recordId** | **string** | The identifier of the access record. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetRecordRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**AccessRecord**](AccessRecord.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/links+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) + + +## GetRecords + +> AccessRecordCollection GetRecords(ctx).Limit(limit).Cursor(cursor).Filter(filter).Status(status).Execute() + +List access records + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + limit := int32(56) // int32 | Max number of results to return (optional) (default to 20) + cursor := "cursor_example" // string | Continuation cursor for paging (optional) + filter := "filter_example" // string | Filter to search records by. This is a case insensitive search through every text field. (optional) + status := "status_example" // string | Filter records by their current status. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AccessRecordsAPI.GetRecords(context.Background()).Limit(limit).Cursor(cursor).Filter(filter).Status(status).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AccessRecordsAPI.GetRecords``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetRecords`: AccessRecordCollection + fmt.Fprintf(os.Stdout, "Response from `AccessRecordsAPI.GetRecords`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetRecordsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int32** | Max number of results to return | [default to 20] + **cursor** | **string** | Continuation cursor for paging | + **filter** | **string** | Filter to search records by. This is a case insensitive search through every text field. | + **status** | **string** | Filter records by their current status. | + +### Return type + +[**AccessRecordCollection**](AccessRecordCollection.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/links+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) + + +## GetRequest + +> AccessRequest GetRequest(ctx, requestId).Execute() + +Retrieve access request + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + requestId := "requestId_example" // string | The identifier of the access request. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AccessRecordsAPI.GetRequest(context.Background(), requestId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AccessRecordsAPI.GetRequest``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetRequest`: AccessRequest + fmt.Fprintf(os.Stdout, "Response from `AccessRecordsAPI.GetRequest`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**requestId** | **string** | The identifier of the access request. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetRequestRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**AccessRequest**](AccessRequest.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/links+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) + + +## GetRequests + +> AccessRequestCollection GetRequests(ctx).Limit(limit).Cursor(cursor).Status(status).Execute() + +List access requests + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + limit := int32(56) // int32 | Max number of results to return (optional) (default to 20) + cursor := "cursor_example" // string | Continuation cursor for paging (optional) + status := "status_example" // string | Filter requests by their current status. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AccessRecordsAPI.GetRequests(context.Background()).Limit(limit).Cursor(cursor).Status(status).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AccessRecordsAPI.GetRequests``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetRequests`: AccessRequestCollection + fmt.Fprintf(os.Stdout, "Response from `AccessRecordsAPI.GetRequests`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetRequestsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int32** | Max number of results to return | [default to 20] + **cursor** | **string** | Continuation cursor for paging | + **status** | **string** | Filter requests by their current status. | + +### Return type + +[**AccessRequestCollection**](AccessRequestCollection.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/links+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) + + +## RespondToAccessRequest + +> AccessRequest RespondToAccessRequest(ctx, requestId).AccessRequestResponse(accessRequestResponse).Execute() + +Approve or deny access request + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + requestId := "requestId_example" // string | The identifier of the access request. + accessRequestResponse := *openapiclient.NewAccessRequestResponse("Status_example") // AccessRequestResponse | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AccessRecordsAPI.RespondToAccessRequest(context.Background(), requestId).AccessRequestResponse(accessRequestResponse).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AccessRecordsAPI.RespondToAccessRequest``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `RespondToAccessRequest`: AccessRequest + fmt.Fprintf(os.Stdout, "Response from `AccessRecordsAPI.RespondToAccessRequest`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**requestId** | **string** | The identifier of the access request. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiRespondToAccessRequestRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessRequestResponse** | [**AccessRequestResponse**](AccessRequestResponse.md) | | + +### Return type + +[**AccessRequest**](AccessRequest.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/links+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) + + +## UpdateRecord + +> UpdateRecord(ctx, recordId).AccessRecord(accessRecord).IfUnmodifiedSince(ifUnmodifiedSince).Execute() + +Update access record + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + "time" + openapiclient "//" +) + +func main() { + recordId := "recordId_example" // string | The identifier of the access record. + accessRecord := *openapiclient.NewAccessRecord("Name_example", []openapiclient.Statement{*openapiclient.NewStatement([]string{"Roles_example"}, []openapiclient.Resource{*openapiclient.NewResource("/organizations/org_a/documents/doc_1")})}) // AccessRecord | + ifUnmodifiedSince := time.Now() // time.Time | The expected last time the record was modified. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.AccessRecordsAPI.UpdateRecord(context.Background(), recordId).AccessRecord(accessRecord).IfUnmodifiedSince(ifUnmodifiedSince).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AccessRecordsAPI.UpdateRecord``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**recordId** | **string** | The identifier of the access record. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateRecordRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessRecord** | [**AccessRecord**](AccessRecord.md) | | + **ifUnmodifiedSince** | **time.Time** | The expected last time the record was modified. | + +### Return type + + (empty response body) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[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/docs/AccessRequest.md b/docs/AccessRequest.md new file mode 100644 index 0000000..d1b0d71 --- /dev/null +++ b/docs/AccessRequest.md @@ -0,0 +1,186 @@ +# AccessRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**RequestId** | **string** | Unique identifier for the request. | [readonly] +**LastUpdated** | Pointer to **time.Time** | The expected last time the request was updated | [optional] [readonly] +**Status** | Pointer to **string** | Current status of the access request. | [optional] [readonly] +**Access** | [**AccessTemplate**](AccessTemplate.md) | | +**Links** | Pointer to [**AccountLinks**](AccountLinks.md) | | [optional] +**Tags** | Pointer to **map[string]string** | The tags associated with this resource, this property is an map. { key1: value1, key2: value2 } | [optional] + +## Methods + +### NewAccessRequest + +`func NewAccessRequest(requestId string, access AccessTemplate, ) *AccessRequest` + +NewAccessRequest instantiates a new AccessRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAccessRequestWithDefaults + +`func NewAccessRequestWithDefaults() *AccessRequest` + +NewAccessRequestWithDefaults instantiates a new AccessRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetRequestId + +`func (o *AccessRequest) GetRequestId() string` + +GetRequestId returns the RequestId field if non-nil, zero value otherwise. + +### GetRequestIdOk + +`func (o *AccessRequest) GetRequestIdOk() (*string, bool)` + +GetRequestIdOk returns a tuple with the RequestId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRequestId + +`func (o *AccessRequest) SetRequestId(v string)` + +SetRequestId sets RequestId field to given value. + + +### GetLastUpdated + +`func (o *AccessRequest) GetLastUpdated() time.Time` + +GetLastUpdated returns the LastUpdated field if non-nil, zero value otherwise. + +### GetLastUpdatedOk + +`func (o *AccessRequest) GetLastUpdatedOk() (*time.Time, bool)` + +GetLastUpdatedOk returns a tuple with the LastUpdated field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastUpdated + +`func (o *AccessRequest) SetLastUpdated(v time.Time)` + +SetLastUpdated sets LastUpdated field to given value. + +### HasLastUpdated + +`func (o *AccessRequest) HasLastUpdated() bool` + +HasLastUpdated returns a boolean if a field has been set. + +### GetStatus + +`func (o *AccessRequest) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *AccessRequest) GetStatusOk() (*string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *AccessRequest) SetStatus(v string)` + +SetStatus sets Status field to given value. + +### HasStatus + +`func (o *AccessRequest) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + +### GetAccess + +`func (o *AccessRequest) GetAccess() AccessTemplate` + +GetAccess returns the Access field if non-nil, zero value otherwise. + +### GetAccessOk + +`func (o *AccessRequest) GetAccessOk() (*AccessTemplate, bool)` + +GetAccessOk returns a tuple with the Access field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccess + +`func (o *AccessRequest) SetAccess(v AccessTemplate)` + +SetAccess sets Access field to given value. + + +### GetLinks + +`func (o *AccessRequest) GetLinks() AccountLinks` + +GetLinks returns the Links field if non-nil, zero value otherwise. + +### GetLinksOk + +`func (o *AccessRequest) GetLinksOk() (*AccountLinks, bool)` + +GetLinksOk returns a tuple with the Links field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLinks + +`func (o *AccessRequest) SetLinks(v AccountLinks)` + +SetLinks sets Links field to given value. + +### HasLinks + +`func (o *AccessRequest) HasLinks() bool` + +HasLinks returns a boolean if a field has been set. + +### GetTags + +`func (o *AccessRequest) GetTags() map[string]string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *AccessRequest) GetTagsOk() (*map[string]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *AccessRequest) SetTags(v map[string]string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *AccessRequest) HasTags() bool` + +HasTags returns a boolean if a field has been set. + +### SetTagsNil + +`func (o *AccessRequest) SetTagsNil(b bool)` + + SetTagsNil sets the value for Tags to be an explicit nil + +### UnsetTags +`func (o *AccessRequest) UnsetTags()` + +UnsetTags ensures that no value is present for Tags, not even an explicit nil + +[[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/docs/AccessRequestCollection.md b/docs/AccessRequestCollection.md new file mode 100644 index 0000000..247eec0 --- /dev/null +++ b/docs/AccessRequestCollection.md @@ -0,0 +1,103 @@ +# AccessRequestCollection + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Records** | Pointer to [**[]AccessRequest**](AccessRequest.md) | A list of access requests | [optional] +**Pagination** | Pointer to [**Pagination**](Pagination.md) | | [optional] +**Links** | [**CollectionLinks**](CollectionLinks.md) | | + +## Methods + +### NewAccessRequestCollection + +`func NewAccessRequestCollection(links CollectionLinks, ) *AccessRequestCollection` + +NewAccessRequestCollection instantiates a new AccessRequestCollection object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAccessRequestCollectionWithDefaults + +`func NewAccessRequestCollectionWithDefaults() *AccessRequestCollection` + +NewAccessRequestCollectionWithDefaults instantiates a new AccessRequestCollection object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetRecords + +`func (o *AccessRequestCollection) GetRecords() []AccessRequest` + +GetRecords returns the Records field if non-nil, zero value otherwise. + +### GetRecordsOk + +`func (o *AccessRequestCollection) GetRecordsOk() (*[]AccessRequest, bool)` + +GetRecordsOk returns a tuple with the Records field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRecords + +`func (o *AccessRequestCollection) SetRecords(v []AccessRequest)` + +SetRecords sets Records field to given value. + +### HasRecords + +`func (o *AccessRequestCollection) HasRecords() bool` + +HasRecords returns a boolean if a field has been set. + +### GetPagination + +`func (o *AccessRequestCollection) GetPagination() Pagination` + +GetPagination returns the Pagination field if non-nil, zero value otherwise. + +### GetPaginationOk + +`func (o *AccessRequestCollection) GetPaginationOk() (*Pagination, bool)` + +GetPaginationOk returns a tuple with the Pagination field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPagination + +`func (o *AccessRequestCollection) SetPagination(v Pagination)` + +SetPagination sets Pagination field to given value. + +### HasPagination + +`func (o *AccessRequestCollection) HasPagination() bool` + +HasPagination returns a boolean if a field has been set. + +### GetLinks + +`func (o *AccessRequestCollection) GetLinks() CollectionLinks` + +GetLinks returns the Links field if non-nil, zero value otherwise. + +### GetLinksOk + +`func (o *AccessRequestCollection) GetLinksOk() (*CollectionLinks, bool)` + +GetLinksOk returns a tuple with the Links field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLinks + +`func (o *AccessRequestCollection) SetLinks(v CollectionLinks)` + +SetLinks sets Links field to given value. + + + +[[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/docs/AccessRequestResponse.md b/docs/AccessRequestResponse.md new file mode 100644 index 0000000..64d4cf6 --- /dev/null +++ b/docs/AccessRequestResponse.md @@ -0,0 +1,51 @@ +# AccessRequestResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Status** | **string** | New result, either approve or deny the request | + +## Methods + +### NewAccessRequestResponse + +`func NewAccessRequestResponse(status string, ) *AccessRequestResponse` + +NewAccessRequestResponse instantiates a new AccessRequestResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAccessRequestResponseWithDefaults + +`func NewAccessRequestResponseWithDefaults() *AccessRequestResponse` + +NewAccessRequestResponseWithDefaults instantiates a new AccessRequestResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetStatus + +`func (o *AccessRequestResponse) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *AccessRequestResponse) GetStatusOk() (*string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *AccessRequestResponse) SetStatus(v string)` + +SetStatus sets Status field to given value. + + + +[[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/docs/AccessTemplate.md b/docs/AccessTemplate.md new file mode 100644 index 0000000..a5f2045 --- /dev/null +++ b/docs/AccessTemplate.md @@ -0,0 +1,72 @@ +# AccessTemplate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Users** | [**[]User**](User.md) | The list of users the access applies to | +**Statements** | [**[]Statement**](Statement.md) | A list of statements which match roles to resources. | + +## Methods + +### NewAccessTemplate + +`func NewAccessTemplate(users []User, statements []Statement, ) *AccessTemplate` + +NewAccessTemplate instantiates a new AccessTemplate object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAccessTemplateWithDefaults + +`func NewAccessTemplateWithDefaults() *AccessTemplate` + +NewAccessTemplateWithDefaults instantiates a new AccessTemplate object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetUsers + +`func (o *AccessTemplate) GetUsers() []User` + +GetUsers returns the Users field if non-nil, zero value otherwise. + +### GetUsersOk + +`func (o *AccessTemplate) GetUsersOk() (*[]User, bool)` + +GetUsersOk returns a tuple with the Users field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsers + +`func (o *AccessTemplate) SetUsers(v []User)` + +SetUsers sets Users field to given value. + + +### GetStatements + +`func (o *AccessTemplate) GetStatements() []Statement` + +GetStatements returns the Statements field if non-nil, zero value otherwise. + +### GetStatementsOk + +`func (o *AccessTemplate) GetStatementsOk() (*[]Statement, bool)` + +GetStatementsOk returns a tuple with the Statements field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatements + +`func (o *AccessTemplate) SetStatements(v []Statement)` + +SetStatements sets Statements field to given value. + + + +[[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/docs/Account.md b/docs/Account.md new file mode 100644 index 0000000..56949a9 --- /dev/null +++ b/docs/Account.md @@ -0,0 +1,155 @@ +# Account + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AccountId** | **string** | | +**CreatedTime** | **time.Time** | | [readonly] +**Name** | Pointer to **NullableString** | | [optional] +**Company** | **map[string]interface{}** | | +**Links** | Pointer to [**AccountLinks**](AccountLinks.md) | | [optional] + +## Methods + +### NewAccount + +`func NewAccount(accountId string, createdTime time.Time, company map[string]interface{}, ) *Account` + +NewAccount instantiates a new Account object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAccountWithDefaults + +`func NewAccountWithDefaults() *Account` + +NewAccountWithDefaults instantiates a new Account object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAccountId + +`func (o *Account) GetAccountId() string` + +GetAccountId returns the AccountId field if non-nil, zero value otherwise. + +### GetAccountIdOk + +`func (o *Account) GetAccountIdOk() (*string, bool)` + +GetAccountIdOk returns a tuple with the AccountId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccountId + +`func (o *Account) SetAccountId(v string)` + +SetAccountId sets AccountId field to given value. + + +### GetCreatedTime + +`func (o *Account) GetCreatedTime() time.Time` + +GetCreatedTime returns the CreatedTime field if non-nil, zero value otherwise. + +### GetCreatedTimeOk + +`func (o *Account) GetCreatedTimeOk() (*time.Time, bool)` + +GetCreatedTimeOk returns a tuple with the CreatedTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedTime + +`func (o *Account) SetCreatedTime(v time.Time)` + +SetCreatedTime sets CreatedTime field to given value. + + +### GetName + +`func (o *Account) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Account) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *Account) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *Account) HasName() bool` + +HasName returns a boolean if a field has been set. + +### SetNameNil + +`func (o *Account) SetNameNil(b bool)` + + SetNameNil sets the value for Name to be an explicit nil + +### UnsetName +`func (o *Account) UnsetName()` + +UnsetName ensures that no value is present for Name, not even an explicit nil +### GetCompany + +`func (o *Account) GetCompany() map[string]interface{}` + +GetCompany returns the Company field if non-nil, zero value otherwise. + +### GetCompanyOk + +`func (o *Account) GetCompanyOk() (*map[string]interface{}, bool)` + +GetCompanyOk returns a tuple with the Company field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCompany + +`func (o *Account) SetCompany(v map[string]interface{})` + +SetCompany sets Company field to given value. + + +### GetLinks + +`func (o *Account) GetLinks() AccountLinks` + +GetLinks returns the Links field if non-nil, zero value otherwise. + +### GetLinksOk + +`func (o *Account) GetLinksOk() (*AccountLinks, bool)` + +GetLinksOk returns a tuple with the Links field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLinks + +`func (o *Account) SetLinks(v AccountLinks)` + +SetLinks sets Links field to given value. + +### HasLinks + +`func (o *Account) HasLinks() bool` + +HasLinks returns a boolean if a field has been set. + + +[[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/docs/AccountCollection.md b/docs/AccountCollection.md new file mode 100644 index 0000000..7730b2e --- /dev/null +++ b/docs/AccountCollection.md @@ -0,0 +1,51 @@ +# AccountCollection + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Accounts** | [**Account**](Account.md) | | + +## Methods + +### NewAccountCollection + +`func NewAccountCollection(accounts Account, ) *AccountCollection` + +NewAccountCollection instantiates a new AccountCollection object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAccountCollectionWithDefaults + +`func NewAccountCollectionWithDefaults() *AccountCollection` + +NewAccountCollectionWithDefaults instantiates a new AccountCollection object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAccounts + +`func (o *AccountCollection) GetAccounts() Account` + +GetAccounts returns the Accounts field if non-nil, zero value otherwise. + +### GetAccountsOk + +`func (o *AccountCollection) GetAccountsOk() (*Account, bool)` + +GetAccountsOk returns a tuple with the Accounts field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccounts + +`func (o *AccountCollection) SetAccounts(v Account)` + +SetAccounts sets Accounts field to given value. + + + +[[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/docs/AccountLinks.md b/docs/AccountLinks.md new file mode 100644 index 0000000..eaf349e --- /dev/null +++ b/docs/AccountLinks.md @@ -0,0 +1,61 @@ +# AccountLinks + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Self** | [**NullableLink**](Link.md) | | + +## Methods + +### NewAccountLinks + +`func NewAccountLinks(self NullableLink, ) *AccountLinks` + +NewAccountLinks instantiates a new AccountLinks object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAccountLinksWithDefaults + +`func NewAccountLinksWithDefaults() *AccountLinks` + +NewAccountLinksWithDefaults instantiates a new AccountLinks object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetSelf + +`func (o *AccountLinks) GetSelf() Link` + +GetSelf returns the Self field if non-nil, zero value otherwise. + +### GetSelfOk + +`func (o *AccountLinks) GetSelfOk() (*Link, bool)` + +GetSelfOk returns a tuple with the Self field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSelf + +`func (o *AccountLinks) SetSelf(v Link)` + +SetSelf sets Self field to given value. + + +### SetSelfNil + +`func (o *AccountLinks) SetSelfNil(b bool)` + + SetSelfNil sets the value for Self to be an explicit nil + +### UnsetSelf +`func (o *AccountLinks) UnsetSelf()` + +UnsetSelf ensures that no value is present for Self, not even an explicit nil + +[[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/docs/AccountsAPI.md b/docs/AccountsAPI.md new file mode 100644 index 0000000..da33916 --- /dev/null +++ b/docs/AccountsAPI.md @@ -0,0 +1,274 @@ +# \AccountsAPI + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DelegateAuthentication**](AccountsAPI.md#DelegateAuthentication) | **Post** /v1/identities | Link external provider +[**GetAccount**](AccountsAPI.md#GetAccount) | **Get** /v1/accounts/{accountId} | Retrieve account information +[**GetAccountIdentities**](AccountsAPI.md#GetAccountIdentities) | **Get** /v1/identities | List linked external providers +[**GetAccounts**](AccountsAPI.md#GetAccounts) | **Get** /v1/accounts | List user Authress accounts + + + +## DelegateAuthentication + +> DelegateAuthentication(ctx).IdentityRequest(identityRequest).Execute() + +Link external provider + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + identityRequest := *openapiclient.NewIdentityRequest() // IdentityRequest | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.AccountsAPI.DelegateAuthentication(context.Background()).IdentityRequest(identityRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AccountsAPI.DelegateAuthentication``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiDelegateAuthenticationRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **identityRequest** | [**IdentityRequest**](IdentityRequest.md) | | + +### Return type + + (empty response body) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[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) + + +## GetAccount + +> Account GetAccount(ctx, accountId).Execute() + +Retrieve account information + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + accountId := "accountId_example" // string | The unique identifier for the account + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AccountsAPI.GetAccount(context.Background(), accountId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AccountsAPI.GetAccount``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetAccount`: Account + fmt.Fprintf(os.Stdout, "Response from `AccountsAPI.GetAccount`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**accountId** | **string** | The unique identifier for the account | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetAccountRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**Account**](Account.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/links+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) + + +## GetAccountIdentities + +> IdentityCollection GetAccountIdentities(ctx).Execute() + +List linked external providers + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AccountsAPI.GetAccountIdentities(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AccountsAPI.GetAccountIdentities``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetAccountIdentities`: IdentityCollection + fmt.Fprintf(os.Stdout, "Response from `AccountsAPI.GetAccountIdentities`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetAccountIdentitiesRequest struct via the builder pattern + + +### Return type + +[**IdentityCollection**](IdentityCollection.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/links+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) + + +## GetAccounts + +> AccountCollection GetAccounts(ctx).EarliestCacheTime(earliestCacheTime).Execute() + +List user Authress accounts + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + "time" + openapiclient "//" +) + +func main() { + earliestCacheTime := time.Now() // time.Time | Ensure the accounts list is not cached before this time. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AccountsAPI.GetAccounts(context.Background()).EarliestCacheTime(earliestCacheTime).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AccountsAPI.GetAccounts``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetAccounts`: AccountCollection + fmt.Fprintf(os.Stdout, "Response from `AccountsAPI.GetAccounts`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetAccountsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **earliestCacheTime** | **time.Time** | Ensure the accounts list is not cached before this time. | + +### Return type + +[**AccountCollection**](AccountCollection.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/links+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/docs/ApplicationDelegation.md b/docs/ApplicationDelegation.md new file mode 100644 index 0000000..8fec5bd --- /dev/null +++ b/docs/ApplicationDelegation.md @@ -0,0 +1,51 @@ +# ApplicationDelegation + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AuthenticationUrl** | **string** | Redirect the user to this url to automatically log them into a third-party application. | + +## Methods + +### NewApplicationDelegation + +`func NewApplicationDelegation(authenticationUrl string, ) *ApplicationDelegation` + +NewApplicationDelegation instantiates a new ApplicationDelegation object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewApplicationDelegationWithDefaults + +`func NewApplicationDelegationWithDefaults() *ApplicationDelegation` + +NewApplicationDelegationWithDefaults instantiates a new ApplicationDelegation object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAuthenticationUrl + +`func (o *ApplicationDelegation) GetAuthenticationUrl() string` + +GetAuthenticationUrl returns the AuthenticationUrl field if non-nil, zero value otherwise. + +### GetAuthenticationUrlOk + +`func (o *ApplicationDelegation) GetAuthenticationUrlOk() (*string, bool)` + +GetAuthenticationUrlOk returns a tuple with the AuthenticationUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAuthenticationUrl + +`func (o *ApplicationDelegation) SetAuthenticationUrl(v string)` + +SetAuthenticationUrl sets AuthenticationUrl field to given value. + + + +[[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/docs/ApplicationsAPI.md b/docs/ApplicationsAPI.md new file mode 100644 index 0000000..ddf82cf --- /dev/null +++ b/docs/ApplicationsAPI.md @@ -0,0 +1,82 @@ +# \ApplicationsAPI + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DelegateUserLogin**](ApplicationsAPI.md#DelegateUserLogin) | **Post** /v1/applications/{applicationId}/users/{userId}/delegation | Log user into third-party application + + + +## DelegateUserLogin + +> ApplicationDelegation DelegateUserLogin(ctx, applicationId, userId).Execute() + +Log user into third-party application + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + applicationId := "applicationId_example" // string | The application to have the user log into. + userId := TODO // UserId | The user. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ApplicationsAPI.DelegateUserLogin(context.Background(), applicationId, userId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ApplicationsAPI.DelegateUserLogin``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `DelegateUserLogin`: ApplicationDelegation + fmt.Fprintf(os.Stdout, "Response from `ApplicationsAPI.DelegateUserLogin`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**applicationId** | **string** | The application to have the user log into. | +**userId** | [**UserId**](.md) | The user. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDelegateUserLoginRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + +[**ApplicationDelegation**](ApplicationDelegation.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/links+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/docs/ClaimRequest.md b/docs/ClaimRequest.md new file mode 100644 index 0000000..395cd8d --- /dev/null +++ b/docs/ClaimRequest.md @@ -0,0 +1,72 @@ +# ClaimRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CollectionResource** | **string** | The parent resource to add a sub-resource to. The resource must have a resource configuration that add the permission CLAIM for this to work. | +**ResourceId** | **string** | The sub-resource the user is requesting Admin ownership over. | + +## Methods + +### NewClaimRequest + +`func NewClaimRequest(collectionResource string, resourceId string, ) *ClaimRequest` + +NewClaimRequest instantiates a new ClaimRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewClaimRequestWithDefaults + +`func NewClaimRequestWithDefaults() *ClaimRequest` + +NewClaimRequestWithDefaults instantiates a new ClaimRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCollectionResource + +`func (o *ClaimRequest) GetCollectionResource() string` + +GetCollectionResource returns the CollectionResource field if non-nil, zero value otherwise. + +### GetCollectionResourceOk + +`func (o *ClaimRequest) GetCollectionResourceOk() (*string, bool)` + +GetCollectionResourceOk returns a tuple with the CollectionResource field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCollectionResource + +`func (o *ClaimRequest) SetCollectionResource(v string)` + +SetCollectionResource sets CollectionResource field to given value. + + +### GetResourceId + +`func (o *ClaimRequest) GetResourceId() string` + +GetResourceId returns the ResourceId field if non-nil, zero value otherwise. + +### GetResourceIdOk + +`func (o *ClaimRequest) GetResourceIdOk() (*string, bool)` + +GetResourceIdOk returns a tuple with the ResourceId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetResourceId + +`func (o *ClaimRequest) SetResourceId(v string)` + +SetResourceId sets ResourceId field to given value. + + + +[[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/docs/Client.md b/docs/Client.md new file mode 100644 index 0000000..f1bc715 --- /dev/null +++ b/docs/Client.md @@ -0,0 +1,196 @@ +# Client + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClientId** | **string** | The unique ID of the client. | [readonly] +**CreatedTime** | **time.Time** | | [readonly] +**Name** | Pointer to **NullableString** | The name of the client | [optional] +**Options** | Pointer to [**ClientOptions**](ClientOptions.md) | | [optional] +**VerificationKeys** | Pointer to [**[]ClientAccessKey**](ClientAccessKey.md) | A list of the service client access keys. | [optional] [readonly] +**Tags** | Pointer to **map[string]string** | The tags associated with this resource, this property is an map. { key1: value1, key2: value2 } | [optional] + +## Methods + +### NewClient + +`func NewClient(clientId string, createdTime time.Time, ) *Client` + +NewClient instantiates a new Client object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewClientWithDefaults + +`func NewClientWithDefaults() *Client` + +NewClientWithDefaults instantiates a new Client object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetClientId + +`func (o *Client) GetClientId() string` + +GetClientId returns the ClientId field if non-nil, zero value otherwise. + +### GetClientIdOk + +`func (o *Client) GetClientIdOk() (*string, bool)` + +GetClientIdOk returns a tuple with the ClientId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetClientId + +`func (o *Client) SetClientId(v string)` + +SetClientId sets ClientId field to given value. + + +### GetCreatedTime + +`func (o *Client) GetCreatedTime() time.Time` + +GetCreatedTime returns the CreatedTime field if non-nil, zero value otherwise. + +### GetCreatedTimeOk + +`func (o *Client) GetCreatedTimeOk() (*time.Time, bool)` + +GetCreatedTimeOk returns a tuple with the CreatedTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedTime + +`func (o *Client) SetCreatedTime(v time.Time)` + +SetCreatedTime sets CreatedTime field to given value. + + +### GetName + +`func (o *Client) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Client) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *Client) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *Client) HasName() bool` + +HasName returns a boolean if a field has been set. + +### SetNameNil + +`func (o *Client) SetNameNil(b bool)` + + SetNameNil sets the value for Name to be an explicit nil + +### UnsetName +`func (o *Client) UnsetName()` + +UnsetName ensures that no value is present for Name, not even an explicit nil +### GetOptions + +`func (o *Client) GetOptions() ClientOptions` + +GetOptions returns the Options field if non-nil, zero value otherwise. + +### GetOptionsOk + +`func (o *Client) GetOptionsOk() (*ClientOptions, bool)` + +GetOptionsOk returns a tuple with the Options field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOptions + +`func (o *Client) SetOptions(v ClientOptions)` + +SetOptions sets Options field to given value. + +### HasOptions + +`func (o *Client) HasOptions() bool` + +HasOptions returns a boolean if a field has been set. + +### GetVerificationKeys + +`func (o *Client) GetVerificationKeys() []ClientAccessKey` + +GetVerificationKeys returns the VerificationKeys field if non-nil, zero value otherwise. + +### GetVerificationKeysOk + +`func (o *Client) GetVerificationKeysOk() (*[]ClientAccessKey, bool)` + +GetVerificationKeysOk returns a tuple with the VerificationKeys field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVerificationKeys + +`func (o *Client) SetVerificationKeys(v []ClientAccessKey)` + +SetVerificationKeys sets VerificationKeys field to given value. + +### HasVerificationKeys + +`func (o *Client) HasVerificationKeys() bool` + +HasVerificationKeys returns a boolean if a field has been set. + +### GetTags + +`func (o *Client) GetTags() map[string]string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *Client) GetTagsOk() (*map[string]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *Client) SetTags(v map[string]string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *Client) HasTags() bool` + +HasTags returns a boolean if a field has been set. + +### SetTagsNil + +`func (o *Client) SetTagsNil(b bool)` + + SetTagsNil sets the value for Tags to be an explicit nil + +### UnsetTags +`func (o *Client) UnsetTags()` + +UnsetTags ensures that no value is present for Tags, not even an explicit nil + +[[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/docs/ClientAccessKey.md b/docs/ClientAccessKey.md new file mode 100644 index 0000000..cfa0816 --- /dev/null +++ b/docs/ClientAccessKey.md @@ -0,0 +1,191 @@ +# ClientAccessKey + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**KeyId** | Pointer to **string** | The unique ID of the client. | [optional] [readonly] +**ClientId** | **string** | The unique ID of the client. | [readonly] +**PublicKey** | Pointer to **NullableString** | Specify a public key on access key creation to bring your own private key. When left blank, Authress will automatically generate a private and public key pair and then return the private key as part of the request. This property holds the public key. | [optional] +**GenerationDate** | Pointer to **time.Time** | | [optional] [readonly] +**ClientSecret** | Pointer to **string** | The unencoded OAuth client secret used with the OAuth endpoints to request a JWT using the `client_credentials` grant type. Pass the clientId and the clientSecret to the documented /tokens endpoint. | [optional] [readonly] +**AccessKey** | Pointer to **string** | An encoded access key which contains identifying information for client access token creation. For direct use with the Authress SDKs. This private access key must be saved on first creation as it is discarded afterwards. Authress only saves the corresponding public key to verify the private access key. | [optional] [readonly] + +## Methods + +### NewClientAccessKey + +`func NewClientAccessKey(clientId string, ) *ClientAccessKey` + +NewClientAccessKey instantiates a new ClientAccessKey object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewClientAccessKeyWithDefaults + +`func NewClientAccessKeyWithDefaults() *ClientAccessKey` + +NewClientAccessKeyWithDefaults instantiates a new ClientAccessKey object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetKeyId + +`func (o *ClientAccessKey) GetKeyId() string` + +GetKeyId returns the KeyId field if non-nil, zero value otherwise. + +### GetKeyIdOk + +`func (o *ClientAccessKey) GetKeyIdOk() (*string, bool)` + +GetKeyIdOk returns a tuple with the KeyId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKeyId + +`func (o *ClientAccessKey) SetKeyId(v string)` + +SetKeyId sets KeyId field to given value. + +### HasKeyId + +`func (o *ClientAccessKey) HasKeyId() bool` + +HasKeyId returns a boolean if a field has been set. + +### GetClientId + +`func (o *ClientAccessKey) GetClientId() string` + +GetClientId returns the ClientId field if non-nil, zero value otherwise. + +### GetClientIdOk + +`func (o *ClientAccessKey) GetClientIdOk() (*string, bool)` + +GetClientIdOk returns a tuple with the ClientId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetClientId + +`func (o *ClientAccessKey) SetClientId(v string)` + +SetClientId sets ClientId field to given value. + + +### GetPublicKey + +`func (o *ClientAccessKey) GetPublicKey() string` + +GetPublicKey returns the PublicKey field if non-nil, zero value otherwise. + +### GetPublicKeyOk + +`func (o *ClientAccessKey) GetPublicKeyOk() (*string, bool)` + +GetPublicKeyOk returns a tuple with the PublicKey field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPublicKey + +`func (o *ClientAccessKey) SetPublicKey(v string)` + +SetPublicKey sets PublicKey field to given value. + +### HasPublicKey + +`func (o *ClientAccessKey) HasPublicKey() bool` + +HasPublicKey returns a boolean if a field has been set. + +### SetPublicKeyNil + +`func (o *ClientAccessKey) SetPublicKeyNil(b bool)` + + SetPublicKeyNil sets the value for PublicKey to be an explicit nil + +### UnsetPublicKey +`func (o *ClientAccessKey) UnsetPublicKey()` + +UnsetPublicKey ensures that no value is present for PublicKey, not even an explicit nil +### GetGenerationDate + +`func (o *ClientAccessKey) GetGenerationDate() time.Time` + +GetGenerationDate returns the GenerationDate field if non-nil, zero value otherwise. + +### GetGenerationDateOk + +`func (o *ClientAccessKey) GetGenerationDateOk() (*time.Time, bool)` + +GetGenerationDateOk returns a tuple with the GenerationDate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGenerationDate + +`func (o *ClientAccessKey) SetGenerationDate(v time.Time)` + +SetGenerationDate sets GenerationDate field to given value. + +### HasGenerationDate + +`func (o *ClientAccessKey) HasGenerationDate() bool` + +HasGenerationDate returns a boolean if a field has been set. + +### GetClientSecret + +`func (o *ClientAccessKey) GetClientSecret() string` + +GetClientSecret returns the ClientSecret field if non-nil, zero value otherwise. + +### GetClientSecretOk + +`func (o *ClientAccessKey) GetClientSecretOk() (*string, bool)` + +GetClientSecretOk returns a tuple with the ClientSecret field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetClientSecret + +`func (o *ClientAccessKey) SetClientSecret(v string)` + +SetClientSecret sets ClientSecret field to given value. + +### HasClientSecret + +`func (o *ClientAccessKey) HasClientSecret() bool` + +HasClientSecret returns a boolean if a field has been set. + +### GetAccessKey + +`func (o *ClientAccessKey) GetAccessKey() string` + +GetAccessKey returns the AccessKey field if non-nil, zero value otherwise. + +### GetAccessKeyOk + +`func (o *ClientAccessKey) GetAccessKeyOk() (*string, bool)` + +GetAccessKeyOk returns a tuple with the AccessKey field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccessKey + +`func (o *ClientAccessKey) SetAccessKey(v string)` + +SetAccessKey sets AccessKey field to given value. + +### HasAccessKey + +`func (o *ClientAccessKey) HasAccessKey() bool` + +HasAccessKey returns a boolean if a field has been set. + + +[[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/docs/ClientCollection.md b/docs/ClientCollection.md new file mode 100644 index 0000000..5a10c2e --- /dev/null +++ b/docs/ClientCollection.md @@ -0,0 +1,98 @@ +# ClientCollection + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Clients** | [**[]Client**](Client.md) | A list of clients | +**Pagination** | Pointer to [**Pagination**](Pagination.md) | | [optional] +**Links** | [**CollectionLinks**](CollectionLinks.md) | | + +## Methods + +### NewClientCollection + +`func NewClientCollection(clients []Client, links CollectionLinks, ) *ClientCollection` + +NewClientCollection instantiates a new ClientCollection object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewClientCollectionWithDefaults + +`func NewClientCollectionWithDefaults() *ClientCollection` + +NewClientCollectionWithDefaults instantiates a new ClientCollection object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetClients + +`func (o *ClientCollection) GetClients() []Client` + +GetClients returns the Clients field if non-nil, zero value otherwise. + +### GetClientsOk + +`func (o *ClientCollection) GetClientsOk() (*[]Client, bool)` + +GetClientsOk returns a tuple with the Clients field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetClients + +`func (o *ClientCollection) SetClients(v []Client)` + +SetClients sets Clients field to given value. + + +### GetPagination + +`func (o *ClientCollection) GetPagination() Pagination` + +GetPagination returns the Pagination field if non-nil, zero value otherwise. + +### GetPaginationOk + +`func (o *ClientCollection) GetPaginationOk() (*Pagination, bool)` + +GetPaginationOk returns a tuple with the Pagination field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPagination + +`func (o *ClientCollection) SetPagination(v Pagination)` + +SetPagination sets Pagination field to given value. + +### HasPagination + +`func (o *ClientCollection) HasPagination() bool` + +HasPagination returns a boolean if a field has been set. + +### GetLinks + +`func (o *ClientCollection) GetLinks() CollectionLinks` + +GetLinks returns the Links field if non-nil, zero value otherwise. + +### GetLinksOk + +`func (o *ClientCollection) GetLinksOk() (*CollectionLinks, bool)` + +GetLinksOk returns a tuple with the Links field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLinks + +`func (o *ClientCollection) SetLinks(v CollectionLinks)` + +SetLinks sets Links field to given value. + + + +[[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/docs/ClientOptions.md b/docs/ClientOptions.md new file mode 100644 index 0000000..8880129 --- /dev/null +++ b/docs/ClientOptions.md @@ -0,0 +1,102 @@ +# ClientOptions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**GrantUserPermissionsAccess** | Pointer to **NullableBool** | Grant the client access to verify authorization on behalf of any user. | [optional] [default to false] +**GrantTokenGeneration** | Pointer to **NullableBool** | Grant the client access to generate oauth tokens on behalf of the Authress account. **Security Warning**: This means that this client can impersonate any user, and should only be used when connecting an existing custom Authorization Server to Authress, when that server does not support a standard OAuth connection. | [optional] [default to false] + +## Methods + +### NewClientOptions + +`func NewClientOptions() *ClientOptions` + +NewClientOptions instantiates a new ClientOptions object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewClientOptionsWithDefaults + +`func NewClientOptionsWithDefaults() *ClientOptions` + +NewClientOptionsWithDefaults instantiates a new ClientOptions object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetGrantUserPermissionsAccess + +`func (o *ClientOptions) GetGrantUserPermissionsAccess() bool` + +GetGrantUserPermissionsAccess returns the GrantUserPermissionsAccess field if non-nil, zero value otherwise. + +### GetGrantUserPermissionsAccessOk + +`func (o *ClientOptions) GetGrantUserPermissionsAccessOk() (*bool, bool)` + +GetGrantUserPermissionsAccessOk returns a tuple with the GrantUserPermissionsAccess field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGrantUserPermissionsAccess + +`func (o *ClientOptions) SetGrantUserPermissionsAccess(v bool)` + +SetGrantUserPermissionsAccess sets GrantUserPermissionsAccess field to given value. + +### HasGrantUserPermissionsAccess + +`func (o *ClientOptions) HasGrantUserPermissionsAccess() bool` + +HasGrantUserPermissionsAccess returns a boolean if a field has been set. + +### SetGrantUserPermissionsAccessNil + +`func (o *ClientOptions) SetGrantUserPermissionsAccessNil(b bool)` + + SetGrantUserPermissionsAccessNil sets the value for GrantUserPermissionsAccess to be an explicit nil + +### UnsetGrantUserPermissionsAccess +`func (o *ClientOptions) UnsetGrantUserPermissionsAccess()` + +UnsetGrantUserPermissionsAccess ensures that no value is present for GrantUserPermissionsAccess, not even an explicit nil +### GetGrantTokenGeneration + +`func (o *ClientOptions) GetGrantTokenGeneration() bool` + +GetGrantTokenGeneration returns the GrantTokenGeneration field if non-nil, zero value otherwise. + +### GetGrantTokenGenerationOk + +`func (o *ClientOptions) GetGrantTokenGenerationOk() (*bool, bool)` + +GetGrantTokenGenerationOk returns a tuple with the GrantTokenGeneration field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGrantTokenGeneration + +`func (o *ClientOptions) SetGrantTokenGeneration(v bool)` + +SetGrantTokenGeneration sets GrantTokenGeneration field to given value. + +### HasGrantTokenGeneration + +`func (o *ClientOptions) HasGrantTokenGeneration() bool` + +HasGrantTokenGeneration returns a boolean if a field has been set. + +### SetGrantTokenGenerationNil + +`func (o *ClientOptions) SetGrantTokenGenerationNil(b bool)` + + SetGrantTokenGenerationNil sets the value for GrantTokenGeneration to be an explicit nil + +### UnsetGrantTokenGeneration +`func (o *ClientOptions) UnsetGrantTokenGeneration()` + +UnsetGrantTokenGeneration ensures that no value is present for GrantTokenGeneration, not even an explicit nil + +[[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/docs/CollectionLinks.md b/docs/CollectionLinks.md new file mode 100644 index 0000000..9178a14 --- /dev/null +++ b/docs/CollectionLinks.md @@ -0,0 +1,97 @@ +# CollectionLinks + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Self** | [**NullableLink**](Link.md) | | +**Next** | Pointer to [**NullableLink**](Link.md) | | [optional] + +## Methods + +### NewCollectionLinks + +`func NewCollectionLinks(self NullableLink, ) *CollectionLinks` + +NewCollectionLinks instantiates a new CollectionLinks object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCollectionLinksWithDefaults + +`func NewCollectionLinksWithDefaults() *CollectionLinks` + +NewCollectionLinksWithDefaults instantiates a new CollectionLinks object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetSelf + +`func (o *CollectionLinks) GetSelf() Link` + +GetSelf returns the Self field if non-nil, zero value otherwise. + +### GetSelfOk + +`func (o *CollectionLinks) GetSelfOk() (*Link, bool)` + +GetSelfOk returns a tuple with the Self field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSelf + +`func (o *CollectionLinks) SetSelf(v Link)` + +SetSelf sets Self field to given value. + + +### SetSelfNil + +`func (o *CollectionLinks) SetSelfNil(b bool)` + + SetSelfNil sets the value for Self to be an explicit nil + +### UnsetSelf +`func (o *CollectionLinks) UnsetSelf()` + +UnsetSelf ensures that no value is present for Self, not even an explicit nil +### GetNext + +`func (o *CollectionLinks) GetNext() Link` + +GetNext returns the Next field if non-nil, zero value otherwise. + +### GetNextOk + +`func (o *CollectionLinks) GetNextOk() (*Link, bool)` + +GetNextOk returns a tuple with the Next field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNext + +`func (o *CollectionLinks) SetNext(v Link)` + +SetNext sets Next field to given value. + +### HasNext + +`func (o *CollectionLinks) HasNext() bool` + +HasNext returns a boolean if a field has been set. + +### SetNextNil + +`func (o *CollectionLinks) SetNextNil(b bool)` + + SetNextNil sets the value for Next to be an explicit nil + +### UnsetNext +`func (o *CollectionLinks) UnsetNext()` + +UnsetNext ensures that no value is present for Next, not even an explicit nil + +[[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/docs/Connection.md b/docs/Connection.md new file mode 100644 index 0000000..4075c3d --- /dev/null +++ b/docs/Connection.md @@ -0,0 +1,468 @@ +# Connection + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | Pointer to **string** | | [optional] [default to "OAUTH2"] +**ConnectionId** | Pointer to **NullableString** | | [optional] +**AuthenticationUrl** | Pointer to **string** | Authorization URL of the provider (where the user logs in). For OAuth this is the authorization URL, for SAML, this is the **SSO URL**. | [optional] +**TokenUrl** | Pointer to **NullableString** | The token exchange url (where we validate the token). | [optional] +**IssuerUrl** | Pointer to **NullableString** | The unique identifier tied to the provider's domain used for TLS verification. In OAuth, this is the JWT **iss** property. in SAML this is the **Entity ID**. | [optional] +**ProviderCertificate** | Pointer to **NullableString** | The Provider's SAML public certificate which can be used to verify the signature in signed SAML assertions from the provider. | [optional] +**ClientId** | Pointer to **NullableString** | Provider's client ID used to verify the token | [optional] +**ClientSecret** | Pointer to **NullableString** | Provider's client secret used to verify the token | [optional] +**UserDataConfiguration** | Pointer to [**NullableConnectionUserDataConfiguration**](ConnectionUserDataConfiguration.md) | | [optional] +**Data** | Pointer to [**NullableConnectionData**](ConnectionData.md) | | [optional] +**DefaultConnectionProperties** | Pointer to [**NullableConnectionDefaultConnectionProperties**](ConnectionDefaultConnectionProperties.md) | | [optional] +**CreatedTime** | Pointer to **time.Time** | | [optional] [readonly] +**Tags** | Pointer to **map[string]string** | The tags associated with this resource, this property is an map. { key1: value1, key2: value2 } | [optional] + +## Methods + +### NewConnection + +`func NewConnection() *Connection` + +NewConnection instantiates a new Connection object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewConnectionWithDefaults + +`func NewConnectionWithDefaults() *Connection` + +NewConnectionWithDefaults instantiates a new Connection object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetType + +`func (o *Connection) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *Connection) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *Connection) SetType(v string)` + +SetType sets Type field to given value. + +### HasType + +`func (o *Connection) HasType() bool` + +HasType returns a boolean if a field has been set. + +### GetConnectionId + +`func (o *Connection) GetConnectionId() string` + +GetConnectionId returns the ConnectionId field if non-nil, zero value otherwise. + +### GetConnectionIdOk + +`func (o *Connection) GetConnectionIdOk() (*string, bool)` + +GetConnectionIdOk returns a tuple with the ConnectionId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetConnectionId + +`func (o *Connection) SetConnectionId(v string)` + +SetConnectionId sets ConnectionId field to given value. + +### HasConnectionId + +`func (o *Connection) HasConnectionId() bool` + +HasConnectionId returns a boolean if a field has been set. + +### SetConnectionIdNil + +`func (o *Connection) SetConnectionIdNil(b bool)` + + SetConnectionIdNil sets the value for ConnectionId to be an explicit nil + +### UnsetConnectionId +`func (o *Connection) UnsetConnectionId()` + +UnsetConnectionId ensures that no value is present for ConnectionId, not even an explicit nil +### GetAuthenticationUrl + +`func (o *Connection) GetAuthenticationUrl() string` + +GetAuthenticationUrl returns the AuthenticationUrl field if non-nil, zero value otherwise. + +### GetAuthenticationUrlOk + +`func (o *Connection) GetAuthenticationUrlOk() (*string, bool)` + +GetAuthenticationUrlOk returns a tuple with the AuthenticationUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAuthenticationUrl + +`func (o *Connection) SetAuthenticationUrl(v string)` + +SetAuthenticationUrl sets AuthenticationUrl field to given value. + +### HasAuthenticationUrl + +`func (o *Connection) HasAuthenticationUrl() bool` + +HasAuthenticationUrl returns a boolean if a field has been set. + +### GetTokenUrl + +`func (o *Connection) GetTokenUrl() string` + +GetTokenUrl returns the TokenUrl field if non-nil, zero value otherwise. + +### GetTokenUrlOk + +`func (o *Connection) GetTokenUrlOk() (*string, bool)` + +GetTokenUrlOk returns a tuple with the TokenUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTokenUrl + +`func (o *Connection) SetTokenUrl(v string)` + +SetTokenUrl sets TokenUrl field to given value. + +### HasTokenUrl + +`func (o *Connection) HasTokenUrl() bool` + +HasTokenUrl returns a boolean if a field has been set. + +### SetTokenUrlNil + +`func (o *Connection) SetTokenUrlNil(b bool)` + + SetTokenUrlNil sets the value for TokenUrl to be an explicit nil + +### UnsetTokenUrl +`func (o *Connection) UnsetTokenUrl()` + +UnsetTokenUrl ensures that no value is present for TokenUrl, not even an explicit nil +### GetIssuerUrl + +`func (o *Connection) GetIssuerUrl() string` + +GetIssuerUrl returns the IssuerUrl field if non-nil, zero value otherwise. + +### GetIssuerUrlOk + +`func (o *Connection) GetIssuerUrlOk() (*string, bool)` + +GetIssuerUrlOk returns a tuple with the IssuerUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIssuerUrl + +`func (o *Connection) SetIssuerUrl(v string)` + +SetIssuerUrl sets IssuerUrl field to given value. + +### HasIssuerUrl + +`func (o *Connection) HasIssuerUrl() bool` + +HasIssuerUrl returns a boolean if a field has been set. + +### SetIssuerUrlNil + +`func (o *Connection) SetIssuerUrlNil(b bool)` + + SetIssuerUrlNil sets the value for IssuerUrl to be an explicit nil + +### UnsetIssuerUrl +`func (o *Connection) UnsetIssuerUrl()` + +UnsetIssuerUrl ensures that no value is present for IssuerUrl, not even an explicit nil +### GetProviderCertificate + +`func (o *Connection) GetProviderCertificate() string` + +GetProviderCertificate returns the ProviderCertificate field if non-nil, zero value otherwise. + +### GetProviderCertificateOk + +`func (o *Connection) GetProviderCertificateOk() (*string, bool)` + +GetProviderCertificateOk returns a tuple with the ProviderCertificate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProviderCertificate + +`func (o *Connection) SetProviderCertificate(v string)` + +SetProviderCertificate sets ProviderCertificate field to given value. + +### HasProviderCertificate + +`func (o *Connection) HasProviderCertificate() bool` + +HasProviderCertificate returns a boolean if a field has been set. + +### SetProviderCertificateNil + +`func (o *Connection) SetProviderCertificateNil(b bool)` + + SetProviderCertificateNil sets the value for ProviderCertificate to be an explicit nil + +### UnsetProviderCertificate +`func (o *Connection) UnsetProviderCertificate()` + +UnsetProviderCertificate ensures that no value is present for ProviderCertificate, not even an explicit nil +### GetClientId + +`func (o *Connection) GetClientId() string` + +GetClientId returns the ClientId field if non-nil, zero value otherwise. + +### GetClientIdOk + +`func (o *Connection) GetClientIdOk() (*string, bool)` + +GetClientIdOk returns a tuple with the ClientId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetClientId + +`func (o *Connection) SetClientId(v string)` + +SetClientId sets ClientId field to given value. + +### HasClientId + +`func (o *Connection) HasClientId() bool` + +HasClientId returns a boolean if a field has been set. + +### SetClientIdNil + +`func (o *Connection) SetClientIdNil(b bool)` + + SetClientIdNil sets the value for ClientId to be an explicit nil + +### UnsetClientId +`func (o *Connection) UnsetClientId()` + +UnsetClientId ensures that no value is present for ClientId, not even an explicit nil +### GetClientSecret + +`func (o *Connection) GetClientSecret() string` + +GetClientSecret returns the ClientSecret field if non-nil, zero value otherwise. + +### GetClientSecretOk + +`func (o *Connection) GetClientSecretOk() (*string, bool)` + +GetClientSecretOk returns a tuple with the ClientSecret field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetClientSecret + +`func (o *Connection) SetClientSecret(v string)` + +SetClientSecret sets ClientSecret field to given value. + +### HasClientSecret + +`func (o *Connection) HasClientSecret() bool` + +HasClientSecret returns a boolean if a field has been set. + +### SetClientSecretNil + +`func (o *Connection) SetClientSecretNil(b bool)` + + SetClientSecretNil sets the value for ClientSecret to be an explicit nil + +### UnsetClientSecret +`func (o *Connection) UnsetClientSecret()` + +UnsetClientSecret ensures that no value is present for ClientSecret, not even an explicit nil +### GetUserDataConfiguration + +`func (o *Connection) GetUserDataConfiguration() ConnectionUserDataConfiguration` + +GetUserDataConfiguration returns the UserDataConfiguration field if non-nil, zero value otherwise. + +### GetUserDataConfigurationOk + +`func (o *Connection) GetUserDataConfigurationOk() (*ConnectionUserDataConfiguration, bool)` + +GetUserDataConfigurationOk returns a tuple with the UserDataConfiguration field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserDataConfiguration + +`func (o *Connection) SetUserDataConfiguration(v ConnectionUserDataConfiguration)` + +SetUserDataConfiguration sets UserDataConfiguration field to given value. + +### HasUserDataConfiguration + +`func (o *Connection) HasUserDataConfiguration() bool` + +HasUserDataConfiguration returns a boolean if a field has been set. + +### SetUserDataConfigurationNil + +`func (o *Connection) SetUserDataConfigurationNil(b bool)` + + SetUserDataConfigurationNil sets the value for UserDataConfiguration to be an explicit nil + +### UnsetUserDataConfiguration +`func (o *Connection) UnsetUserDataConfiguration()` + +UnsetUserDataConfiguration ensures that no value is present for UserDataConfiguration, not even an explicit nil +### GetData + +`func (o *Connection) GetData() ConnectionData` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *Connection) GetDataOk() (*ConnectionData, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *Connection) SetData(v ConnectionData)` + +SetData sets Data field to given value. + +### HasData + +`func (o *Connection) HasData() bool` + +HasData returns a boolean if a field has been set. + +### SetDataNil + +`func (o *Connection) SetDataNil(b bool)` + + SetDataNil sets the value for Data to be an explicit nil + +### UnsetData +`func (o *Connection) UnsetData()` + +UnsetData ensures that no value is present for Data, not even an explicit nil +### GetDefaultConnectionProperties + +`func (o *Connection) GetDefaultConnectionProperties() ConnectionDefaultConnectionProperties` + +GetDefaultConnectionProperties returns the DefaultConnectionProperties field if non-nil, zero value otherwise. + +### GetDefaultConnectionPropertiesOk + +`func (o *Connection) GetDefaultConnectionPropertiesOk() (*ConnectionDefaultConnectionProperties, bool)` + +GetDefaultConnectionPropertiesOk returns a tuple with the DefaultConnectionProperties field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDefaultConnectionProperties + +`func (o *Connection) SetDefaultConnectionProperties(v ConnectionDefaultConnectionProperties)` + +SetDefaultConnectionProperties sets DefaultConnectionProperties field to given value. + +### HasDefaultConnectionProperties + +`func (o *Connection) HasDefaultConnectionProperties() bool` + +HasDefaultConnectionProperties returns a boolean if a field has been set. + +### SetDefaultConnectionPropertiesNil + +`func (o *Connection) SetDefaultConnectionPropertiesNil(b bool)` + + SetDefaultConnectionPropertiesNil sets the value for DefaultConnectionProperties to be an explicit nil + +### UnsetDefaultConnectionProperties +`func (o *Connection) UnsetDefaultConnectionProperties()` + +UnsetDefaultConnectionProperties ensures that no value is present for DefaultConnectionProperties, not even an explicit nil +### GetCreatedTime + +`func (o *Connection) GetCreatedTime() time.Time` + +GetCreatedTime returns the CreatedTime field if non-nil, zero value otherwise. + +### GetCreatedTimeOk + +`func (o *Connection) GetCreatedTimeOk() (*time.Time, bool)` + +GetCreatedTimeOk returns a tuple with the CreatedTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedTime + +`func (o *Connection) SetCreatedTime(v time.Time)` + +SetCreatedTime sets CreatedTime field to given value. + +### HasCreatedTime + +`func (o *Connection) HasCreatedTime() bool` + +HasCreatedTime returns a boolean if a field has been set. + +### GetTags + +`func (o *Connection) GetTags() map[string]string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *Connection) GetTagsOk() (*map[string]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *Connection) SetTags(v map[string]string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *Connection) HasTags() bool` + +HasTags returns a boolean if a field has been set. + +### SetTagsNil + +`func (o *Connection) SetTagsNil(b bool)` + + SetTagsNil sets the value for Tags to be an explicit nil + +### UnsetTags +`func (o *Connection) UnsetTags()` + +UnsetTags ensures that no value is present for Tags, not even an explicit nil + +[[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/docs/ConnectionCollection.md b/docs/ConnectionCollection.md new file mode 100644 index 0000000..e3484e4 --- /dev/null +++ b/docs/ConnectionCollection.md @@ -0,0 +1,77 @@ +# ConnectionCollection + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Connections** | [**[]Connection**](Connection.md) | | +**Pagination** | Pointer to [**Pagination**](Pagination.md) | | [optional] + +## Methods + +### NewConnectionCollection + +`func NewConnectionCollection(connections []Connection, ) *ConnectionCollection` + +NewConnectionCollection instantiates a new ConnectionCollection object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewConnectionCollectionWithDefaults + +`func NewConnectionCollectionWithDefaults() *ConnectionCollection` + +NewConnectionCollectionWithDefaults instantiates a new ConnectionCollection object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetConnections + +`func (o *ConnectionCollection) GetConnections() []Connection` + +GetConnections returns the Connections field if non-nil, zero value otherwise. + +### GetConnectionsOk + +`func (o *ConnectionCollection) GetConnectionsOk() (*[]Connection, bool)` + +GetConnectionsOk returns a tuple with the Connections field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetConnections + +`func (o *ConnectionCollection) SetConnections(v []Connection)` + +SetConnections sets Connections field to given value. + + +### GetPagination + +`func (o *ConnectionCollection) GetPagination() Pagination` + +GetPagination returns the Pagination field if non-nil, zero value otherwise. + +### GetPaginationOk + +`func (o *ConnectionCollection) GetPaginationOk() (*Pagination, bool)` + +GetPaginationOk returns a tuple with the Pagination field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPagination + +`func (o *ConnectionCollection) SetPagination(v Pagination)` + +SetPagination sets Pagination field to given value. + +### HasPagination + +`func (o *ConnectionCollection) HasPagination() bool` + +HasPagination returns a boolean if a field has been set. + + +[[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/docs/ConnectionData.md b/docs/ConnectionData.md new file mode 100644 index 0000000..aa9ec44 --- /dev/null +++ b/docs/ConnectionData.md @@ -0,0 +1,236 @@ +# ConnectionData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TenantId** | Pointer to [**TenantId**](TenantId.md) | | [optional] +**Name** | Pointer to **NullableString** | The name of this connection when displayed in the Authress management portal | [optional] +**SupportedContentType** | Pointer to **NullableString** | URL encode OAuth token parameters - Some authentication APIs don't support JSON, in these cases enable the url encoded form data parameters. | [optional] [default to "application/json"] +**OidcUserEndpointUrl** | Pointer to **NullableString** | By default, the **sub** claim of the JWT is used to identify the user from this provider. However, not all providers are OpenID compliant. Here you can provide an optional user data endpoint to fetch additional user profile information and an expression to identify a new user ID from available properties. | [optional] +**UserIdExpression** | Pointer to **NullableString** | By default, the **sub** claim of the JWT is used to identify the user from this provider. However, not all providers are OpenID compliant. Here you can provide an optional user expression to identify a new user ID from available properties found from the oidcUserEndpointUrl. (The default is **{sub}**, any claims may be used.) | [optional] [default to "{sub}"] +**TrustIdentityUserId** | Pointer to **NullableBool** | Authress generates unique user IDs for every user, however if you trust your identity provider to handle unique ID generate across **ALL customers**, then it is safe to reuse the user ID from the provider. | [optional] [default to false] + +## Methods + +### NewConnectionData + +`func NewConnectionData() *ConnectionData` + +NewConnectionData instantiates a new ConnectionData object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewConnectionDataWithDefaults + +`func NewConnectionDataWithDefaults() *ConnectionData` + +NewConnectionDataWithDefaults instantiates a new ConnectionData object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTenantId + +`func (o *ConnectionData) GetTenantId() TenantId` + +GetTenantId returns the TenantId field if non-nil, zero value otherwise. + +### GetTenantIdOk + +`func (o *ConnectionData) GetTenantIdOk() (*TenantId, bool)` + +GetTenantIdOk returns a tuple with the TenantId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTenantId + +`func (o *ConnectionData) SetTenantId(v TenantId)` + +SetTenantId sets TenantId field to given value. + +### HasTenantId + +`func (o *ConnectionData) HasTenantId() bool` + +HasTenantId returns a boolean if a field has been set. + +### GetName + +`func (o *ConnectionData) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *ConnectionData) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *ConnectionData) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *ConnectionData) HasName() bool` + +HasName returns a boolean if a field has been set. + +### SetNameNil + +`func (o *ConnectionData) SetNameNil(b bool)` + + SetNameNil sets the value for Name to be an explicit nil + +### UnsetName +`func (o *ConnectionData) UnsetName()` + +UnsetName ensures that no value is present for Name, not even an explicit nil +### GetSupportedContentType + +`func (o *ConnectionData) GetSupportedContentType() string` + +GetSupportedContentType returns the SupportedContentType field if non-nil, zero value otherwise. + +### GetSupportedContentTypeOk + +`func (o *ConnectionData) GetSupportedContentTypeOk() (*string, bool)` + +GetSupportedContentTypeOk returns a tuple with the SupportedContentType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSupportedContentType + +`func (o *ConnectionData) SetSupportedContentType(v string)` + +SetSupportedContentType sets SupportedContentType field to given value. + +### HasSupportedContentType + +`func (o *ConnectionData) HasSupportedContentType() bool` + +HasSupportedContentType returns a boolean if a field has been set. + +### SetSupportedContentTypeNil + +`func (o *ConnectionData) SetSupportedContentTypeNil(b bool)` + + SetSupportedContentTypeNil sets the value for SupportedContentType to be an explicit nil + +### UnsetSupportedContentType +`func (o *ConnectionData) UnsetSupportedContentType()` + +UnsetSupportedContentType ensures that no value is present for SupportedContentType, not even an explicit nil +### GetOidcUserEndpointUrl + +`func (o *ConnectionData) GetOidcUserEndpointUrl() string` + +GetOidcUserEndpointUrl returns the OidcUserEndpointUrl field if non-nil, zero value otherwise. + +### GetOidcUserEndpointUrlOk + +`func (o *ConnectionData) GetOidcUserEndpointUrlOk() (*string, bool)` + +GetOidcUserEndpointUrlOk returns a tuple with the OidcUserEndpointUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOidcUserEndpointUrl + +`func (o *ConnectionData) SetOidcUserEndpointUrl(v string)` + +SetOidcUserEndpointUrl sets OidcUserEndpointUrl field to given value. + +### HasOidcUserEndpointUrl + +`func (o *ConnectionData) HasOidcUserEndpointUrl() bool` + +HasOidcUserEndpointUrl returns a boolean if a field has been set. + +### SetOidcUserEndpointUrlNil + +`func (o *ConnectionData) SetOidcUserEndpointUrlNil(b bool)` + + SetOidcUserEndpointUrlNil sets the value for OidcUserEndpointUrl to be an explicit nil + +### UnsetOidcUserEndpointUrl +`func (o *ConnectionData) UnsetOidcUserEndpointUrl()` + +UnsetOidcUserEndpointUrl ensures that no value is present for OidcUserEndpointUrl, not even an explicit nil +### GetUserIdExpression + +`func (o *ConnectionData) GetUserIdExpression() string` + +GetUserIdExpression returns the UserIdExpression field if non-nil, zero value otherwise. + +### GetUserIdExpressionOk + +`func (o *ConnectionData) GetUserIdExpressionOk() (*string, bool)` + +GetUserIdExpressionOk returns a tuple with the UserIdExpression field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserIdExpression + +`func (o *ConnectionData) SetUserIdExpression(v string)` + +SetUserIdExpression sets UserIdExpression field to given value. + +### HasUserIdExpression + +`func (o *ConnectionData) HasUserIdExpression() bool` + +HasUserIdExpression returns a boolean if a field has been set. + +### SetUserIdExpressionNil + +`func (o *ConnectionData) SetUserIdExpressionNil(b bool)` + + SetUserIdExpressionNil sets the value for UserIdExpression to be an explicit nil + +### UnsetUserIdExpression +`func (o *ConnectionData) UnsetUserIdExpression()` + +UnsetUserIdExpression ensures that no value is present for UserIdExpression, not even an explicit nil +### GetTrustIdentityUserId + +`func (o *ConnectionData) GetTrustIdentityUserId() bool` + +GetTrustIdentityUserId returns the TrustIdentityUserId field if non-nil, zero value otherwise. + +### GetTrustIdentityUserIdOk + +`func (o *ConnectionData) GetTrustIdentityUserIdOk() (*bool, bool)` + +GetTrustIdentityUserIdOk returns a tuple with the TrustIdentityUserId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTrustIdentityUserId + +`func (o *ConnectionData) SetTrustIdentityUserId(v bool)` + +SetTrustIdentityUserId sets TrustIdentityUserId field to given value. + +### HasTrustIdentityUserId + +`func (o *ConnectionData) HasTrustIdentityUserId() bool` + +HasTrustIdentityUserId returns a boolean if a field has been set. + +### SetTrustIdentityUserIdNil + +`func (o *ConnectionData) SetTrustIdentityUserIdNil(b bool)` + + SetTrustIdentityUserIdNil sets the value for TrustIdentityUserId to be an explicit nil + +### UnsetTrustIdentityUserId +`func (o *ConnectionData) UnsetTrustIdentityUserId()` + +UnsetTrustIdentityUserId ensures that no value is present for TrustIdentityUserId, not even an explicit nil + +[[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/docs/ConnectionDefaultConnectionProperties.md b/docs/ConnectionDefaultConnectionProperties.md new file mode 100644 index 0000000..083ebde --- /dev/null +++ b/docs/ConnectionDefaultConnectionProperties.md @@ -0,0 +1,66 @@ +# ConnectionDefaultConnectionProperties + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Scope** | Pointer to **NullableString** | Default OAuth scopes to use for every request (leave blank to remove scopes). | [optional] [default to "profile email openid"] + +## Methods + +### NewConnectionDefaultConnectionProperties + +`func NewConnectionDefaultConnectionProperties() *ConnectionDefaultConnectionProperties` + +NewConnectionDefaultConnectionProperties instantiates a new ConnectionDefaultConnectionProperties object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewConnectionDefaultConnectionPropertiesWithDefaults + +`func NewConnectionDefaultConnectionPropertiesWithDefaults() *ConnectionDefaultConnectionProperties` + +NewConnectionDefaultConnectionPropertiesWithDefaults instantiates a new ConnectionDefaultConnectionProperties object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetScope + +`func (o *ConnectionDefaultConnectionProperties) GetScope() string` + +GetScope returns the Scope field if non-nil, zero value otherwise. + +### GetScopeOk + +`func (o *ConnectionDefaultConnectionProperties) GetScopeOk() (*string, bool)` + +GetScopeOk returns a tuple with the Scope field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetScope + +`func (o *ConnectionDefaultConnectionProperties) SetScope(v string)` + +SetScope sets Scope field to given value. + +### HasScope + +`func (o *ConnectionDefaultConnectionProperties) HasScope() bool` + +HasScope returns a boolean if a field has been set. + +### SetScopeNil + +`func (o *ConnectionDefaultConnectionProperties) SetScopeNil(b bool)` + + SetScopeNil sets the value for Scope to be an explicit nil + +### UnsetScope +`func (o *ConnectionDefaultConnectionProperties) UnsetScope()` + +UnsetScope ensures that no value is present for Scope, not even an explicit nil + +[[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/docs/ConnectionUserDataConfiguration.md b/docs/ConnectionUserDataConfiguration.md new file mode 100644 index 0000000..7114990 --- /dev/null +++ b/docs/ConnectionUserDataConfiguration.md @@ -0,0 +1,66 @@ +# ConnectionUserDataConfiguration + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Location** | Pointer to **NullableString** | User data residency - The data residency to store the user specific data in. To ensure high performance and reliability, set to **null**, or to store the user's data only in one specific region, set the region here. Specifying the region reduces reliability, durability, and performance at the benefit of controlling the locality. | [optional] + +## Methods + +### NewConnectionUserDataConfiguration + +`func NewConnectionUserDataConfiguration() *ConnectionUserDataConfiguration` + +NewConnectionUserDataConfiguration instantiates a new ConnectionUserDataConfiguration object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewConnectionUserDataConfigurationWithDefaults + +`func NewConnectionUserDataConfigurationWithDefaults() *ConnectionUserDataConfiguration` + +NewConnectionUserDataConfigurationWithDefaults instantiates a new ConnectionUserDataConfiguration object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetLocation + +`func (o *ConnectionUserDataConfiguration) GetLocation() string` + +GetLocation returns the Location field if non-nil, zero value otherwise. + +### GetLocationOk + +`func (o *ConnectionUserDataConfiguration) GetLocationOk() (*string, bool)` + +GetLocationOk returns a tuple with the Location field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLocation + +`func (o *ConnectionUserDataConfiguration) SetLocation(v string)` + +SetLocation sets Location field to given value. + +### HasLocation + +`func (o *ConnectionUserDataConfiguration) HasLocation() bool` + +HasLocation returns a boolean if a field has been set. + +### SetLocationNil + +`func (o *ConnectionUserDataConfiguration) SetLocationNil(b bool)` + + SetLocationNil sets the value for Location to be an explicit nil + +### UnsetLocation +`func (o *ConnectionUserDataConfiguration) UnsetLocation()` + +UnsetLocation ensures that no value is present for Location, not even an explicit nil + +[[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/docs/ConnectionsAPI.md b/docs/ConnectionsAPI.md new file mode 100644 index 0000000..9e73498 --- /dev/null +++ b/docs/ConnectionsAPI.md @@ -0,0 +1,424 @@ +# \ConnectionsAPI + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateConnection**](ConnectionsAPI.md#CreateConnection) | **Post** /v1/connections | Create SSO connection +[**DeleteConnection**](ConnectionsAPI.md#DeleteConnection) | **Delete** /v1/connections/{connectionId} | Delete SSO connection +[**GetConnection**](ConnectionsAPI.md#GetConnection) | **Get** /v1/connections/{connectionId} | Retrieve SSO connection +[**GetConnectionCredentials**](ConnectionsAPI.md#GetConnectionCredentials) | **Get** /v1/connections/{connectionId}/users/{userId}/credentials | Retrieve user connection credentials +[**GetConnections**](ConnectionsAPI.md#GetConnections) | **Get** /v1/connections | List SSO connections +[**UpdateConnection**](ConnectionsAPI.md#UpdateConnection) | **Put** /v1/connections/{connectionId} | Update SSO connection + + + +## CreateConnection + +> Connection CreateConnection(ctx).Connection(connection).Execute() + +Create SSO connection + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + connection := *openapiclient.NewConnection() // Connection | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ConnectionsAPI.CreateConnection(context.Background()).Connection(connection).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ConnectionsAPI.CreateConnection``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateConnection`: Connection + fmt.Fprintf(os.Stdout, "Response from `ConnectionsAPI.CreateConnection`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateConnectionRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **connection** | [**Connection**](Connection.md) | | + +### Return type + +[**Connection**](Connection.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/links+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) + + +## DeleteConnection + +> DeleteConnection(ctx, connectionId).Execute() + +Delete SSO connection + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + connectionId := "connectionId_example" // string | The connection identifier. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.ConnectionsAPI.DeleteConnection(context.Background(), connectionId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ConnectionsAPI.DeleteConnection``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**connectionId** | **string** | The connection identifier. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteConnectionRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[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) + + +## GetConnection + +> Connection GetConnection(ctx, connectionId).Execute() + +Retrieve SSO connection + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + connectionId := "connectionId_example" // string | The connection identifier. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ConnectionsAPI.GetConnection(context.Background(), connectionId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ConnectionsAPI.GetConnection``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetConnection`: Connection + fmt.Fprintf(os.Stdout, "Response from `ConnectionsAPI.GetConnection`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**connectionId** | **string** | The connection identifier. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetConnectionRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**Connection**](Connection.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/links+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) + + +## GetConnectionCredentials + +> UserConnectionCredentials GetConnectionCredentials(ctx, connectionId, userId).Execute() + +Retrieve user connection credentials + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + connectionId := "connectionId_example" // string | The connection identifier. + userId := TODO // UserId | The connection user. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ConnectionsAPI.GetConnectionCredentials(context.Background(), connectionId, userId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ConnectionsAPI.GetConnectionCredentials``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetConnectionCredentials`: UserConnectionCredentials + fmt.Fprintf(os.Stdout, "Response from `ConnectionsAPI.GetConnectionCredentials`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**connectionId** | **string** | The connection identifier. | +**userId** | [**UserId**](.md) | The connection user. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetConnectionCredentialsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + +[**UserConnectionCredentials**](UserConnectionCredentials.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/links+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) + + +## GetConnections + +> ConnectionCollection GetConnections(ctx).Execute() + +List SSO connections + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ConnectionsAPI.GetConnections(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ConnectionsAPI.GetConnections``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetConnections`: ConnectionCollection + fmt.Fprintf(os.Stdout, "Response from `ConnectionsAPI.GetConnections`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetConnectionsRequest struct via the builder pattern + + +### Return type + +[**ConnectionCollection**](ConnectionCollection.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/links+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) + + +## UpdateConnection + +> Connection UpdateConnection(ctx, connectionId).Connection(connection).Execute() + +Update SSO connection + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + connectionId := "connectionId_example" // string | The connection identifier. + connection := *openapiclient.NewConnection() // Connection | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ConnectionsAPI.UpdateConnection(context.Background(), connectionId).Connection(connection).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ConnectionsAPI.UpdateConnection``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UpdateConnection`: Connection + fmt.Fprintf(os.Stdout, "Response from `ConnectionsAPI.UpdateConnection`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**connectionId** | **string** | The connection identifier. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateConnectionRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **connection** | [**Connection**](Connection.md) | | + +### Return type + +[**Connection**](Connection.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/links+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/docs/Extension.md b/docs/Extension.md new file mode 100644 index 0000000..b2e5f14 --- /dev/null +++ b/docs/Extension.md @@ -0,0 +1,191 @@ +# Extension + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ExtensionId** | **string** | | [readonly] +**Name** | Pointer to **NullableString** | The name of the extension. This name is visible in the Authress management portal | [optional] +**CreatedTime** | **time.Time** | | [readonly] +**Application** | Pointer to [**ExtensionApplication**](ExtensionApplication.md) | | [optional] +**Client** | [**ExtensionClient**](ExtensionClient.md) | | +**Tags** | Pointer to **map[string]string** | The tags associated with this resource, this property is an map. { key1: value1, key2: value2 } | [optional] + +## Methods + +### NewExtension + +`func NewExtension(extensionId string, createdTime time.Time, client ExtensionClient, ) *Extension` + +NewExtension instantiates a new Extension object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewExtensionWithDefaults + +`func NewExtensionWithDefaults() *Extension` + +NewExtensionWithDefaults instantiates a new Extension object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetExtensionId + +`func (o *Extension) GetExtensionId() string` + +GetExtensionId returns the ExtensionId field if non-nil, zero value otherwise. + +### GetExtensionIdOk + +`func (o *Extension) GetExtensionIdOk() (*string, bool)` + +GetExtensionIdOk returns a tuple with the ExtensionId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExtensionId + +`func (o *Extension) SetExtensionId(v string)` + +SetExtensionId sets ExtensionId field to given value. + + +### GetName + +`func (o *Extension) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Extension) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *Extension) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *Extension) HasName() bool` + +HasName returns a boolean if a field has been set. + +### SetNameNil + +`func (o *Extension) SetNameNil(b bool)` + + SetNameNil sets the value for Name to be an explicit nil + +### UnsetName +`func (o *Extension) UnsetName()` + +UnsetName ensures that no value is present for Name, not even an explicit nil +### GetCreatedTime + +`func (o *Extension) GetCreatedTime() time.Time` + +GetCreatedTime returns the CreatedTime field if non-nil, zero value otherwise. + +### GetCreatedTimeOk + +`func (o *Extension) GetCreatedTimeOk() (*time.Time, bool)` + +GetCreatedTimeOk returns a tuple with the CreatedTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedTime + +`func (o *Extension) SetCreatedTime(v time.Time)` + +SetCreatedTime sets CreatedTime field to given value. + + +### GetApplication + +`func (o *Extension) GetApplication() ExtensionApplication` + +GetApplication returns the Application field if non-nil, zero value otherwise. + +### GetApplicationOk + +`func (o *Extension) GetApplicationOk() (*ExtensionApplication, bool)` + +GetApplicationOk returns a tuple with the Application field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetApplication + +`func (o *Extension) SetApplication(v ExtensionApplication)` + +SetApplication sets Application field to given value. + +### HasApplication + +`func (o *Extension) HasApplication() bool` + +HasApplication returns a boolean if a field has been set. + +### GetClient + +`func (o *Extension) GetClient() ExtensionClient` + +GetClient returns the Client field if non-nil, zero value otherwise. + +### GetClientOk + +`func (o *Extension) GetClientOk() (*ExtensionClient, bool)` + +GetClientOk returns a tuple with the Client field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetClient + +`func (o *Extension) SetClient(v ExtensionClient)` + +SetClient sets Client field to given value. + + +### GetTags + +`func (o *Extension) GetTags() map[string]string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *Extension) GetTagsOk() (*map[string]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *Extension) SetTags(v map[string]string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *Extension) HasTags() bool` + +HasTags returns a boolean if a field has been set. + +### SetTagsNil + +`func (o *Extension) SetTagsNil(b bool)` + + SetTagsNil sets the value for Tags to be an explicit nil + +### UnsetTags +`func (o *Extension) UnsetTags()` + +UnsetTags ensures that no value is present for Tags, not even an explicit nil + +[[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/docs/ExtensionApplication.md b/docs/ExtensionApplication.md new file mode 100644 index 0000000..56245c0 --- /dev/null +++ b/docs/ExtensionApplication.md @@ -0,0 +1,113 @@ +# ExtensionApplication + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ApplicationId** | **string** | The unique ID of the application. | [readonly] +**RedirectUrls** | Pointer to **[]string** | | [optional] +**Links** | Pointer to [**Links**](Links.md) | | [optional] + +## Methods + +### NewExtensionApplication + +`func NewExtensionApplication(applicationId string, ) *ExtensionApplication` + +NewExtensionApplication instantiates a new ExtensionApplication object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewExtensionApplicationWithDefaults + +`func NewExtensionApplicationWithDefaults() *ExtensionApplication` + +NewExtensionApplicationWithDefaults instantiates a new ExtensionApplication object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetApplicationId + +`func (o *ExtensionApplication) GetApplicationId() string` + +GetApplicationId returns the ApplicationId field if non-nil, zero value otherwise. + +### GetApplicationIdOk + +`func (o *ExtensionApplication) GetApplicationIdOk() (*string, bool)` + +GetApplicationIdOk returns a tuple with the ApplicationId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetApplicationId + +`func (o *ExtensionApplication) SetApplicationId(v string)` + +SetApplicationId sets ApplicationId field to given value. + + +### GetRedirectUrls + +`func (o *ExtensionApplication) GetRedirectUrls() []string` + +GetRedirectUrls returns the RedirectUrls field if non-nil, zero value otherwise. + +### GetRedirectUrlsOk + +`func (o *ExtensionApplication) GetRedirectUrlsOk() (*[]string, bool)` + +GetRedirectUrlsOk returns a tuple with the RedirectUrls field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRedirectUrls + +`func (o *ExtensionApplication) SetRedirectUrls(v []string)` + +SetRedirectUrls sets RedirectUrls field to given value. + +### HasRedirectUrls + +`func (o *ExtensionApplication) HasRedirectUrls() bool` + +HasRedirectUrls returns a boolean if a field has been set. + +### SetRedirectUrlsNil + +`func (o *ExtensionApplication) SetRedirectUrlsNil(b bool)` + + SetRedirectUrlsNil sets the value for RedirectUrls to be an explicit nil + +### UnsetRedirectUrls +`func (o *ExtensionApplication) UnsetRedirectUrls()` + +UnsetRedirectUrls ensures that no value is present for RedirectUrls, not even an explicit nil +### GetLinks + +`func (o *ExtensionApplication) GetLinks() Links` + +GetLinks returns the Links field if non-nil, zero value otherwise. + +### GetLinksOk + +`func (o *ExtensionApplication) GetLinksOk() (*Links, bool)` + +GetLinksOk returns a tuple with the Links field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLinks + +`func (o *ExtensionApplication) SetLinks(v Links)` + +SetLinks sets Links field to given value. + +### HasLinks + +`func (o *ExtensionApplication) HasLinks() bool` + +HasLinks returns a boolean if a field has been set. + + +[[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/docs/ExtensionClient.md b/docs/ExtensionClient.md new file mode 100644 index 0000000..6a51d5b --- /dev/null +++ b/docs/ExtensionClient.md @@ -0,0 +1,77 @@ +# ExtensionClient + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClientId** | **string** | The unique ID of the client. | [readonly] +**Links** | Pointer to [**Links**](Links.md) | | [optional] + +## Methods + +### NewExtensionClient + +`func NewExtensionClient(clientId string, ) *ExtensionClient` + +NewExtensionClient instantiates a new ExtensionClient object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewExtensionClientWithDefaults + +`func NewExtensionClientWithDefaults() *ExtensionClient` + +NewExtensionClientWithDefaults instantiates a new ExtensionClient object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetClientId + +`func (o *ExtensionClient) GetClientId() string` + +GetClientId returns the ClientId field if non-nil, zero value otherwise. + +### GetClientIdOk + +`func (o *ExtensionClient) GetClientIdOk() (*string, bool)` + +GetClientIdOk returns a tuple with the ClientId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetClientId + +`func (o *ExtensionClient) SetClientId(v string)` + +SetClientId sets ClientId field to given value. + + +### GetLinks + +`func (o *ExtensionClient) GetLinks() Links` + +GetLinks returns the Links field if non-nil, zero value otherwise. + +### GetLinksOk + +`func (o *ExtensionClient) GetLinksOk() (*Links, bool)` + +GetLinksOk returns a tuple with the Links field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLinks + +`func (o *ExtensionClient) SetLinks(v Links)` + +SetLinks sets Links field to given value. + +### HasLinks + +`func (o *ExtensionClient) HasLinks() bool` + +HasLinks returns a boolean if a field has been set. + + +[[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/docs/ExtensionCollection.md b/docs/ExtensionCollection.md new file mode 100644 index 0000000..bcb0fe9 --- /dev/null +++ b/docs/ExtensionCollection.md @@ -0,0 +1,77 @@ +# ExtensionCollection + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Extensions** | [**[]Extension**](Extension.md) | | +**Pagination** | Pointer to [**Pagination**](Pagination.md) | | [optional] + +## Methods + +### NewExtensionCollection + +`func NewExtensionCollection(extensions []Extension, ) *ExtensionCollection` + +NewExtensionCollection instantiates a new ExtensionCollection object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewExtensionCollectionWithDefaults + +`func NewExtensionCollectionWithDefaults() *ExtensionCollection` + +NewExtensionCollectionWithDefaults instantiates a new ExtensionCollection object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetExtensions + +`func (o *ExtensionCollection) GetExtensions() []Extension` + +GetExtensions returns the Extensions field if non-nil, zero value otherwise. + +### GetExtensionsOk + +`func (o *ExtensionCollection) GetExtensionsOk() (*[]Extension, bool)` + +GetExtensionsOk returns a tuple with the Extensions field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExtensions + +`func (o *ExtensionCollection) SetExtensions(v []Extension)` + +SetExtensions sets Extensions field to given value. + + +### GetPagination + +`func (o *ExtensionCollection) GetPagination() Pagination` + +GetPagination returns the Pagination field if non-nil, zero value otherwise. + +### GetPaginationOk + +`func (o *ExtensionCollection) GetPaginationOk() (*Pagination, bool)` + +GetPaginationOk returns a tuple with the Pagination field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPagination + +`func (o *ExtensionCollection) SetPagination(v Pagination)` + +SetPagination sets Pagination field to given value. + +### HasPagination + +`func (o *ExtensionCollection) HasPagination() bool` + +HasPagination returns a boolean if a field has been set. + + +[[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/docs/ExtensionsAPI.md b/docs/ExtensionsAPI.md new file mode 100644 index 0000000..15be03a --- /dev/null +++ b/docs/ExtensionsAPI.md @@ -0,0 +1,499 @@ +# \ExtensionsAPI + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateExtension**](ExtensionsAPI.md#CreateExtension) | **Post** /v1/extensions | Create extension +[**DeleteExtension**](ExtensionsAPI.md#DeleteExtension) | **Delete** /v1/extensions/{extensionId} | Delete extension +[**GetExtension**](ExtensionsAPI.md#GetExtension) | **Get** /v1/extensions/{extensionId} | Retrieve extension +[**GetExtensions**](ExtensionsAPI.md#GetExtensions) | **Get** /v1/extensions | List extensions +[**Login**](ExtensionsAPI.md#Login) | **Get** / | OAuth Authorize +[**RequestToken**](ExtensionsAPI.md#RequestToken) | **Post** /api/authentication/oauth/tokens | OAuth Token +[**UpdateExtension**](ExtensionsAPI.md#UpdateExtension) | **Put** /v1/extensions/{extensionId} | Update extension + + + +## CreateExtension + +> Extension CreateExtension(ctx).Extension(extension).Execute() + +Create extension + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + "time" + openapiclient "//" +) + +func main() { + extension := *openapiclient.NewExtension("ExtensionId_example", time.Now(), *openapiclient.NewExtensionClient("ClientId_example")) // Extension | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ExtensionsAPI.CreateExtension(context.Background()).Extension(extension).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ExtensionsAPI.CreateExtension``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateExtension`: Extension + fmt.Fprintf(os.Stdout, "Response from `ExtensionsAPI.CreateExtension`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateExtensionRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **extension** | [**Extension**](Extension.md) | | + +### Return type + +[**Extension**](Extension.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/links+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) + + +## DeleteExtension + +> DeleteExtension(ctx, extensionId).Execute() + +Delete extension + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + extensionId := "extensionId_example" // string | The extension identifier. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.ExtensionsAPI.DeleteExtension(context.Background(), extensionId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ExtensionsAPI.DeleteExtension``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**extensionId** | **string** | The extension identifier. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteExtensionRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[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) + + +## GetExtension + +> Extension GetExtension(ctx, extensionId).Execute() + +Retrieve extension + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + extensionId := "extensionId_example" // string | The extension identifier. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ExtensionsAPI.GetExtension(context.Background(), extensionId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ExtensionsAPI.GetExtension``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetExtension`: Extension + fmt.Fprintf(os.Stdout, "Response from `ExtensionsAPI.GetExtension`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**extensionId** | **string** | The extension identifier. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetExtensionRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**Extension**](Extension.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/links+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) + + +## GetExtensions + +> ExtensionCollection GetExtensions(ctx).Limit(limit).Cursor(cursor).Execute() + +List extensions + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + limit := int32(56) // int32 | Max number of results to return (optional) (default to 20) + cursor := "cursor_example" // string | Continuation cursor for paging (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ExtensionsAPI.GetExtensions(context.Background()).Limit(limit).Cursor(cursor).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ExtensionsAPI.GetExtensions``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetExtensions`: ExtensionCollection + fmt.Fprintf(os.Stdout, "Response from `ExtensionsAPI.GetExtensions`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetExtensionsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int32** | Max number of results to return | [default to 20] + **cursor** | **string** | Continuation cursor for paging | + +### Return type + +[**ExtensionCollection**](ExtensionCollection.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/links+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) + + +## Login + +> OAuthAuthorizeResponse Login(ctx).ClientId(clientId).CodeChallenge(codeChallenge).RedirectUri(redirectUri).CodeChallengeMethod(codeChallengeMethod).Execute() + +OAuth Authorize + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + clientId := "ext_00AA" // string | The client identifier to constrain the token to. + codeChallenge := "6fdkQaPm51l13DSukcAH3Mdx7_ntecHYd1vi3n0hMZY" // string | The PKCE Code challenge generated by the extension UI to secure the code exchange from [RFC 7636](https://datatracker.ietf.org/doc/html/rfc7636). + redirectUri := "https://extension.application.com/login-redirect" // string | The location to redirect the user back to after login. This redirect_uri must be a URL that matches one of the preconfigured urls in the Authress Application. + codeChallengeMethod := "codeChallengeMethod_example" // string | The method used to generate the code_challenge from the code_verifier. `code_challenge_method(code_verifier) = code_challenge` (optional) (default to "S256") + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ExtensionsAPI.Login(context.Background()).ClientId(clientId).CodeChallenge(codeChallenge).RedirectUri(redirectUri).CodeChallengeMethod(codeChallengeMethod).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ExtensionsAPI.Login``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `Login`: OAuthAuthorizeResponse + fmt.Fprintf(os.Stdout, "Response from `ExtensionsAPI.Login`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiLoginRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **clientId** | **string** | The client identifier to constrain the token to. | + **codeChallenge** | **string** | The PKCE Code challenge generated by the extension UI to secure the code exchange from [RFC 7636](https://datatracker.ietf.org/doc/html/rfc7636). | + **redirectUri** | **string** | The location to redirect the user back to after login. This redirect_uri must be a URL that matches one of the preconfigured urls in the Authress Application. | + **codeChallengeMethod** | **string** | The method used to generate the code_challenge from the code_verifier. `code_challenge_method(code_verifier) = code_challenge` | [default to "S256"] + +### Return type + +[**OAuthAuthorizeResponse**](OAuthAuthorizeResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/links+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) + + +## RequestToken + +> OAuthTokenResponse RequestToken(ctx).OAuthTokenRequest(oAuthTokenRequest).Execute() + +OAuth Token + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + oAuthTokenRequest := *openapiclient.NewOAuthTokenRequest("ClientId_example") // OAuthTokenRequest | The contents of an OAuth token request. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ExtensionsAPI.RequestToken(context.Background()).OAuthTokenRequest(oAuthTokenRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ExtensionsAPI.RequestToken``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `RequestToken`: OAuthTokenResponse + fmt.Fprintf(os.Stdout, "Response from `ExtensionsAPI.RequestToken`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiRequestTokenRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **oAuthTokenRequest** | [**OAuthTokenRequest**](OAuthTokenRequest.md) | The contents of an OAuth token request. | + +### Return type + +[**OAuthTokenResponse**](OAuthTokenResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/links+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) + + +## UpdateExtension + +> Extension UpdateExtension(ctx, extensionId).Extension(extension).Execute() + +Update extension + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + "time" + openapiclient "//" +) + +func main() { + extensionId := "extensionId_example" // string | The extension identifier. + extension := *openapiclient.NewExtension("ExtensionId_example", time.Now(), *openapiclient.NewExtensionClient("ClientId_example")) // Extension | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ExtensionsAPI.UpdateExtension(context.Background(), extensionId).Extension(extension).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ExtensionsAPI.UpdateExtension``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UpdateExtension`: Extension + fmt.Fprintf(os.Stdout, "Response from `ExtensionsAPI.UpdateExtension`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**extensionId** | **string** | The extension identifier. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateExtensionRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **extension** | [**Extension**](Extension.md) | | + +### Return type + +[**Extension**](Extension.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/links+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/docs/Group.md b/docs/Group.md new file mode 100644 index 0000000..6f35fe3 --- /dev/null +++ b/docs/Group.md @@ -0,0 +1,207 @@ +# Group + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**GroupId** | Pointer to **string** | Unique identifier for the groupId, can be specified on record creation. Must begin with grp_. | [optional] +**Name** | **string** | A helpful name for this record | +**LastUpdated** | Pointer to **time.Time** | The expected last time the group was updated | [optional] [readonly] +**Users** | [**[]User**](User.md) | The list of users in this group | +**Admins** | [**[]User**](User.md) | The list of admins that can edit this record even if they do not have global record edit permissions. | +**Links** | Pointer to [**AccountLinks**](AccountLinks.md) | | [optional] +**Tags** | Pointer to **map[string]string** | The tags associated with this resource, this property is an map. { key1: value1, key2: value2 } | [optional] + +## Methods + +### NewGroup + +`func NewGroup(name string, users []User, admins []User, ) *Group` + +NewGroup instantiates a new Group object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewGroupWithDefaults + +`func NewGroupWithDefaults() *Group` + +NewGroupWithDefaults instantiates a new Group object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetGroupId + +`func (o *Group) GetGroupId() string` + +GetGroupId returns the GroupId field if non-nil, zero value otherwise. + +### GetGroupIdOk + +`func (o *Group) GetGroupIdOk() (*string, bool)` + +GetGroupIdOk returns a tuple with the GroupId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGroupId + +`func (o *Group) SetGroupId(v string)` + +SetGroupId sets GroupId field to given value. + +### HasGroupId + +`func (o *Group) HasGroupId() bool` + +HasGroupId returns a boolean if a field has been set. + +### GetName + +`func (o *Group) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Group) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *Group) SetName(v string)` + +SetName sets Name field to given value. + + +### GetLastUpdated + +`func (o *Group) GetLastUpdated() time.Time` + +GetLastUpdated returns the LastUpdated field if non-nil, zero value otherwise. + +### GetLastUpdatedOk + +`func (o *Group) GetLastUpdatedOk() (*time.Time, bool)` + +GetLastUpdatedOk returns a tuple with the LastUpdated field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastUpdated + +`func (o *Group) SetLastUpdated(v time.Time)` + +SetLastUpdated sets LastUpdated field to given value. + +### HasLastUpdated + +`func (o *Group) HasLastUpdated() bool` + +HasLastUpdated returns a boolean if a field has been set. + +### GetUsers + +`func (o *Group) GetUsers() []User` + +GetUsers returns the Users field if non-nil, zero value otherwise. + +### GetUsersOk + +`func (o *Group) GetUsersOk() (*[]User, bool)` + +GetUsersOk returns a tuple with the Users field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsers + +`func (o *Group) SetUsers(v []User)` + +SetUsers sets Users field to given value. + + +### GetAdmins + +`func (o *Group) GetAdmins() []User` + +GetAdmins returns the Admins field if non-nil, zero value otherwise. + +### GetAdminsOk + +`func (o *Group) GetAdminsOk() (*[]User, bool)` + +GetAdminsOk returns a tuple with the Admins field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAdmins + +`func (o *Group) SetAdmins(v []User)` + +SetAdmins sets Admins field to given value. + + +### GetLinks + +`func (o *Group) GetLinks() AccountLinks` + +GetLinks returns the Links field if non-nil, zero value otherwise. + +### GetLinksOk + +`func (o *Group) GetLinksOk() (*AccountLinks, bool)` + +GetLinksOk returns a tuple with the Links field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLinks + +`func (o *Group) SetLinks(v AccountLinks)` + +SetLinks sets Links field to given value. + +### HasLinks + +`func (o *Group) HasLinks() bool` + +HasLinks returns a boolean if a field has been set. + +### GetTags + +`func (o *Group) GetTags() map[string]string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *Group) GetTagsOk() (*map[string]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *Group) SetTags(v map[string]string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *Group) HasTags() bool` + +HasTags returns a boolean if a field has been set. + +### SetTagsNil + +`func (o *Group) SetTagsNil(b bool)` + + SetTagsNil sets the value for Tags to be an explicit nil + +### UnsetTags +`func (o *Group) UnsetTags()` + +UnsetTags ensures that no value is present for Tags, not even an explicit nil + +[[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/docs/GroupCollection.md b/docs/GroupCollection.md new file mode 100644 index 0000000..e4e5c88 --- /dev/null +++ b/docs/GroupCollection.md @@ -0,0 +1,98 @@ +# GroupCollection + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Groups** | [**[]Group**](Group.md) | A list of groups | +**Pagination** | Pointer to [**Pagination**](Pagination.md) | | [optional] +**Links** | [**CollectionLinks**](CollectionLinks.md) | | + +## Methods + +### NewGroupCollection + +`func NewGroupCollection(groups []Group, links CollectionLinks, ) *GroupCollection` + +NewGroupCollection instantiates a new GroupCollection object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewGroupCollectionWithDefaults + +`func NewGroupCollectionWithDefaults() *GroupCollection` + +NewGroupCollectionWithDefaults instantiates a new GroupCollection object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetGroups + +`func (o *GroupCollection) GetGroups() []Group` + +GetGroups returns the Groups field if non-nil, zero value otherwise. + +### GetGroupsOk + +`func (o *GroupCollection) GetGroupsOk() (*[]Group, bool)` + +GetGroupsOk returns a tuple with the Groups field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGroups + +`func (o *GroupCollection) SetGroups(v []Group)` + +SetGroups sets Groups field to given value. + + +### GetPagination + +`func (o *GroupCollection) GetPagination() Pagination` + +GetPagination returns the Pagination field if non-nil, zero value otherwise. + +### GetPaginationOk + +`func (o *GroupCollection) GetPaginationOk() (*Pagination, bool)` + +GetPaginationOk returns a tuple with the Pagination field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPagination + +`func (o *GroupCollection) SetPagination(v Pagination)` + +SetPagination sets Pagination field to given value. + +### HasPagination + +`func (o *GroupCollection) HasPagination() bool` + +HasPagination returns a boolean if a field has been set. + +### GetLinks + +`func (o *GroupCollection) GetLinks() CollectionLinks` + +GetLinks returns the Links field if non-nil, zero value otherwise. + +### GetLinksOk + +`func (o *GroupCollection) GetLinksOk() (*CollectionLinks, bool)` + +GetLinksOk returns a tuple with the Links field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLinks + +`func (o *GroupCollection) SetLinks(v CollectionLinks)` + +SetLinks sets Links field to given value. + + + +[[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/docs/GroupsAPI.md b/docs/GroupsAPI.md new file mode 100644 index 0000000..209bee5 --- /dev/null +++ b/docs/GroupsAPI.md @@ -0,0 +1,362 @@ +# \GroupsAPI + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateGroup**](GroupsAPI.md#CreateGroup) | **Post** /v1/groups | Create group +[**DeleteGroup**](GroupsAPI.md#DeleteGroup) | **Delete** /v1/groups/{groupId} | Deletes group +[**GetGroup**](GroupsAPI.md#GetGroup) | **Get** /v1/groups/{groupId} | Retrieve group +[**GetGroups**](GroupsAPI.md#GetGroups) | **Get** /v1/groups | List groups +[**UpdateGroup**](GroupsAPI.md#UpdateGroup) | **Put** /v1/groups/{groupId} | Update a group + + + +## CreateGroup + +> Group CreateGroup(ctx).Group(group).Execute() + +Create group + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + group := *openapiclient.NewGroup("Name_example", []openapiclient.User{*openapiclient.NewUser("oauth|userId")}, []openapiclient.User{*openapiclient.NewUser("oauth|userId")}) // Group | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.GroupsAPI.CreateGroup(context.Background()).Group(group).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `GroupsAPI.CreateGroup``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateGroup`: Group + fmt.Fprintf(os.Stdout, "Response from `GroupsAPI.CreateGroup`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateGroupRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **group** | [**Group**](Group.md) | | + +### Return type + +[**Group**](Group.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/links+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(ctx, groupId).Execute() + +Deletes group + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + groupId := TODO // GroupId | The identifier of the group. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.GroupsAPI.DeleteGroup(context.Background(), groupId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `GroupsAPI.DeleteGroup``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**groupId** | [**GroupId**](.md) | The identifier of the group. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteGroupRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[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 + +> Group GetGroup(ctx, groupId).Execute() + +Retrieve group + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + groupId := TODO // GroupId | The identifier of the group. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.GroupsAPI.GetGroup(context.Background(), groupId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `GroupsAPI.GetGroup``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetGroup`: Group + fmt.Fprintf(os.Stdout, "Response from `GroupsAPI.GetGroup`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**groupId** | [**GroupId**](.md) | The identifier of the group. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetGroupRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**Group**](Group.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/links+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) + + +## GetGroups + +> GroupCollection GetGroups(ctx).Limit(limit).Cursor(cursor).Filter(filter).Execute() + +List groups + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + limit := int32(56) // int32 | Max number of results to return (optional) (default to 20) + cursor := "cursor_example" // string | Continuation cursor for paging (optional) + filter := "filter_example" // string | Filter to search groups by. This is a case insensitive search through every text field. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.GroupsAPI.GetGroups(context.Background()).Limit(limit).Cursor(cursor).Filter(filter).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `GroupsAPI.GetGroups``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetGroups`: GroupCollection + fmt.Fprintf(os.Stdout, "Response from `GroupsAPI.GetGroups`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetGroupsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int32** | Max number of results to return | [default to 20] + **cursor** | **string** | Continuation cursor for paging | + **filter** | **string** | Filter to search groups by. This is a case insensitive search through every text field. | + +### Return type + +[**GroupCollection**](GroupCollection.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/links+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) + + +## UpdateGroup + +> Group UpdateGroup(ctx, groupId).Group(group).IfUnmodifiedSince(ifUnmodifiedSince).Execute() + +Update a group + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + "time" + openapiclient "//" +) + +func main() { + groupId := TODO // GroupId | The identifier of the group. + group := *openapiclient.NewGroup("Name_example", []openapiclient.User{*openapiclient.NewUser("oauth|userId")}, []openapiclient.User{*openapiclient.NewUser("oauth|userId")}) // Group | + ifUnmodifiedSince := time.Now() // time.Time | The expected last time the group was modified. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.GroupsAPI.UpdateGroup(context.Background(), groupId).Group(group).IfUnmodifiedSince(ifUnmodifiedSince).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `GroupsAPI.UpdateGroup``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UpdateGroup`: Group + fmt.Fprintf(os.Stdout, "Response from `GroupsAPI.UpdateGroup`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**groupId** | [**GroupId**](.md) | The identifier of the group. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateGroupRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **group** | [**Group**](Group.md) | | + **ifUnmodifiedSince** | **time.Time** | The expected last time the group was modified. | + +### Return type + +[**Group**](Group.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/links+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/docs/Identity.md b/docs/Identity.md new file mode 100644 index 0000000..e23e0b6 --- /dev/null +++ b/docs/Identity.md @@ -0,0 +1,108 @@ +# Identity + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Issuer** | **string** | The issuer of the JWT token. This can be any OIDC compliant provider. | +**Audience** | **string** | The audience of the JWT token. This can be either an audience for your entire app, or one particular audience for it. If there is more than one audience, multiple identities can be created. | +**UserIdExpression** | Pointer to **NullableString** | By default, the **sub** claim of the JWT is used to identify the user from this provider. To use an alternate claim or a compound userId resolution, specify an expression. The resolved userId must be the same one that is later used in Authress access records. | [optional] [default to "{sub}"] + +## Methods + +### NewIdentity + +`func NewIdentity(issuer string, audience string, ) *Identity` + +NewIdentity instantiates a new Identity object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewIdentityWithDefaults + +`func NewIdentityWithDefaults() *Identity` + +NewIdentityWithDefaults instantiates a new Identity object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetIssuer + +`func (o *Identity) GetIssuer() string` + +GetIssuer returns the Issuer field if non-nil, zero value otherwise. + +### GetIssuerOk + +`func (o *Identity) GetIssuerOk() (*string, bool)` + +GetIssuerOk returns a tuple with the Issuer field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIssuer + +`func (o *Identity) SetIssuer(v string)` + +SetIssuer sets Issuer field to given value. + + +### GetAudience + +`func (o *Identity) GetAudience() string` + +GetAudience returns the Audience field if non-nil, zero value otherwise. + +### GetAudienceOk + +`func (o *Identity) GetAudienceOk() (*string, bool)` + +GetAudienceOk returns a tuple with the Audience field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAudience + +`func (o *Identity) SetAudience(v string)` + +SetAudience sets Audience field to given value. + + +### GetUserIdExpression + +`func (o *Identity) GetUserIdExpression() string` + +GetUserIdExpression returns the UserIdExpression field if non-nil, zero value otherwise. + +### GetUserIdExpressionOk + +`func (o *Identity) GetUserIdExpressionOk() (*string, bool)` + +GetUserIdExpressionOk returns a tuple with the UserIdExpression field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserIdExpression + +`func (o *Identity) SetUserIdExpression(v string)` + +SetUserIdExpression sets UserIdExpression field to given value. + +### HasUserIdExpression + +`func (o *Identity) HasUserIdExpression() bool` + +HasUserIdExpression returns a boolean if a field has been set. + +### SetUserIdExpressionNil + +`func (o *Identity) SetUserIdExpressionNil(b bool)` + + SetUserIdExpressionNil sets the value for UserIdExpression to be an explicit nil + +### UnsetUserIdExpression +`func (o *Identity) UnsetUserIdExpression()` + +UnsetUserIdExpression ensures that no value is present for UserIdExpression, not even an explicit nil + +[[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/docs/IdentityCollection.md b/docs/IdentityCollection.md new file mode 100644 index 0000000..bd941b8 --- /dev/null +++ b/docs/IdentityCollection.md @@ -0,0 +1,51 @@ +# IdentityCollection + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Identities** | [**[]Identity**](Identity.md) | | + +## Methods + +### NewIdentityCollection + +`func NewIdentityCollection(identities []Identity, ) *IdentityCollection` + +NewIdentityCollection instantiates a new IdentityCollection object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewIdentityCollectionWithDefaults + +`func NewIdentityCollectionWithDefaults() *IdentityCollection` + +NewIdentityCollectionWithDefaults instantiates a new IdentityCollection object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetIdentities + +`func (o *IdentityCollection) GetIdentities() []Identity` + +GetIdentities returns the Identities field if non-nil, zero value otherwise. + +### GetIdentitiesOk + +`func (o *IdentityCollection) GetIdentitiesOk() (*[]Identity, bool)` + +GetIdentitiesOk returns a tuple with the Identities field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIdentities + +`func (o *IdentityCollection) SetIdentities(v []Identity)` + +SetIdentities sets Identities field to given value. + + + +[[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/docs/IdentityRequest.md b/docs/IdentityRequest.md new file mode 100644 index 0000000..e9961c4 --- /dev/null +++ b/docs/IdentityRequest.md @@ -0,0 +1,174 @@ +# IdentityRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Jwt** | Pointer to **NullableString** | A valid JWT OIDC compliant token which will still pass authentication requests to the identity provider. Must contain a unique audience and issuer. | [optional] +**Issuer** | Pointer to **NullableString** | The issuer of the OAuth OIDC provider's JWTs. This value should match the `iss` claim in the provided tokens exactly. | [optional] +**PreferredAudience** | Pointer to **NullableString** | If the `jwt` token contains more than one valid audience, then the single audience that should associated with Authress. If more than one audience is preferred, repeat this call with each one. | [optional] [default to "*"] +**UserIdExpression** | Pointer to **NullableString** | By default, the **sub** claim of the JWT is used to identify the user from this provider. To use an alternate claim or a compound userId resolution, specify an expression. The resolved userId must be the same one that is later used in Authress access records. | [optional] [default to "{sub}"] + +## Methods + +### NewIdentityRequest + +`func NewIdentityRequest() *IdentityRequest` + +NewIdentityRequest instantiates a new IdentityRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewIdentityRequestWithDefaults + +`func NewIdentityRequestWithDefaults() *IdentityRequest` + +NewIdentityRequestWithDefaults instantiates a new IdentityRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetJwt + +`func (o *IdentityRequest) GetJwt() string` + +GetJwt returns the Jwt field if non-nil, zero value otherwise. + +### GetJwtOk + +`func (o *IdentityRequest) GetJwtOk() (*string, bool)` + +GetJwtOk returns a tuple with the Jwt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetJwt + +`func (o *IdentityRequest) SetJwt(v string)` + +SetJwt sets Jwt field to given value. + +### HasJwt + +`func (o *IdentityRequest) HasJwt() bool` + +HasJwt returns a boolean if a field has been set. + +### SetJwtNil + +`func (o *IdentityRequest) SetJwtNil(b bool)` + + SetJwtNil sets the value for Jwt to be an explicit nil + +### UnsetJwt +`func (o *IdentityRequest) UnsetJwt()` + +UnsetJwt ensures that no value is present for Jwt, not even an explicit nil +### GetIssuer + +`func (o *IdentityRequest) GetIssuer() string` + +GetIssuer returns the Issuer field if non-nil, zero value otherwise. + +### GetIssuerOk + +`func (o *IdentityRequest) GetIssuerOk() (*string, bool)` + +GetIssuerOk returns a tuple with the Issuer field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIssuer + +`func (o *IdentityRequest) SetIssuer(v string)` + +SetIssuer sets Issuer field to given value. + +### HasIssuer + +`func (o *IdentityRequest) HasIssuer() bool` + +HasIssuer returns a boolean if a field has been set. + +### SetIssuerNil + +`func (o *IdentityRequest) SetIssuerNil(b bool)` + + SetIssuerNil sets the value for Issuer to be an explicit nil + +### UnsetIssuer +`func (o *IdentityRequest) UnsetIssuer()` + +UnsetIssuer ensures that no value is present for Issuer, not even an explicit nil +### GetPreferredAudience + +`func (o *IdentityRequest) GetPreferredAudience() string` + +GetPreferredAudience returns the PreferredAudience field if non-nil, zero value otherwise. + +### GetPreferredAudienceOk + +`func (o *IdentityRequest) GetPreferredAudienceOk() (*string, bool)` + +GetPreferredAudienceOk returns a tuple with the PreferredAudience field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPreferredAudience + +`func (o *IdentityRequest) SetPreferredAudience(v string)` + +SetPreferredAudience sets PreferredAudience field to given value. + +### HasPreferredAudience + +`func (o *IdentityRequest) HasPreferredAudience() bool` + +HasPreferredAudience returns a boolean if a field has been set. + +### SetPreferredAudienceNil + +`func (o *IdentityRequest) SetPreferredAudienceNil(b bool)` + + SetPreferredAudienceNil sets the value for PreferredAudience to be an explicit nil + +### UnsetPreferredAudience +`func (o *IdentityRequest) UnsetPreferredAudience()` + +UnsetPreferredAudience ensures that no value is present for PreferredAudience, not even an explicit nil +### GetUserIdExpression + +`func (o *IdentityRequest) GetUserIdExpression() string` + +GetUserIdExpression returns the UserIdExpression field if non-nil, zero value otherwise. + +### GetUserIdExpressionOk + +`func (o *IdentityRequest) GetUserIdExpressionOk() (*string, bool)` + +GetUserIdExpressionOk returns a tuple with the UserIdExpression field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserIdExpression + +`func (o *IdentityRequest) SetUserIdExpression(v string)` + +SetUserIdExpression sets UserIdExpression field to given value. + +### HasUserIdExpression + +`func (o *IdentityRequest) HasUserIdExpression() bool` + +HasUserIdExpression returns a boolean if a field has been set. + +### SetUserIdExpressionNil + +`func (o *IdentityRequest) SetUserIdExpressionNil(b bool)` + + SetUserIdExpressionNil sets the value for UserIdExpression to be an explicit nil + +### UnsetUserIdExpression +`func (o *IdentityRequest) UnsetUserIdExpression()` + +UnsetUserIdExpression ensures that no value is present for UserIdExpression, not even an explicit nil + +[[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/docs/Invite.md b/docs/Invite.md new file mode 100644 index 0000000..97ed04d --- /dev/null +++ b/docs/Invite.md @@ -0,0 +1,124 @@ +# Invite + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**InviteId** | **string** | The unique identifier for the invite. Use this ID to accept the invite. This parameter is ignored during invite creation. | [readonly] +**TenantId** | Pointer to [**TenantId**](TenantId.md) | | [optional] +**Statements** | [**[]Statement**](Statement.md) | A list of statements which match roles to resources. The invited user will all statements apply to them when the invite is accepted. | +**Links** | Pointer to [**AccountLinks**](AccountLinks.md) | | [optional] + +## Methods + +### NewInvite + +`func NewInvite(inviteId string, statements []Statement, ) *Invite` + +NewInvite instantiates a new Invite object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInviteWithDefaults + +`func NewInviteWithDefaults() *Invite` + +NewInviteWithDefaults instantiates a new Invite object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetInviteId + +`func (o *Invite) GetInviteId() string` + +GetInviteId returns the InviteId field if non-nil, zero value otherwise. + +### GetInviteIdOk + +`func (o *Invite) GetInviteIdOk() (*string, bool)` + +GetInviteIdOk returns a tuple with the InviteId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInviteId + +`func (o *Invite) SetInviteId(v string)` + +SetInviteId sets InviteId field to given value. + + +### GetTenantId + +`func (o *Invite) GetTenantId() TenantId` + +GetTenantId returns the TenantId field if non-nil, zero value otherwise. + +### GetTenantIdOk + +`func (o *Invite) GetTenantIdOk() (*TenantId, bool)` + +GetTenantIdOk returns a tuple with the TenantId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTenantId + +`func (o *Invite) SetTenantId(v TenantId)` + +SetTenantId sets TenantId field to given value. + +### HasTenantId + +`func (o *Invite) HasTenantId() bool` + +HasTenantId returns a boolean if a field has been set. + +### GetStatements + +`func (o *Invite) GetStatements() []Statement` + +GetStatements returns the Statements field if non-nil, zero value otherwise. + +### GetStatementsOk + +`func (o *Invite) GetStatementsOk() (*[]Statement, bool)` + +GetStatementsOk returns a tuple with the Statements field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatements + +`func (o *Invite) SetStatements(v []Statement)` + +SetStatements sets Statements field to given value. + + +### GetLinks + +`func (o *Invite) GetLinks() AccountLinks` + +GetLinks returns the Links field if non-nil, zero value otherwise. + +### GetLinksOk + +`func (o *Invite) GetLinksOk() (*AccountLinks, bool)` + +GetLinksOk returns a tuple with the Links field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLinks + +`func (o *Invite) SetLinks(v AccountLinks)` + +SetLinks sets Links field to given value. + +### HasLinks + +`func (o *Invite) HasLinks() bool` + +HasLinks returns a boolean if a field has been set. + + +[[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/docs/InvitesAPI.md b/docs/InvitesAPI.md new file mode 100644 index 0000000..c41fde4 --- /dev/null +++ b/docs/InvitesAPI.md @@ -0,0 +1,286 @@ +# \InvitesAPI + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateInvite**](InvitesAPI.md#CreateInvite) | **Post** /v1/invites | Create user invite +[**DeleteInvite**](InvitesAPI.md#DeleteInvite) | **Delete** /v1/invites/{inviteId} | Delete invite +[**GetInvite**](InvitesAPI.md#GetInvite) | **Get** /v1/invites/{inviteId} | Retrieve invite +[**RespondToInvite**](InvitesAPI.md#RespondToInvite) | **Patch** /v1/invites/{inviteId} | Accept invite + + + +## CreateInvite + +> Invite CreateInvite(ctx).Invite(invite).Execute() + +Create user invite + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + invite := *openapiclient.NewInvite("InviteId_example", []openapiclient.Statement{*openapiclient.NewStatement([]string{"Roles_example"}, []openapiclient.Resource{*openapiclient.NewResource("/organizations/org_a/documents/doc_1")})}) // Invite | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.InvitesAPI.CreateInvite(context.Background()).Invite(invite).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `InvitesAPI.CreateInvite``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateInvite`: Invite + fmt.Fprintf(os.Stdout, "Response from `InvitesAPI.CreateInvite`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateInviteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **invite** | [**Invite**](Invite.md) | | + +### Return type + +[**Invite**](Invite.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/links+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) + + +## DeleteInvite + +> DeleteInvite(ctx, inviteId).Execute() + +Delete invite + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + inviteId := "inviteId_example" // string | The identifier of the invite. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.InvitesAPI.DeleteInvite(context.Background(), inviteId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `InvitesAPI.DeleteInvite``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**inviteId** | **string** | The identifier of the invite. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteInviteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[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) + + +## GetInvite + +> Invite GetInvite(ctx, inviteId).Execute() + +Retrieve invite + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + inviteId := "inviteId_example" // string | The identifier of the invite. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.InvitesAPI.GetInvite(context.Background(), inviteId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `InvitesAPI.GetInvite``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetInvite`: Invite + fmt.Fprintf(os.Stdout, "Response from `InvitesAPI.GetInvite`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**inviteId** | **string** | The identifier of the invite. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetInviteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**Invite**](Invite.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/links+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) + + +## RespondToInvite + +> Account RespondToInvite(ctx, inviteId).Execute() + +Accept invite + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + inviteId := "inviteId_example" // string | The identifier of the invite. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.InvitesAPI.RespondToInvite(context.Background(), inviteId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `InvitesAPI.RespondToInvite``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `RespondToInvite`: Account + fmt.Fprintf(os.Stdout, "Response from `InvitesAPI.RespondToInvite`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**inviteId** | **string** | The identifier of the invite. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiRespondToInviteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**Account**](Account.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/links+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/docs/Link.md b/docs/Link.md new file mode 100644 index 0000000..3a8a779 --- /dev/null +++ b/docs/Link.md @@ -0,0 +1,77 @@ +# Link + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Href** | **string** | The absolute url pointing to the reference resource. | +**Rel** | Pointer to **string** | Optional property indicating the type of link if it is not a default IANA approved global link relation. | [optional] + +## Methods + +### NewLink + +`func NewLink(href string, ) *Link` + +NewLink instantiates a new Link object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewLinkWithDefaults + +`func NewLinkWithDefaults() *Link` + +NewLinkWithDefaults instantiates a new Link object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetHref + +`func (o *Link) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *Link) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *Link) SetHref(v string)` + +SetHref sets Href field to given value. + + +### GetRel + +`func (o *Link) GetRel() string` + +GetRel returns the Rel field if non-nil, zero value otherwise. + +### GetRelOk + +`func (o *Link) GetRelOk() (*string, bool)` + +GetRelOk returns a tuple with the Rel field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRel + +`func (o *Link) SetRel(v string)` + +SetRel sets Rel field to given value. + +### HasRel + +`func (o *Link) HasRel() bool` + +HasRel returns a boolean if a field has been set. + + +[[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/docs/LinkedGroup.md b/docs/LinkedGroup.md new file mode 100644 index 0000000..619c95c --- /dev/null +++ b/docs/LinkedGroup.md @@ -0,0 +1,51 @@ +# LinkedGroup + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**GroupId** | [**GroupId**](GroupId.md) | | + +## Methods + +### NewLinkedGroup + +`func NewLinkedGroup(groupId GroupId, ) *LinkedGroup` + +NewLinkedGroup instantiates a new LinkedGroup object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewLinkedGroupWithDefaults + +`func NewLinkedGroupWithDefaults() *LinkedGroup` + +NewLinkedGroupWithDefaults instantiates a new LinkedGroup object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetGroupId + +`func (o *LinkedGroup) GetGroupId() GroupId` + +GetGroupId returns the GroupId field if non-nil, zero value otherwise. + +### GetGroupIdOk + +`func (o *LinkedGroup) GetGroupIdOk() (*GroupId, bool)` + +GetGroupIdOk returns a tuple with the GroupId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGroupId + +`func (o *LinkedGroup) SetGroupId(v GroupId)` + +SetGroupId sets GroupId field to given value. + + + +[[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/docs/Links.md b/docs/Links.md new file mode 100644 index 0000000..e9fc16c --- /dev/null +++ b/docs/Links.md @@ -0,0 +1,61 @@ +# Links + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Self** | [**NullableLink**](Link.md) | | + +## Methods + +### NewLinks + +`func NewLinks(self NullableLink, ) *Links` + +NewLinks instantiates a new Links object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewLinksWithDefaults + +`func NewLinksWithDefaults() *Links` + +NewLinksWithDefaults instantiates a new Links object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetSelf + +`func (o *Links) GetSelf() Link` + +GetSelf returns the Self field if non-nil, zero value otherwise. + +### GetSelfOk + +`func (o *Links) GetSelfOk() (*Link, bool)` + +GetSelfOk returns a tuple with the Self field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSelf + +`func (o *Links) SetSelf(v Link)` + +SetSelf sets Self field to given value. + + +### SetSelfNil + +`func (o *Links) SetSelfNil(b bool)` + + SetSelfNil sets the value for Self to be an explicit nil + +### UnsetSelf +`func (o *Links) UnsetSelf()` + +UnsetSelf ensures that no value is present for Self, not even an explicit nil + +[[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/docs/OAuthAuthorizeResponse.md b/docs/OAuthAuthorizeResponse.md new file mode 100644 index 0000000..fa74f18 --- /dev/null +++ b/docs/OAuthAuthorizeResponse.md @@ -0,0 +1,51 @@ +# OAuthAuthorizeResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Code** | **string** | The authorization code to be used with the /tokens endpoint to retrieve an access_token. | + +## Methods + +### NewOAuthAuthorizeResponse + +`func NewOAuthAuthorizeResponse(code string, ) *OAuthAuthorizeResponse` + +NewOAuthAuthorizeResponse instantiates a new OAuthAuthorizeResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewOAuthAuthorizeResponseWithDefaults + +`func NewOAuthAuthorizeResponseWithDefaults() *OAuthAuthorizeResponse` + +NewOAuthAuthorizeResponseWithDefaults instantiates a new OAuthAuthorizeResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCode + +`func (o *OAuthAuthorizeResponse) GetCode() string` + +GetCode returns the Code field if non-nil, zero value otherwise. + +### GetCodeOk + +`func (o *OAuthAuthorizeResponse) GetCodeOk() (*string, bool)` + +GetCodeOk returns a tuple with the Code field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCode + +`func (o *OAuthAuthorizeResponse) SetCode(v string)` + +SetCode sets Code field to given value. + + + +[[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/docs/OAuthTokenRequest.md b/docs/OAuthTokenRequest.md new file mode 100644 index 0000000..5065d92 --- /dev/null +++ b/docs/OAuthTokenRequest.md @@ -0,0 +1,247 @@ +# OAuthTokenRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClientId** | **string** | The client identifier to constrain the token to. | +**ClientSecret** | Pointer to **NullableString** | The secret associated with the client that authorizes the generation of token it's behalf. (Either the `client_secret` or the `code_verifier` is required) | [optional] +**CodeVerifier** | Pointer to **string** | The code verifier is the the value used in the generation of the OAuth authorization request `code_challenge` property. (Either the `client_secret` or the `code_verifier` is required) | [optional] +**GrantType** | Pointer to **string** | A suggestion to the token generation which type of credentials are being provided. | [optional] +**Username** | Pointer to **NullableString** | When using the user password grant_type, specify the username. Authress recommends this should always be an email address. | [optional] +**Password** | Pointer to **NullableString** | When using the user password grant_type, specify the user's password. | [optional] +**Type** | Pointer to **NullableString** | Enables additional configuration of the grant_type. In the case of user password grant_type, set this to **signup**, to enable the creation of users. Set this to **update**, force update the password associated with the user. | [optional] + +## Methods + +### NewOAuthTokenRequest + +`func NewOAuthTokenRequest(clientId string, ) *OAuthTokenRequest` + +NewOAuthTokenRequest instantiates a new OAuthTokenRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewOAuthTokenRequestWithDefaults + +`func NewOAuthTokenRequestWithDefaults() *OAuthTokenRequest` + +NewOAuthTokenRequestWithDefaults instantiates a new OAuthTokenRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetClientId + +`func (o *OAuthTokenRequest) GetClientId() string` + +GetClientId returns the ClientId field if non-nil, zero value otherwise. + +### GetClientIdOk + +`func (o *OAuthTokenRequest) GetClientIdOk() (*string, bool)` + +GetClientIdOk returns a tuple with the ClientId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetClientId + +`func (o *OAuthTokenRequest) SetClientId(v string)` + +SetClientId sets ClientId field to given value. + + +### GetClientSecret + +`func (o *OAuthTokenRequest) GetClientSecret() string` + +GetClientSecret returns the ClientSecret field if non-nil, zero value otherwise. + +### GetClientSecretOk + +`func (o *OAuthTokenRequest) GetClientSecretOk() (*string, bool)` + +GetClientSecretOk returns a tuple with the ClientSecret field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetClientSecret + +`func (o *OAuthTokenRequest) SetClientSecret(v string)` + +SetClientSecret sets ClientSecret field to given value. + +### HasClientSecret + +`func (o *OAuthTokenRequest) HasClientSecret() bool` + +HasClientSecret returns a boolean if a field has been set. + +### SetClientSecretNil + +`func (o *OAuthTokenRequest) SetClientSecretNil(b bool)` + + SetClientSecretNil sets the value for ClientSecret to be an explicit nil + +### UnsetClientSecret +`func (o *OAuthTokenRequest) UnsetClientSecret()` + +UnsetClientSecret ensures that no value is present for ClientSecret, not even an explicit nil +### GetCodeVerifier + +`func (o *OAuthTokenRequest) GetCodeVerifier() string` + +GetCodeVerifier returns the CodeVerifier field if non-nil, zero value otherwise. + +### GetCodeVerifierOk + +`func (o *OAuthTokenRequest) GetCodeVerifierOk() (*string, bool)` + +GetCodeVerifierOk returns a tuple with the CodeVerifier field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCodeVerifier + +`func (o *OAuthTokenRequest) SetCodeVerifier(v string)` + +SetCodeVerifier sets CodeVerifier field to given value. + +### HasCodeVerifier + +`func (o *OAuthTokenRequest) HasCodeVerifier() bool` + +HasCodeVerifier returns a boolean if a field has been set. + +### GetGrantType + +`func (o *OAuthTokenRequest) GetGrantType() string` + +GetGrantType returns the GrantType field if non-nil, zero value otherwise. + +### GetGrantTypeOk + +`func (o *OAuthTokenRequest) GetGrantTypeOk() (*string, bool)` + +GetGrantTypeOk returns a tuple with the GrantType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGrantType + +`func (o *OAuthTokenRequest) SetGrantType(v string)` + +SetGrantType sets GrantType field to given value. + +### HasGrantType + +`func (o *OAuthTokenRequest) HasGrantType() bool` + +HasGrantType returns a boolean if a field has been set. + +### GetUsername + +`func (o *OAuthTokenRequest) GetUsername() string` + +GetUsername returns the Username field if non-nil, zero value otherwise. + +### GetUsernameOk + +`func (o *OAuthTokenRequest) GetUsernameOk() (*string, bool)` + +GetUsernameOk returns a tuple with the Username field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsername + +`func (o *OAuthTokenRequest) SetUsername(v string)` + +SetUsername sets Username field to given value. + +### HasUsername + +`func (o *OAuthTokenRequest) HasUsername() bool` + +HasUsername returns a boolean if a field has been set. + +### SetUsernameNil + +`func (o *OAuthTokenRequest) SetUsernameNil(b bool)` + + SetUsernameNil sets the value for Username to be an explicit nil + +### UnsetUsername +`func (o *OAuthTokenRequest) UnsetUsername()` + +UnsetUsername ensures that no value is present for Username, not even an explicit nil +### GetPassword + +`func (o *OAuthTokenRequest) GetPassword() string` + +GetPassword returns the Password field if non-nil, zero value otherwise. + +### GetPasswordOk + +`func (o *OAuthTokenRequest) GetPasswordOk() (*string, bool)` + +GetPasswordOk returns a tuple with the Password field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPassword + +`func (o *OAuthTokenRequest) SetPassword(v string)` + +SetPassword sets Password field to given value. + +### HasPassword + +`func (o *OAuthTokenRequest) HasPassword() bool` + +HasPassword returns a boolean if a field has been set. + +### SetPasswordNil + +`func (o *OAuthTokenRequest) SetPasswordNil(b bool)` + + SetPasswordNil sets the value for Password to be an explicit nil + +### UnsetPassword +`func (o *OAuthTokenRequest) UnsetPassword()` + +UnsetPassword ensures that no value is present for Password, not even an explicit nil +### GetType + +`func (o *OAuthTokenRequest) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *OAuthTokenRequest) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *OAuthTokenRequest) SetType(v string)` + +SetType sets Type field to given value. + +### HasType + +`func (o *OAuthTokenRequest) HasType() bool` + +HasType returns a boolean if a field has been set. + +### SetTypeNil + +`func (o *OAuthTokenRequest) SetTypeNil(b bool)` + + SetTypeNil sets the value for Type to be an explicit nil + +### UnsetType +`func (o *OAuthTokenRequest) UnsetType()` + +UnsetType ensures that no value is present for Type, not even an explicit nil + +[[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/docs/OAuthTokenResponse.md b/docs/OAuthTokenResponse.md new file mode 100644 index 0000000..08775e8 --- /dev/null +++ b/docs/OAuthTokenResponse.md @@ -0,0 +1,51 @@ +# OAuthTokenResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AccessToken** | **string** | An expiring access token that can be used to access either Authress or any platform service. | + +## Methods + +### NewOAuthTokenResponse + +`func NewOAuthTokenResponse(accessToken string, ) *OAuthTokenResponse` + +NewOAuthTokenResponse instantiates a new OAuthTokenResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewOAuthTokenResponseWithDefaults + +`func NewOAuthTokenResponseWithDefaults() *OAuthTokenResponse` + +NewOAuthTokenResponseWithDefaults instantiates a new OAuthTokenResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAccessToken + +`func (o *OAuthTokenResponse) GetAccessToken() string` + +GetAccessToken returns the AccessToken field if non-nil, zero value otherwise. + +### GetAccessTokenOk + +`func (o *OAuthTokenResponse) GetAccessTokenOk() (*string, bool)` + +GetAccessTokenOk returns a tuple with the AccessToken field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccessToken + +`func (o *OAuthTokenResponse) SetAccessToken(v string)` + +SetAccessToken sets AccessToken field to given value. + + + +[[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/docs/Pagination.md b/docs/Pagination.md new file mode 100644 index 0000000..5bfb4f3 --- /dev/null +++ b/docs/Pagination.md @@ -0,0 +1,66 @@ +# Pagination + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Next** | Pointer to [**NullablePaginationNext**](PaginationNext.md) | | [optional] + +## Methods + +### NewPagination + +`func NewPagination() *Pagination` + +NewPagination instantiates a new Pagination object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPaginationWithDefaults + +`func NewPaginationWithDefaults() *Pagination` + +NewPaginationWithDefaults instantiates a new Pagination object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetNext + +`func (o *Pagination) GetNext() PaginationNext` + +GetNext returns the Next field if non-nil, zero value otherwise. + +### GetNextOk + +`func (o *Pagination) GetNextOk() (*PaginationNext, bool)` + +GetNextOk returns a tuple with the Next field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNext + +`func (o *Pagination) SetNext(v PaginationNext)` + +SetNext sets Next field to given value. + +### HasNext + +`func (o *Pagination) HasNext() bool` + +HasNext returns a boolean if a field has been set. + +### SetNextNil + +`func (o *Pagination) SetNextNil(b bool)` + + SetNextNil sets the value for Next to be an explicit nil + +### UnsetNext +`func (o *Pagination) UnsetNext()` + +UnsetNext ensures that no value is present for Next, not even an explicit nil + +[[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/docs/PaginationNext.md b/docs/PaginationNext.md new file mode 100644 index 0000000..96d083b --- /dev/null +++ b/docs/PaginationNext.md @@ -0,0 +1,51 @@ +# PaginationNext + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Cursor** | **string** | | + +## Methods + +### NewPaginationNext + +`func NewPaginationNext(cursor string, ) *PaginationNext` + +NewPaginationNext instantiates a new PaginationNext object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPaginationNextWithDefaults + +`func NewPaginationNextWithDefaults() *PaginationNext` + +NewPaginationNextWithDefaults instantiates a new PaginationNext object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCursor + +`func (o *PaginationNext) GetCursor() string` + +GetCursor returns the Cursor field if non-nil, zero value otherwise. + +### GetCursorOk + +`func (o *PaginationNext) GetCursorOk() (*string, bool)` + +GetCursorOk returns a tuple with the Cursor field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCursor + +`func (o *PaginationNext) SetCursor(v string)` + +SetCursor sets Cursor field to given value. + + + +[[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/docs/PermissionCollection.md b/docs/PermissionCollection.md new file mode 100644 index 0000000..7446a28 --- /dev/null +++ b/docs/PermissionCollection.md @@ -0,0 +1,98 @@ +# PermissionCollection + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Account** | Pointer to [**PermissionCollectionAccount**](PermissionCollectionAccount.md) | | [optional] +**UserId** | [**UserId**](UserId.md) | | +**Permissions** | [**[]PermissionObject**](PermissionObject.md) | A list of the permissions | + +## Methods + +### NewPermissionCollection + +`func NewPermissionCollection(userId UserId, permissions []PermissionObject, ) *PermissionCollection` + +NewPermissionCollection instantiates a new PermissionCollection object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPermissionCollectionWithDefaults + +`func NewPermissionCollectionWithDefaults() *PermissionCollection` + +NewPermissionCollectionWithDefaults instantiates a new PermissionCollection object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAccount + +`func (o *PermissionCollection) GetAccount() PermissionCollectionAccount` + +GetAccount returns the Account field if non-nil, zero value otherwise. + +### GetAccountOk + +`func (o *PermissionCollection) GetAccountOk() (*PermissionCollectionAccount, bool)` + +GetAccountOk returns a tuple with the Account field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccount + +`func (o *PermissionCollection) SetAccount(v PermissionCollectionAccount)` + +SetAccount sets Account field to given value. + +### HasAccount + +`func (o *PermissionCollection) HasAccount() bool` + +HasAccount returns a boolean if a field has been set. + +### GetUserId + +`func (o *PermissionCollection) GetUserId() UserId` + +GetUserId returns the UserId field if non-nil, zero value otherwise. + +### GetUserIdOk + +`func (o *PermissionCollection) GetUserIdOk() (*UserId, bool)` + +GetUserIdOk returns a tuple with the UserId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserId + +`func (o *PermissionCollection) SetUserId(v UserId)` + +SetUserId sets UserId field to given value. + + +### GetPermissions + +`func (o *PermissionCollection) GetPermissions() []PermissionObject` + +GetPermissions returns the Permissions field if non-nil, zero value otherwise. + +### GetPermissionsOk + +`func (o *PermissionCollection) GetPermissionsOk() (*[]PermissionObject, bool)` + +GetPermissionsOk returns a tuple with the Permissions field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPermissions + +`func (o *PermissionCollection) SetPermissions(v []PermissionObject)` + +SetPermissions sets Permissions field to given value. + + + +[[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/docs/PermissionCollectionAccount.md b/docs/PermissionCollectionAccount.md new file mode 100644 index 0000000..013719d --- /dev/null +++ b/docs/PermissionCollectionAccount.md @@ -0,0 +1,56 @@ +# PermissionCollectionAccount + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AccountId** | Pointer to **string** | | [optional] + +## Methods + +### NewPermissionCollectionAccount + +`func NewPermissionCollectionAccount() *PermissionCollectionAccount` + +NewPermissionCollectionAccount instantiates a new PermissionCollectionAccount object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPermissionCollectionAccountWithDefaults + +`func NewPermissionCollectionAccountWithDefaults() *PermissionCollectionAccount` + +NewPermissionCollectionAccountWithDefaults instantiates a new PermissionCollectionAccount object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAccountId + +`func (o *PermissionCollectionAccount) GetAccountId() string` + +GetAccountId returns the AccountId field if non-nil, zero value otherwise. + +### GetAccountIdOk + +`func (o *PermissionCollectionAccount) GetAccountIdOk() (*string, bool)` + +GetAccountIdOk returns a tuple with the AccountId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccountId + +`func (o *PermissionCollectionAccount) SetAccountId(v string)` + +SetAccountId sets AccountId field to given value. + +### HasAccountId + +`func (o *PermissionCollectionAccount) HasAccountId() bool` + +HasAccountId returns a boolean if a field has been set. + + +[[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/docs/PermissionObject.md b/docs/PermissionObject.md new file mode 100644 index 0000000..ed09538 --- /dev/null +++ b/docs/PermissionObject.md @@ -0,0 +1,114 @@ +# PermissionObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Action** | **string** | The action the permission grants, can be scoped using `:` and parent actions imply sub-resource permissions, action:* or action implies action:sub-action. This property is case-insensitive, it will always be cast to lowercase before comparing actions to user permissions. | +**Allow** | **bool** | Does this permission grant the user the ability to execute the action? | +**Grant** | **bool** | Allows the user to give the permission to others without being able to execute the action. | +**Delegate** | **bool** | Allows delegating or granting the permission to others without being able to execute the action. | + +## Methods + +### NewPermissionObject + +`func NewPermissionObject(action string, allow bool, grant bool, delegate bool, ) *PermissionObject` + +NewPermissionObject instantiates a new PermissionObject object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPermissionObjectWithDefaults + +`func NewPermissionObjectWithDefaults() *PermissionObject` + +NewPermissionObjectWithDefaults instantiates a new PermissionObject object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAction + +`func (o *PermissionObject) GetAction() string` + +GetAction returns the Action field if non-nil, zero value otherwise. + +### GetActionOk + +`func (o *PermissionObject) GetActionOk() (*string, bool)` + +GetActionOk returns a tuple with the Action field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAction + +`func (o *PermissionObject) SetAction(v string)` + +SetAction sets Action field to given value. + + +### GetAllow + +`func (o *PermissionObject) GetAllow() bool` + +GetAllow returns the Allow field if non-nil, zero value otherwise. + +### GetAllowOk + +`func (o *PermissionObject) GetAllowOk() (*bool, bool)` + +GetAllowOk returns a tuple with the Allow field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAllow + +`func (o *PermissionObject) SetAllow(v bool)` + +SetAllow sets Allow field to given value. + + +### GetGrant + +`func (o *PermissionObject) GetGrant() bool` + +GetGrant returns the Grant field if non-nil, zero value otherwise. + +### GetGrantOk + +`func (o *PermissionObject) GetGrantOk() (*bool, bool)` + +GetGrantOk returns a tuple with the Grant field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGrant + +`func (o *PermissionObject) SetGrant(v bool)` + +SetGrant sets Grant field to given value. + + +### GetDelegate + +`func (o *PermissionObject) GetDelegate() bool` + +GetDelegate returns the Delegate field if non-nil, zero value otherwise. + +### GetDelegateOk + +`func (o *PermissionObject) GetDelegateOk() (*bool, bool)` + +GetDelegateOk returns a tuple with the Delegate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDelegate + +`func (o *PermissionObject) SetDelegate(v bool)` + +SetDelegate sets Delegate field to given value. + + + +[[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/docs/PermissionedResource.md b/docs/PermissionedResource.md new file mode 100644 index 0000000..c6ffbd2 --- /dev/null +++ b/docs/PermissionedResource.md @@ -0,0 +1,51 @@ +# PermissionedResource + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Permissions** | [**[]ResourcePermission**](ResourcePermission.md) | | + +## Methods + +### NewPermissionedResource + +`func NewPermissionedResource(permissions []ResourcePermission, ) *PermissionedResource` + +NewPermissionedResource instantiates a new PermissionedResource object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPermissionedResourceWithDefaults + +`func NewPermissionedResourceWithDefaults() *PermissionedResource` + +NewPermissionedResourceWithDefaults instantiates a new PermissionedResource object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetPermissions + +`func (o *PermissionedResource) GetPermissions() []ResourcePermission` + +GetPermissions returns the Permissions field if non-nil, zero value otherwise. + +### GetPermissionsOk + +`func (o *PermissionedResource) GetPermissionsOk() (*[]ResourcePermission, bool)` + +GetPermissionsOk returns a tuple with the Permissions field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPermissions + +`func (o *PermissionedResource) SetPermissions(v []ResourcePermission)` + +SetPermissions sets Permissions field to given value. + + + +[[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/docs/PermissionedResourceCollection.md b/docs/PermissionedResourceCollection.md new file mode 100644 index 0000000..b98fc2f --- /dev/null +++ b/docs/PermissionedResourceCollection.md @@ -0,0 +1,98 @@ +# PermissionedResourceCollection + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Resources** | [**[]PermissionedResource**](PermissionedResource.md) | | +**Pagination** | Pointer to [**Pagination**](Pagination.md) | | [optional] +**Links** | [**CollectionLinks**](CollectionLinks.md) | | + +## Methods + +### NewPermissionedResourceCollection + +`func NewPermissionedResourceCollection(resources []PermissionedResource, links CollectionLinks, ) *PermissionedResourceCollection` + +NewPermissionedResourceCollection instantiates a new PermissionedResourceCollection object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPermissionedResourceCollectionWithDefaults + +`func NewPermissionedResourceCollectionWithDefaults() *PermissionedResourceCollection` + +NewPermissionedResourceCollectionWithDefaults instantiates a new PermissionedResourceCollection object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetResources + +`func (o *PermissionedResourceCollection) GetResources() []PermissionedResource` + +GetResources returns the Resources field if non-nil, zero value otherwise. + +### GetResourcesOk + +`func (o *PermissionedResourceCollection) GetResourcesOk() (*[]PermissionedResource, bool)` + +GetResourcesOk returns a tuple with the Resources field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetResources + +`func (o *PermissionedResourceCollection) SetResources(v []PermissionedResource)` + +SetResources sets Resources field to given value. + + +### GetPagination + +`func (o *PermissionedResourceCollection) GetPagination() Pagination` + +GetPagination returns the Pagination field if non-nil, zero value otherwise. + +### GetPaginationOk + +`func (o *PermissionedResourceCollection) GetPaginationOk() (*Pagination, bool)` + +GetPaginationOk returns a tuple with the Pagination field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPagination + +`func (o *PermissionedResourceCollection) SetPagination(v Pagination)` + +SetPagination sets Pagination field to given value. + +### HasPagination + +`func (o *PermissionedResourceCollection) HasPagination() bool` + +HasPagination returns a boolean if a field has been set. + +### GetLinks + +`func (o *PermissionedResourceCollection) GetLinks() CollectionLinks` + +GetLinks returns the Links field if non-nil, zero value otherwise. + +### GetLinksOk + +`func (o *PermissionedResourceCollection) GetLinksOk() (*CollectionLinks, bool)` + +GetLinksOk returns a tuple with the Links field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLinks + +`func (o *PermissionedResourceCollection) SetLinks(v CollectionLinks)` + +SetLinks sets Links field to given value. + + + +[[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/docs/README.md b/docs/README.md new file mode 100644 index 0000000..6a7a46b --- /dev/null +++ b/docs/README.md @@ -0,0 +1,141 @@ +[Back to Repository](../README.md) [Authress API](https://authress.io/app/#/api) + +## Documentation for API Endpoints + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AccessRecordsAPI* | [**CreateClaim**](./AccessRecordsAPI.md#createclaim) | **Post** /v1/claims | Create resource Claim +*AccessRecordsAPI* | [**CreateRecord**](./AccessRecordsAPI.md#createrecord) | **Post** /v1/records | Create access record +*AccessRecordsAPI* | [**CreateRequest**](./AccessRecordsAPI.md#createrequest) | **Post** /v1/requests | Create access request +*AccessRecordsAPI* | [**DeleteRecord**](./AccessRecordsAPI.md#deleterecord) | **Delete** /v1/records/{recordId} | Deletes access record +*AccessRecordsAPI* | [**DeleteRequest**](./AccessRecordsAPI.md#deleterequest) | **Delete** /v1/requests/{requestId} | Deletes access request +*AccessRecordsAPI* | [**GetRecord**](./AccessRecordsAPI.md#getrecord) | **Get** /v1/records/{recordId} | Retrieve access record +*AccessRecordsAPI* | [**GetRecords**](./AccessRecordsAPI.md#getrecords) | **Get** /v1/records | List access records +*AccessRecordsAPI* | [**GetRequest**](./AccessRecordsAPI.md#getrequest) | **Get** /v1/requests/{requestId} | Retrieve access request +*AccessRecordsAPI* | [**GetRequests**](./AccessRecordsAPI.md#getrequests) | **Get** /v1/requests | List access requests +*AccessRecordsAPI* | [**RespondToAccessRequest**](./AccessRecordsAPI.md#respondtoaccessrequest) | **Patch** /v1/requests/{requestId} | Approve or deny access request +*AccessRecordsAPI* | [**UpdateRecord**](./AccessRecordsAPI.md#updaterecord) | **Put** /v1/records/{recordId} | Update access record +*AccountsAPI* | [**DelegateAuthentication**](./AccountsAPI.md#delegateauthentication) | **Post** /v1/identities | Link external provider +*AccountsAPI* | [**GetAccount**](./AccountsAPI.md#getaccount) | **Get** /v1/accounts/{accountId} | Retrieve account information +*AccountsAPI* | [**GetAccountIdentities**](./AccountsAPI.md#getaccountidentities) | **Get** /v1/identities | List linked external providers +*AccountsAPI* | [**GetAccounts**](./AccountsAPI.md#getaccounts) | **Get** /v1/accounts | List user Authress accounts +*ApplicationsAPI* | [**DelegateUserLogin**](./ApplicationsAPI.md#delegateuserlogin) | **Post** /v1/applications/{applicationId}/users/{userId}/delegation | Log user into third-party application +*ConnectionsAPI* | [**CreateConnection**](./ConnectionsAPI.md#createconnection) | **Post** /v1/connections | Create SSO connection +*ConnectionsAPI* | [**DeleteConnection**](./ConnectionsAPI.md#deleteconnection) | **Delete** /v1/connections/{connectionId} | Delete SSO connection +*ConnectionsAPI* | [**GetConnection**](./ConnectionsAPI.md#getconnection) | **Get** /v1/connections/{connectionId} | Retrieve SSO connection +*ConnectionsAPI* | [**GetConnectionCredentials**](./ConnectionsAPI.md#getconnectioncredentials) | **Get** /v1/connections/{connectionId}/users/{userId}/credentials | Retrieve user connection credentials +*ConnectionsAPI* | [**GetConnections**](./ConnectionsAPI.md#getconnections) | **Get** /v1/connections | List SSO connections +*ConnectionsAPI* | [**UpdateConnection**](./ConnectionsAPI.md#updateconnection) | **Put** /v1/connections/{connectionId} | Update SSO connection +*ExtensionsAPI* | [**CreateExtension**](./ExtensionsAPI.md#createextension) | **Post** /v1/extensions | Create extension +*ExtensionsAPI* | [**DeleteExtension**](./ExtensionsAPI.md#deleteextension) | **Delete** /v1/extensions/{extensionId} | Delete extension +*ExtensionsAPI* | [**GetExtension**](./ExtensionsAPI.md#getextension) | **Get** /v1/extensions/{extensionId} | Retrieve extension +*ExtensionsAPI* | [**GetExtensions**](./ExtensionsAPI.md#getextensions) | **Get** /v1/extensions | List extensions +*ExtensionsAPI* | [**Login**](./ExtensionsAPI.md#login) | **Get** / | OAuth Authorize +*ExtensionsAPI* | [**RequestToken**](./ExtensionsAPI.md#requesttoken) | **Post** /api/authentication/oauth/tokens | OAuth Token +*ExtensionsAPI* | [**UpdateExtension**](./ExtensionsAPI.md#updateextension) | **Put** /v1/extensions/{extensionId} | Update extension +*GroupsAPI* | [**CreateGroup**](./GroupsAPI.md#creategroup) | **Post** /v1/groups | Create group +*GroupsAPI* | [**DeleteGroup**](./GroupsAPI.md#deletegroup) | **Delete** /v1/groups/{groupId} | Deletes group +*GroupsAPI* | [**GetGroup**](./GroupsAPI.md#getgroup) | **Get** /v1/groups/{groupId} | Retrieve group +*GroupsAPI* | [**GetGroups**](./GroupsAPI.md#getgroups) | **Get** /v1/groups | List groups +*GroupsAPI* | [**UpdateGroup**](./GroupsAPI.md#updategroup) | **Put** /v1/groups/{groupId} | Update a group +*InvitesAPI* | [**CreateInvite**](./InvitesAPI.md#createinvite) | **Post** /v1/invites | Create user invite +*InvitesAPI* | [**DeleteInvite**](./InvitesAPI.md#deleteinvite) | **Delete** /v1/invites/{inviteId} | Delete invite +*InvitesAPI* | [**GetInvite**](./InvitesAPI.md#getinvite) | **Get** /v1/invites/{inviteId} | Retrieve invite +*InvitesAPI* | [**RespondToInvite**](./InvitesAPI.md#respondtoinvite) | **Patch** /v1/invites/{inviteId} | Accept invite +*ResourcePermissionsAPI* | [**GetPermissionedResource**](./ResourcePermissionsAPI.md#getpermissionedresource) | **Get** /v1/resources/{resourceUri} | Retrieve resource configuration +*ResourcePermissionsAPI* | [**GetPermissionedResources**](./ResourcePermissionsAPI.md#getpermissionedresources) | **Get** /v1/resources | List all resource configurations +*ResourcePermissionsAPI* | [**GetResourceUsers**](./ResourcePermissionsAPI.md#getresourceusers) | **Get** /v1/resources/{resourceUri}/users | List users with resource access +*ResourcePermissionsAPI* | [**UpdatePermissionedResource**](./ResourcePermissionsAPI.md#updatepermissionedresource) | **Put** /v1/resources/{resourceUri} | Update resource configuration +*RolesAPI* | [**CreateRole**](./RolesAPI.md#createrole) | **Post** /v1/roles | Create role +*RolesAPI* | [**DeleteRole**](./RolesAPI.md#deleterole) | **Delete** /v1/roles/{roleId} | Deletes role +*RolesAPI* | [**GetRole**](./RolesAPI.md#getrole) | **Get** /v1/roles/{roleId} | Retrieve role +*RolesAPI* | [**GetRoles**](./RolesAPI.md#getroles) | **Get** /v1/roles | List roles +*RolesAPI* | [**UpdateRole**](./RolesAPI.md#updaterole) | **Put** /v1/roles/{roleId} | Update role +*ServiceClientsAPI* | [**CreateClient**](./ServiceClientsAPI.md#createclient) | **Post** /v1/clients | Create service client +*ServiceClientsAPI* | [**DeleteAccessKey**](./ServiceClientsAPI.md#deleteaccesskey) | **Delete** /v1/clients/{clientId}/access-keys/{keyId} | Delete service client access key +*ServiceClientsAPI* | [**DeleteClient**](./ServiceClientsAPI.md#deleteclient) | **Delete** /v1/clients/{clientId} | Delete service client +*ServiceClientsAPI* | [**GetClient**](./ServiceClientsAPI.md#getclient) | **Get** /v1/clients/{clientId} | Retrieve service client +*ServiceClientsAPI* | [**GetClients**](./ServiceClientsAPI.md#getclients) | **Get** /v1/clients | List service clients +*ServiceClientsAPI* | [**RequestAccessKey**](./ServiceClientsAPI.md#requestaccesskey) | **Post** /v1/clients/{clientId}/access-keys | Generate service client access key +*ServiceClientsAPI* | [**UpdateClient**](./ServiceClientsAPI.md#updateclient) | **Put** /v1/clients/{clientId} | Update service client +*TenantsAPI* | [**CreateTenant**](./TenantsAPI.md#createtenant) | **Post** /v1/tenants | Create tenant +*TenantsAPI* | [**DeleteTenant**](./TenantsAPI.md#deletetenant) | **Delete** /v1/tenants/{tenantId} | Delete tenant +*TenantsAPI* | [**GetTenant**](./TenantsAPI.md#gettenant) | **Get** /v1/tenants/{tenantId} | Retrieve tenant +*TenantsAPI* | [**GetTenants**](./TenantsAPI.md#gettenants) | **Get** /v1/tenants | List tenants +*TenantsAPI* | [**UpdateTenant**](./TenantsAPI.md#updatetenant) | **Put** /v1/tenants/{tenantId} | Update tenant +*UserPermissionsAPI* | [**AuthorizeUser**](./UserPermissionsAPI.md#authorizeuser) | **Get** /v1/users/{userId}/resources/{resourceUri}/permissions/{permission} | Verify user authorization +*UserPermissionsAPI* | [**GetUserPermissionsForResource**](./UserPermissionsAPI.md#getuserpermissionsforresource) | **Get** /v1/users/{userId}/resources/{resourceUri}/permissions | Get user permissions for resource +*UserPermissionsAPI* | [**GetUserResources**](./UserPermissionsAPI.md#getuserresources) | **Get** /v1/users/{userId}/resources | List user resources +*UserPermissionsAPI* | [**GetUserRolesForResource**](./UserPermissionsAPI.md#getuserrolesforresource) | **Get** /v1/users/{userId}/resources/{resourceUri}/roles | Get user roles for resource +*UsersAPI* | [**DeleteUser**](./UsersAPI.md#deleteuser) | **Delete** /v1/users/{userId} | Delete a user +*UsersAPI* | [**GetUser**](./UsersAPI.md#getuser) | **Get** /v1/users/{userId} | Retrieve a user +*UsersAPI* | [**GetUsers**](./UsersAPI.md#getusers) | **Get** /v1/users | List users + + +## Documentation For Models + + - [AccessRecord](./AccessRecord.md) + - [AccessRecordAccount](./AccessRecordAccount.md) + - [AccessRecordCollection](./AccessRecordCollection.md) + - [AccessRequest](./AccessRequest.md) + - [AccessRequestCollection](./AccessRequestCollection.md) + - [AccessRequestResponse](./AccessRequestResponse.md) + - [AccessTemplate](./AccessTemplate.md) + - [Account](./Account.md) + - [AccountCollection](./AccountCollection.md) + - [AccountLinks](./AccountLinks.md) + - [ApplicationDelegation](./ApplicationDelegation.md) + - [ClaimRequest](./ClaimRequest.md) + - [Client](./Client.md) + - [ClientAccessKey](./ClientAccessKey.md) + - [ClientCollection](./ClientCollection.md) + - [ClientOptions](./ClientOptions.md) + - [CollectionLinks](./CollectionLinks.md) + - [Connection](./Connection.md) + - [ConnectionCollection](./ConnectionCollection.md) + - [ConnectionData](./ConnectionData.md) + - [ConnectionDefaultConnectionProperties](./ConnectionDefaultConnectionProperties.md) + - [ConnectionUserDataConfiguration](./ConnectionUserDataConfiguration.md) + - [Extension](./Extension.md) + - [ExtensionApplication](./ExtensionApplication.md) + - [ExtensionClient](./ExtensionClient.md) + - [ExtensionCollection](./ExtensionCollection.md) + - [Group](./Group.md) + - [GroupCollection](./GroupCollection.md) + - [Identity](./Identity.md) + - [IdentityCollection](./IdentityCollection.md) + - [IdentityRequest](./IdentityRequest.md) + - [Invite](./Invite.md) + - [Link](./Link.md) + - [LinkedGroup](./LinkedGroup.md) + - [Links](./Links.md) + - [OAuthAuthorizeResponse](./OAuthAuthorizeResponse.md) + - [OAuthTokenRequest](./OAuthTokenRequest.md) + - [OAuthTokenResponse](./OAuthTokenResponse.md) + - [Pagination](./Pagination.md) + - [PaginationNext](./PaginationNext.md) + - [PermissionCollection](./PermissionCollection.md) + - [PermissionCollectionAccount](./PermissionCollectionAccount.md) + - [PermissionObject](./PermissionObject.md) + - [PermissionedResource](./PermissionedResource.md) + - [PermissionedResourceCollection](./PermissionedResourceCollection.md) + - [Resource](./Resource.md) + - [ResourcePermission](./ResourcePermission.md) + - [ResourceUsersCollection](./ResourceUsersCollection.md) + - [Role](./Role.md) + - [RoleCollection](./RoleCollection.md) + - [Statement](./Statement.md) + - [Tenant](./Tenant.md) + - [TenantCollection](./TenantCollection.md) + - [TenantConnection](./TenantConnection.md) + - [TenantData](./TenantData.md) + - [TokenRequest](./TokenRequest.md) + - [User](./User.md) + - [UserConnectionCredentials](./UserConnectionCredentials.md) + - [UserIdentity](./UserIdentity.md) + - [UserIdentityCollection](./UserIdentityCollection.md) + - [UserResourcesCollection](./UserResourcesCollection.md) + - [UserRole](./UserRole.md) + - [UserRoleCollection](./UserRoleCollection.md) + - [UserToken](./UserToken.md) + diff --git a/docs/Resource.md b/docs/Resource.md new file mode 100644 index 0000000..283f266 --- /dev/null +++ b/docs/Resource.md @@ -0,0 +1,51 @@ +# Resource + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ResourceUri** | **string** | A resource path which can be top level, fully qualified, or end with a *. Parent resources imply permissions to sub-resources. | + +## Methods + +### NewResource + +`func NewResource(resourceUri string, ) *Resource` + +NewResource instantiates a new Resource object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewResourceWithDefaults + +`func NewResourceWithDefaults() *Resource` + +NewResourceWithDefaults instantiates a new Resource object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetResourceUri + +`func (o *Resource) GetResourceUri() string` + +GetResourceUri returns the ResourceUri field if non-nil, zero value otherwise. + +### GetResourceUriOk + +`func (o *Resource) GetResourceUriOk() (*string, bool)` + +GetResourceUriOk returns a tuple with the ResourceUri field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetResourceUri + +`func (o *Resource) SetResourceUri(v string)` + +SetResourceUri sets ResourceUri field to given value. + + + +[[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/docs/ResourcePermission.md b/docs/ResourcePermission.md new file mode 100644 index 0000000..5245aaa --- /dev/null +++ b/docs/ResourcePermission.md @@ -0,0 +1,72 @@ +# ResourcePermission + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Action** | **string** | | +**Allow** | **bool** | | + +## Methods + +### NewResourcePermission + +`func NewResourcePermission(action string, allow bool, ) *ResourcePermission` + +NewResourcePermission instantiates a new ResourcePermission object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewResourcePermissionWithDefaults + +`func NewResourcePermissionWithDefaults() *ResourcePermission` + +NewResourcePermissionWithDefaults instantiates a new ResourcePermission object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAction + +`func (o *ResourcePermission) GetAction() string` + +GetAction returns the Action field if non-nil, zero value otherwise. + +### GetActionOk + +`func (o *ResourcePermission) GetActionOk() (*string, bool)` + +GetActionOk returns a tuple with the Action field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAction + +`func (o *ResourcePermission) SetAction(v string)` + +SetAction sets Action field to given value. + + +### GetAllow + +`func (o *ResourcePermission) GetAllow() bool` + +GetAllow returns the Allow field if non-nil, zero value otherwise. + +### GetAllowOk + +`func (o *ResourcePermission) GetAllowOk() (*bool, bool)` + +GetAllowOk returns a tuple with the Allow field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAllow + +`func (o *ResourcePermission) SetAllow(v bool)` + +SetAllow sets Allow field to given value. + + + +[[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/docs/ResourcePermissionsAPI.md b/docs/ResourcePermissionsAPI.md new file mode 100644 index 0000000..0c55cb3 --- /dev/null +++ b/docs/ResourcePermissionsAPI.md @@ -0,0 +1,287 @@ +# \ResourcePermissionsAPI + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetPermissionedResource**](ResourcePermissionsAPI.md#GetPermissionedResource) | **Get** /v1/resources/{resourceUri} | Retrieve resource configuration +[**GetPermissionedResources**](ResourcePermissionsAPI.md#GetPermissionedResources) | **Get** /v1/resources | List all resource configurations +[**GetResourceUsers**](ResourcePermissionsAPI.md#GetResourceUsers) | **Get** /v1/resources/{resourceUri}/users | List users with resource access +[**UpdatePermissionedResource**](ResourcePermissionsAPI.md#UpdatePermissionedResource) | **Put** /v1/resources/{resourceUri} | Update resource configuration + + + +## GetPermissionedResource + +> PermissionedResource GetPermissionedResource(ctx, resourceUri).Execute() + +Retrieve resource configuration + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + resourceUri := "/organizations/org_a/documents/doc_1" // string | The uri path of a resource to validate, must be URL encoded, uri segments are allowed. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ResourcePermissionsAPI.GetPermissionedResource(context.Background(), resourceUri).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ResourcePermissionsAPI.GetPermissionedResource``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetPermissionedResource`: PermissionedResource + fmt.Fprintf(os.Stdout, "Response from `ResourcePermissionsAPI.GetPermissionedResource`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**resourceUri** | **string** | The uri path of a resource to validate, must be URL encoded, uri segments are allowed. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetPermissionedResourceRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**PermissionedResource**](PermissionedResource.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/links+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) + + +## GetPermissionedResources + +> PermissionedResourceCollection GetPermissionedResources(ctx).Execute() + +List all resource configurations + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ResourcePermissionsAPI.GetPermissionedResources(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ResourcePermissionsAPI.GetPermissionedResources``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetPermissionedResources`: PermissionedResourceCollection + fmt.Fprintf(os.Stdout, "Response from `ResourcePermissionsAPI.GetPermissionedResources`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetPermissionedResourcesRequest struct via the builder pattern + + +### Return type + +[**PermissionedResourceCollection**](PermissionedResourceCollection.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/links+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) + + +## GetResourceUsers + +> ResourceUsersCollection GetResourceUsers(ctx, resourceUri).Limit(limit).Cursor(cursor).Execute() + +List users with resource access + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + resourceUri := "/organizations/org_a/documents/doc_1" // string | The uri path of a resource to validate, must be URL encoded, uri segments are allowed. + limit := int32(56) // int32 | Max number of results to return (optional) (default to 20) + cursor := "cursor_example" // string | Continuation cursor for paging (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ResourcePermissionsAPI.GetResourceUsers(context.Background(), resourceUri).Limit(limit).Cursor(cursor).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ResourcePermissionsAPI.GetResourceUsers``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetResourceUsers`: ResourceUsersCollection + fmt.Fprintf(os.Stdout, "Response from `ResourcePermissionsAPI.GetResourceUsers`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**resourceUri** | **string** | The uri path of a resource to validate, must be URL encoded, uri segments are allowed. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetResourceUsersRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **int32** | Max number of results to return | [default to 20] + **cursor** | **string** | Continuation cursor for paging | + +### Return type + +[**ResourceUsersCollection**](ResourceUsersCollection.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/links+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) + + +## UpdatePermissionedResource + +> UpdatePermissionedResource(ctx, resourceUri).PermissionedResource(permissionedResource).Execute() + +Update resource configuration + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + resourceUri := "/organizations/org_a/documents/doc_1" // string | The uri path of a resource to validate, must be URL encoded, uri segments are allowed. + permissionedResource := *openapiclient.NewPermissionedResource([]openapiclient.ResourcePermission{*openapiclient.NewResourcePermission("Action_example", false)}) // PermissionedResource | The contents of the permission to set on the resource. Overwrites existing data. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.ResourcePermissionsAPI.UpdatePermissionedResource(context.Background(), resourceUri).PermissionedResource(permissionedResource).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ResourcePermissionsAPI.UpdatePermissionedResource``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**resourceUri** | **string** | The uri path of a resource to validate, must be URL encoded, uri segments are allowed. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdatePermissionedResourceRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **permissionedResource** | [**PermissionedResource**](PermissionedResource.md) | The contents of the permission to set on the resource. Overwrites existing data. | + +### Return type + + (empty response body) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[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/docs/ResourceUsersCollection.md b/docs/ResourceUsersCollection.md new file mode 100644 index 0000000..a883315 --- /dev/null +++ b/docs/ResourceUsersCollection.md @@ -0,0 +1,98 @@ +# ResourceUsersCollection + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Users** | [**[]UserRoleCollection**](UserRoleCollection.md) | A list of users | +**Pagination** | Pointer to [**Pagination**](Pagination.md) | | [optional] +**Links** | [**CollectionLinks**](CollectionLinks.md) | | + +## Methods + +### NewResourceUsersCollection + +`func NewResourceUsersCollection(users []UserRoleCollection, links CollectionLinks, ) *ResourceUsersCollection` + +NewResourceUsersCollection instantiates a new ResourceUsersCollection object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewResourceUsersCollectionWithDefaults + +`func NewResourceUsersCollectionWithDefaults() *ResourceUsersCollection` + +NewResourceUsersCollectionWithDefaults instantiates a new ResourceUsersCollection object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetUsers + +`func (o *ResourceUsersCollection) GetUsers() []UserRoleCollection` + +GetUsers returns the Users field if non-nil, zero value otherwise. + +### GetUsersOk + +`func (o *ResourceUsersCollection) GetUsersOk() (*[]UserRoleCollection, bool)` + +GetUsersOk returns a tuple with the Users field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsers + +`func (o *ResourceUsersCollection) SetUsers(v []UserRoleCollection)` + +SetUsers sets Users field to given value. + + +### GetPagination + +`func (o *ResourceUsersCollection) GetPagination() Pagination` + +GetPagination returns the Pagination field if non-nil, zero value otherwise. + +### GetPaginationOk + +`func (o *ResourceUsersCollection) GetPaginationOk() (*Pagination, bool)` + +GetPaginationOk returns a tuple with the Pagination field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPagination + +`func (o *ResourceUsersCollection) SetPagination(v Pagination)` + +SetPagination sets Pagination field to given value. + +### HasPagination + +`func (o *ResourceUsersCollection) HasPagination() bool` + +HasPagination returns a boolean if a field has been set. + +### GetLinks + +`func (o *ResourceUsersCollection) GetLinks() CollectionLinks` + +GetLinks returns the Links field if non-nil, zero value otherwise. + +### GetLinksOk + +`func (o *ResourceUsersCollection) GetLinksOk() (*CollectionLinks, bool)` + +GetLinksOk returns a tuple with the Links field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLinks + +`func (o *ResourceUsersCollection) SetLinks(v CollectionLinks)` + +SetLinks sets Links field to given value. + + + +[[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/docs/Role.md b/docs/Role.md new file mode 100644 index 0000000..5506e9e --- /dev/null +++ b/docs/Role.md @@ -0,0 +1,134 @@ +# Role + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**RoleId** | Pointer to **string** | Unique identifier for the role, can be specified on creation, and used by records to map to permissions. | [optional] +**Name** | **string** | A helpful name for this role | +**Description** | Pointer to **NullableString** | A description for when to the user as well as additional information. | [optional] +**Permissions** | [**[]PermissionObject**](PermissionObject.md) | A list of the permissions | + +## Methods + +### NewRole + +`func NewRole(name string, permissions []PermissionObject, ) *Role` + +NewRole instantiates a new Role object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRoleWithDefaults + +`func NewRoleWithDefaults() *Role` + +NewRoleWithDefaults instantiates a new Role object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetRoleId + +`func (o *Role) GetRoleId() string` + +GetRoleId returns the RoleId field if non-nil, zero value otherwise. + +### GetRoleIdOk + +`func (o *Role) GetRoleIdOk() (*string, bool)` + +GetRoleIdOk returns a tuple with the RoleId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRoleId + +`func (o *Role) SetRoleId(v string)` + +SetRoleId sets RoleId field to given value. + +### HasRoleId + +`func (o *Role) HasRoleId() bool` + +HasRoleId returns a boolean if a field has been set. + +### GetName + +`func (o *Role) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Role) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *Role) SetName(v string)` + +SetName sets Name field to given value. + + +### GetDescription + +`func (o *Role) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *Role) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *Role) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *Role) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### SetDescriptionNil + +`func (o *Role) SetDescriptionNil(b bool)` + + SetDescriptionNil sets the value for Description to be an explicit nil + +### UnsetDescription +`func (o *Role) UnsetDescription()` + +UnsetDescription ensures that no value is present for Description, not even an explicit nil +### GetPermissions + +`func (o *Role) GetPermissions() []PermissionObject` + +GetPermissions returns the Permissions field if non-nil, zero value otherwise. + +### GetPermissionsOk + +`func (o *Role) GetPermissionsOk() (*[]PermissionObject, bool)` + +GetPermissionsOk returns a tuple with the Permissions field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPermissions + +`func (o *Role) SetPermissions(v []PermissionObject)` + +SetPermissions sets Permissions field to given value. + + + +[[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/docs/RoleCollection.md b/docs/RoleCollection.md new file mode 100644 index 0000000..4266834 --- /dev/null +++ b/docs/RoleCollection.md @@ -0,0 +1,98 @@ +# RoleCollection + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Roles** | [**[]Role**](Role.md) | A list of roles | +**Pagination** | Pointer to [**Pagination**](Pagination.md) | | [optional] +**Links** | [**CollectionLinks**](CollectionLinks.md) | | + +## Methods + +### NewRoleCollection + +`func NewRoleCollection(roles []Role, links CollectionLinks, ) *RoleCollection` + +NewRoleCollection instantiates a new RoleCollection object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRoleCollectionWithDefaults + +`func NewRoleCollectionWithDefaults() *RoleCollection` + +NewRoleCollectionWithDefaults instantiates a new RoleCollection object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetRoles + +`func (o *RoleCollection) GetRoles() []Role` + +GetRoles returns the Roles field if non-nil, zero value otherwise. + +### GetRolesOk + +`func (o *RoleCollection) GetRolesOk() (*[]Role, bool)` + +GetRolesOk returns a tuple with the Roles field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRoles + +`func (o *RoleCollection) SetRoles(v []Role)` + +SetRoles sets Roles field to given value. + + +### GetPagination + +`func (o *RoleCollection) GetPagination() Pagination` + +GetPagination returns the Pagination field if non-nil, zero value otherwise. + +### GetPaginationOk + +`func (o *RoleCollection) GetPaginationOk() (*Pagination, bool)` + +GetPaginationOk returns a tuple with the Pagination field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPagination + +`func (o *RoleCollection) SetPagination(v Pagination)` + +SetPagination sets Pagination field to given value. + +### HasPagination + +`func (o *RoleCollection) HasPagination() bool` + +HasPagination returns a boolean if a field has been set. + +### GetLinks + +`func (o *RoleCollection) GetLinks() CollectionLinks` + +GetLinks returns the Links field if non-nil, zero value otherwise. + +### GetLinksOk + +`func (o *RoleCollection) GetLinksOk() (*CollectionLinks, bool)` + +GetLinksOk returns a tuple with the Links field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLinks + +`func (o *RoleCollection) SetLinks(v CollectionLinks)` + +SetLinks sets Links field to given value. + + + +[[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/docs/RolesAPI.md b/docs/RolesAPI.md new file mode 100644 index 0000000..e668b65 --- /dev/null +++ b/docs/RolesAPI.md @@ -0,0 +1,359 @@ +# \RolesAPI + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateRole**](RolesAPI.md#CreateRole) | **Post** /v1/roles | Create role +[**DeleteRole**](RolesAPI.md#DeleteRole) | **Delete** /v1/roles/{roleId} | Deletes role +[**GetRole**](RolesAPI.md#GetRole) | **Get** /v1/roles/{roleId} | Retrieve role +[**GetRoles**](RolesAPI.md#GetRoles) | **Get** /v1/roles | List roles +[**UpdateRole**](RolesAPI.md#UpdateRole) | **Put** /v1/roles/{roleId} | Update role + + + +## CreateRole + +> Role CreateRole(ctx).Role(role).Execute() + +Create role + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + role := *openapiclient.NewRole("Name_example", []openapiclient.PermissionObject{*openapiclient.NewPermissionObject("documents:read", false, false, false)}) // Role | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.RolesAPI.CreateRole(context.Background()).Role(role).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `RolesAPI.CreateRole``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateRole`: Role + fmt.Fprintf(os.Stdout, "Response from `RolesAPI.CreateRole`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateRoleRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **role** | [**Role**](Role.md) | | + +### Return type + +[**Role**](Role.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/links+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) + + +## DeleteRole + +> DeleteRole(ctx, roleId).Execute() + +Deletes role + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + roleId := "roleId_example" // string | The identifier of the role. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.RolesAPI.DeleteRole(context.Background(), roleId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `RolesAPI.DeleteRole``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**roleId** | **string** | The identifier of the role. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteRoleRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[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) + + +## GetRole + +> Role GetRole(ctx, roleId).Execute() + +Retrieve role + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + roleId := "roleId_example" // string | The identifier of the role. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.RolesAPI.GetRole(context.Background(), roleId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `RolesAPI.GetRole``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetRole`: Role + fmt.Fprintf(os.Stdout, "Response from `RolesAPI.GetRole`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**roleId** | **string** | The identifier of the role. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetRoleRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**Role**](Role.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/links+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) + + +## GetRoles + +> RoleCollection GetRoles(ctx).Limit(limit).Cursor(cursor).Filter(filter).Execute() + +List roles + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + limit := int32(56) // int32 | Max number of results to return. (optional) (default to 100) + cursor := "cursor_example" // string | Continuation cursor for paging. (optional) + filter := "filter_example" // string | Filter to search roles by. This is a case insensitive search. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.RolesAPI.GetRoles(context.Background()).Limit(limit).Cursor(cursor).Filter(filter).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `RolesAPI.GetRoles``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetRoles`: RoleCollection + fmt.Fprintf(os.Stdout, "Response from `RolesAPI.GetRoles`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetRolesRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int32** | Max number of results to return. | [default to 100] + **cursor** | **string** | Continuation cursor for paging. | + **filter** | **string** | Filter to search roles by. This is a case insensitive search. | + +### Return type + +[**RoleCollection**](RoleCollection.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/links+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) + + +## UpdateRole + +> Role UpdateRole(ctx, roleId).Role(role).Execute() + +Update role + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + roleId := "roleId_example" // string | The identifier of the role. + role := *openapiclient.NewRole("Name_example", []openapiclient.PermissionObject{*openapiclient.NewPermissionObject("documents:read", false, false, false)}) // Role | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.RolesAPI.UpdateRole(context.Background(), roleId).Role(role).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `RolesAPI.UpdateRole``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UpdateRole`: Role + fmt.Fprintf(os.Stdout, "Response from `RolesAPI.UpdateRole`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**roleId** | **string** | The identifier of the role. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateRoleRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **role** | [**Role**](Role.md) | | + +### Return type + +[**Role**](Role.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/links+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/docs/ServiceClientsAPI.md b/docs/ServiceClientsAPI.md new file mode 100644 index 0000000..aa7813a --- /dev/null +++ b/docs/ServiceClientsAPI.md @@ -0,0 +1,502 @@ +# \ServiceClientsAPI + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateClient**](ServiceClientsAPI.md#CreateClient) | **Post** /v1/clients | Create service client +[**DeleteAccessKey**](ServiceClientsAPI.md#DeleteAccessKey) | **Delete** /v1/clients/{clientId}/access-keys/{keyId} | Delete service client access key +[**DeleteClient**](ServiceClientsAPI.md#DeleteClient) | **Delete** /v1/clients/{clientId} | Delete service client +[**GetClient**](ServiceClientsAPI.md#GetClient) | **Get** /v1/clients/{clientId} | Retrieve service client +[**GetClients**](ServiceClientsAPI.md#GetClients) | **Get** /v1/clients | List service clients +[**RequestAccessKey**](ServiceClientsAPI.md#RequestAccessKey) | **Post** /v1/clients/{clientId}/access-keys | Generate service client access key +[**UpdateClient**](ServiceClientsAPI.md#UpdateClient) | **Put** /v1/clients/{clientId} | Update service client + + + +## CreateClient + +> Client CreateClient(ctx).Client(client).Execute() + +Create service client + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + "time" + openapiclient "//" +) + +func main() { + client := *openapiclient.NewClient("ClientId_example", time.Now()) // Client | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ServiceClientsAPI.CreateClient(context.Background()).Client(client).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ServiceClientsAPI.CreateClient``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateClient`: Client + fmt.Fprintf(os.Stdout, "Response from `ServiceClientsAPI.CreateClient`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateClientRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **client** | [**Client**](Client.md) | | + +### Return type + +[**Client**](Client.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/links+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) + + +## DeleteAccessKey + +> DeleteAccessKey(ctx, clientId, keyId).Execute() + +Delete service client access key + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + clientId := "clientId_example" // string | The unique identifier of the client. + keyId := "keyId_example" // string | The ID of the access key to remove from the client. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.ServiceClientsAPI.DeleteAccessKey(context.Background(), clientId, keyId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ServiceClientsAPI.DeleteAccessKey``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**clientId** | **string** | The unique identifier of the client. | +**keyId** | **string** | The ID of the access key to remove from the client. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteAccessKeyRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + + (empty response body) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[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) + + +## DeleteClient + +> DeleteClient(ctx, clientId).Execute() + +Delete service client + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + clientId := "clientId_example" // string | The unique identifier for the client. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.ServiceClientsAPI.DeleteClient(context.Background(), clientId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ServiceClientsAPI.DeleteClient``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**clientId** | **string** | The unique identifier for the client. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteClientRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[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) + + +## GetClient + +> Client GetClient(ctx, clientId).Execute() + +Retrieve service client + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + clientId := "clientId_example" // string | The unique identifier for the client. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ServiceClientsAPI.GetClient(context.Background(), clientId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ServiceClientsAPI.GetClient``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetClient`: Client + fmt.Fprintf(os.Stdout, "Response from `ServiceClientsAPI.GetClient`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**clientId** | **string** | The unique identifier for the client. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetClientRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**Client**](Client.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/links+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) + + +## GetClients + +> ClientCollection GetClients(ctx).Limit(limit).Cursor(cursor).Execute() + +List service clients + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + limit := int32(56) // int32 | Max number of results to return (optional) (default to 20) + cursor := "cursor_example" // string | Continuation cursor for paging. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ServiceClientsAPI.GetClients(context.Background()).Limit(limit).Cursor(cursor).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ServiceClientsAPI.GetClients``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetClients`: ClientCollection + fmt.Fprintf(os.Stdout, "Response from `ServiceClientsAPI.GetClients`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetClientsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int32** | Max number of results to return | [default to 20] + **cursor** | **string** | Continuation cursor for paging. | + +### Return type + +[**ClientCollection**](ClientCollection.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/links+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) + + +## RequestAccessKey + +> ClientAccessKey RequestAccessKey(ctx, clientId).Execute() + +Generate service client access key + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + clientId := "clientId_example" // string | The unique identifier of the client. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ServiceClientsAPI.RequestAccessKey(context.Background(), clientId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ServiceClientsAPI.RequestAccessKey``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `RequestAccessKey`: ClientAccessKey + fmt.Fprintf(os.Stdout, "Response from `ServiceClientsAPI.RequestAccessKey`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**clientId** | **string** | The unique identifier of the client. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiRequestAccessKeyRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**ClientAccessKey**](ClientAccessKey.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/links+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) + + +## UpdateClient + +> Client UpdateClient(ctx, clientId).Client(client).Execute() + +Update service client + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + "time" + openapiclient "//" +) + +func main() { + clientId := "clientId_example" // string | The unique identifier for the client. + client := *openapiclient.NewClient("ClientId_example", time.Now()) // Client | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ServiceClientsAPI.UpdateClient(context.Background(), clientId).Client(client).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ServiceClientsAPI.UpdateClient``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UpdateClient`: Client + fmt.Fprintf(os.Stdout, "Response from `ServiceClientsAPI.UpdateClient`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**clientId** | **string** | The unique identifier for the client. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateClientRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **client** | [**Client**](Client.md) | | + +### Return type + +[**Client**](Client.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/links+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/docs/Statement.md b/docs/Statement.md new file mode 100644 index 0000000..9f4f13c --- /dev/null +++ b/docs/Statement.md @@ -0,0 +1,124 @@ +# Statement + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Roles** | **[]string** | | +**Resources** | [**[]Resource**](Resource.md) | | +**Users** | Pointer to [**[]User**](User.md) | The list of users this statement applies to. Users and groups can be set at either the statement level or the record level, but not both. | [optional] +**Groups** | Pointer to [**[]LinkedGroup**](LinkedGroup.md) | The list of groups this statement applies to. Users in these groups will be receive access to the resources listed. Users and groups can be set at either the statement level or the record level, but not both. | [optional] + +## Methods + +### NewStatement + +`func NewStatement(roles []string, resources []Resource, ) *Statement` + +NewStatement instantiates a new Statement object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewStatementWithDefaults + +`func NewStatementWithDefaults() *Statement` + +NewStatementWithDefaults instantiates a new Statement object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetRoles + +`func (o *Statement) GetRoles() []string` + +GetRoles returns the Roles field if non-nil, zero value otherwise. + +### GetRolesOk + +`func (o *Statement) GetRolesOk() (*[]string, bool)` + +GetRolesOk returns a tuple with the Roles field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRoles + +`func (o *Statement) SetRoles(v []string)` + +SetRoles sets Roles field to given value. + + +### GetResources + +`func (o *Statement) GetResources() []Resource` + +GetResources returns the Resources field if non-nil, zero value otherwise. + +### GetResourcesOk + +`func (o *Statement) GetResourcesOk() (*[]Resource, bool)` + +GetResourcesOk returns a tuple with the Resources field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetResources + +`func (o *Statement) SetResources(v []Resource)` + +SetResources sets Resources field to given value. + + +### GetUsers + +`func (o *Statement) GetUsers() []User` + +GetUsers returns the Users field if non-nil, zero value otherwise. + +### GetUsersOk + +`func (o *Statement) GetUsersOk() (*[]User, bool)` + +GetUsersOk returns a tuple with the Users field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsers + +`func (o *Statement) SetUsers(v []User)` + +SetUsers sets Users field to given value. + +### HasUsers + +`func (o *Statement) HasUsers() bool` + +HasUsers returns a boolean if a field has been set. + +### GetGroups + +`func (o *Statement) GetGroups() []LinkedGroup` + +GetGroups returns the Groups field if non-nil, zero value otherwise. + +### GetGroupsOk + +`func (o *Statement) GetGroupsOk() (*[]LinkedGroup, bool)` + +GetGroupsOk returns a tuple with the Groups field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGroups + +`func (o *Statement) SetGroups(v []LinkedGroup)` + +SetGroups sets Groups field to given value. + +### HasGroups + +`func (o *Statement) HasGroups() bool` + +HasGroups returns a boolean if a field has been set. + + +[[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/docs/Tenant.md b/docs/Tenant.md new file mode 100644 index 0000000..e21de4b --- /dev/null +++ b/docs/Tenant.md @@ -0,0 +1,190 @@ +# Tenant + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TenantId** | Pointer to **NullableString** | | [optional] +**TenantLookupIdentifier** | Pointer to **NullableString** | | [optional] +**Data** | Pointer to [**TenantData**](TenantData.md) | | [optional] +**Connection** | Pointer to [**NullableTenantConnection**](TenantConnection.md) | | [optional] +**CreatedTime** | Pointer to **time.Time** | | [optional] [readonly] + +## Methods + +### NewTenant + +`func NewTenant() *Tenant` + +NewTenant instantiates a new Tenant object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewTenantWithDefaults + +`func NewTenantWithDefaults() *Tenant` + +NewTenantWithDefaults instantiates a new Tenant object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTenantId + +`func (o *Tenant) GetTenantId() string` + +GetTenantId returns the TenantId field if non-nil, zero value otherwise. + +### GetTenantIdOk + +`func (o *Tenant) GetTenantIdOk() (*string, bool)` + +GetTenantIdOk returns a tuple with the TenantId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTenantId + +`func (o *Tenant) SetTenantId(v string)` + +SetTenantId sets TenantId field to given value. + +### HasTenantId + +`func (o *Tenant) HasTenantId() bool` + +HasTenantId returns a boolean if a field has been set. + +### SetTenantIdNil + +`func (o *Tenant) SetTenantIdNil(b bool)` + + SetTenantIdNil sets the value for TenantId to be an explicit nil + +### UnsetTenantId +`func (o *Tenant) UnsetTenantId()` + +UnsetTenantId ensures that no value is present for TenantId, not even an explicit nil +### GetTenantLookupIdentifier + +`func (o *Tenant) GetTenantLookupIdentifier() string` + +GetTenantLookupIdentifier returns the TenantLookupIdentifier field if non-nil, zero value otherwise. + +### GetTenantLookupIdentifierOk + +`func (o *Tenant) GetTenantLookupIdentifierOk() (*string, bool)` + +GetTenantLookupIdentifierOk returns a tuple with the TenantLookupIdentifier field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTenantLookupIdentifier + +`func (o *Tenant) SetTenantLookupIdentifier(v string)` + +SetTenantLookupIdentifier sets TenantLookupIdentifier field to given value. + +### HasTenantLookupIdentifier + +`func (o *Tenant) HasTenantLookupIdentifier() bool` + +HasTenantLookupIdentifier returns a boolean if a field has been set. + +### SetTenantLookupIdentifierNil + +`func (o *Tenant) SetTenantLookupIdentifierNil(b bool)` + + SetTenantLookupIdentifierNil sets the value for TenantLookupIdentifier to be an explicit nil + +### UnsetTenantLookupIdentifier +`func (o *Tenant) UnsetTenantLookupIdentifier()` + +UnsetTenantLookupIdentifier ensures that no value is present for TenantLookupIdentifier, not even an explicit nil +### GetData + +`func (o *Tenant) GetData() TenantData` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *Tenant) GetDataOk() (*TenantData, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *Tenant) SetData(v TenantData)` + +SetData sets Data field to given value. + +### HasData + +`func (o *Tenant) HasData() bool` + +HasData returns a boolean if a field has been set. + +### GetConnection + +`func (o *Tenant) GetConnection() TenantConnection` + +GetConnection returns the Connection field if non-nil, zero value otherwise. + +### GetConnectionOk + +`func (o *Tenant) GetConnectionOk() (*TenantConnection, bool)` + +GetConnectionOk returns a tuple with the Connection field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetConnection + +`func (o *Tenant) SetConnection(v TenantConnection)` + +SetConnection sets Connection field to given value. + +### HasConnection + +`func (o *Tenant) HasConnection() bool` + +HasConnection returns a boolean if a field has been set. + +### SetConnectionNil + +`func (o *Tenant) SetConnectionNil(b bool)` + + SetConnectionNil sets the value for Connection to be an explicit nil + +### UnsetConnection +`func (o *Tenant) UnsetConnection()` + +UnsetConnection ensures that no value is present for Connection, not even an explicit nil +### GetCreatedTime + +`func (o *Tenant) GetCreatedTime() time.Time` + +GetCreatedTime returns the CreatedTime field if non-nil, zero value otherwise. + +### GetCreatedTimeOk + +`func (o *Tenant) GetCreatedTimeOk() (*time.Time, bool)` + +GetCreatedTimeOk returns a tuple with the CreatedTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedTime + +`func (o *Tenant) SetCreatedTime(v time.Time)` + +SetCreatedTime sets CreatedTime field to given value. + +### HasCreatedTime + +`func (o *Tenant) HasCreatedTime() bool` + +HasCreatedTime returns a boolean if a field has been set. + + +[[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/docs/TenantCollection.md b/docs/TenantCollection.md new file mode 100644 index 0000000..9248a2d --- /dev/null +++ b/docs/TenantCollection.md @@ -0,0 +1,77 @@ +# TenantCollection + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Tenants** | [**[]Tenant**](Tenant.md) | | +**Pagination** | Pointer to [**Pagination**](Pagination.md) | | [optional] + +## Methods + +### NewTenantCollection + +`func NewTenantCollection(tenants []Tenant, ) *TenantCollection` + +NewTenantCollection instantiates a new TenantCollection object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewTenantCollectionWithDefaults + +`func NewTenantCollectionWithDefaults() *TenantCollection` + +NewTenantCollectionWithDefaults instantiates a new TenantCollection object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTenants + +`func (o *TenantCollection) GetTenants() []Tenant` + +GetTenants returns the Tenants field if non-nil, zero value otherwise. + +### GetTenantsOk + +`func (o *TenantCollection) GetTenantsOk() (*[]Tenant, bool)` + +GetTenantsOk returns a tuple with the Tenants field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTenants + +`func (o *TenantCollection) SetTenants(v []Tenant)` + +SetTenants sets Tenants field to given value. + + +### GetPagination + +`func (o *TenantCollection) GetPagination() Pagination` + +GetPagination returns the Pagination field if non-nil, zero value otherwise. + +### GetPaginationOk + +`func (o *TenantCollection) GetPaginationOk() (*Pagination, bool)` + +GetPaginationOk returns a tuple with the Pagination field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPagination + +`func (o *TenantCollection) SetPagination(v Pagination)` + +SetPagination sets Pagination field to given value. + +### HasPagination + +`func (o *TenantCollection) HasPagination() bool` + +HasPagination returns a boolean if a field has been set. + + +[[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/docs/TenantConnection.md b/docs/TenantConnection.md new file mode 100644 index 0000000..7396929 --- /dev/null +++ b/docs/TenantConnection.md @@ -0,0 +1,66 @@ +# TenantConnection + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ConnectionId** | Pointer to **NullableString** | | [optional] + +## Methods + +### NewTenantConnection + +`func NewTenantConnection() *TenantConnection` + +NewTenantConnection instantiates a new TenantConnection object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewTenantConnectionWithDefaults + +`func NewTenantConnectionWithDefaults() *TenantConnection` + +NewTenantConnectionWithDefaults instantiates a new TenantConnection object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetConnectionId + +`func (o *TenantConnection) GetConnectionId() string` + +GetConnectionId returns the ConnectionId field if non-nil, zero value otherwise. + +### GetConnectionIdOk + +`func (o *TenantConnection) GetConnectionIdOk() (*string, bool)` + +GetConnectionIdOk returns a tuple with the ConnectionId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetConnectionId + +`func (o *TenantConnection) SetConnectionId(v string)` + +SetConnectionId sets ConnectionId field to given value. + +### HasConnectionId + +`func (o *TenantConnection) HasConnectionId() bool` + +HasConnectionId returns a boolean if a field has been set. + +### SetConnectionIdNil + +`func (o *TenantConnection) SetConnectionIdNil(b bool)` + + SetConnectionIdNil sets the value for ConnectionId to be an explicit nil + +### UnsetConnectionId +`func (o *TenantConnection) UnsetConnectionId()` + +UnsetConnectionId ensures that no value is present for ConnectionId, not even an explicit nil + +[[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/docs/TenantData.md b/docs/TenantData.md new file mode 100644 index 0000000..5ac68d0 --- /dev/null +++ b/docs/TenantData.md @@ -0,0 +1,66 @@ +# TenantData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | Pointer to **NullableString** | | [optional] + +## Methods + +### NewTenantData + +`func NewTenantData() *TenantData` + +NewTenantData instantiates a new TenantData object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewTenantDataWithDefaults + +`func NewTenantDataWithDefaults() *TenantData` + +NewTenantDataWithDefaults instantiates a new TenantData object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *TenantData) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *TenantData) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *TenantData) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *TenantData) HasName() bool` + +HasName returns a boolean if a field has been set. + +### SetNameNil + +`func (o *TenantData) SetNameNil(b bool)` + + SetNameNil sets the value for Name to be an explicit nil + +### UnsetName +`func (o *TenantData) UnsetName()` + +UnsetName ensures that no value is present for Name, not even an explicit nil + +[[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/docs/TenantsAPI.md b/docs/TenantsAPI.md new file mode 100644 index 0000000..7b58050 --- /dev/null +++ b/docs/TenantsAPI.md @@ -0,0 +1,350 @@ +# \TenantsAPI + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateTenant**](TenantsAPI.md#CreateTenant) | **Post** /v1/tenants | Create tenant +[**DeleteTenant**](TenantsAPI.md#DeleteTenant) | **Delete** /v1/tenants/{tenantId} | Delete tenant +[**GetTenant**](TenantsAPI.md#GetTenant) | **Get** /v1/tenants/{tenantId} | Retrieve tenant +[**GetTenants**](TenantsAPI.md#GetTenants) | **Get** /v1/tenants | List tenants +[**UpdateTenant**](TenantsAPI.md#UpdateTenant) | **Put** /v1/tenants/{tenantId} | Update tenant + + + +## CreateTenant + +> Tenant CreateTenant(ctx).Tenant(tenant).Execute() + +Create tenant + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + tenant := *openapiclient.NewTenant() // Tenant | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.TenantsAPI.CreateTenant(context.Background()).Tenant(tenant).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TenantsAPI.CreateTenant``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateTenant`: Tenant + fmt.Fprintf(os.Stdout, "Response from `TenantsAPI.CreateTenant`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateTenantRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tenant** | [**Tenant**](Tenant.md) | | + +### Return type + +[**Tenant**](Tenant.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/links+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) + + +## DeleteTenant + +> DeleteTenant(ctx, tenantId).Execute() + +Delete tenant + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + tenantId := TODO // TenantId | The tenantId. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.TenantsAPI.DeleteTenant(context.Background(), tenantId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TenantsAPI.DeleteTenant``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**tenantId** | [**TenantId**](.md) | The tenantId. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteTenantRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[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) + + +## GetTenant + +> Tenant GetTenant(ctx, tenantId).Execute() + +Retrieve tenant + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + tenantId := TODO // TenantId | The tenantId. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.TenantsAPI.GetTenant(context.Background(), tenantId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TenantsAPI.GetTenant``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetTenant`: Tenant + fmt.Fprintf(os.Stdout, "Response from `TenantsAPI.GetTenant`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**tenantId** | [**TenantId**](.md) | The tenantId. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetTenantRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**Tenant**](Tenant.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/links+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) + + +## GetTenants + +> TenantCollection GetTenants(ctx).Execute() + +List tenants + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.TenantsAPI.GetTenants(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TenantsAPI.GetTenants``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetTenants`: TenantCollection + fmt.Fprintf(os.Stdout, "Response from `TenantsAPI.GetTenants`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetTenantsRequest struct via the builder pattern + + +### Return type + +[**TenantCollection**](TenantCollection.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/links+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) + + +## UpdateTenant + +> Tenant UpdateTenant(ctx, tenantId).Tenant(tenant).Execute() + +Update tenant + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + tenantId := TODO // TenantId | The tenantId. + tenant := *openapiclient.NewTenant() // Tenant | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.TenantsAPI.UpdateTenant(context.Background(), tenantId).Tenant(tenant).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TenantsAPI.UpdateTenant``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UpdateTenant`: Tenant + fmt.Fprintf(os.Stdout, "Response from `TenantsAPI.UpdateTenant`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**tenantId** | [**TenantId**](.md) | The tenantId. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateTenantRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **tenant** | [**Tenant**](Tenant.md) | | + +### Return type + +[**Tenant**](Tenant.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/links+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/docs/TokenRequest.md b/docs/TokenRequest.md new file mode 100644 index 0000000..d6e8dd0 --- /dev/null +++ b/docs/TokenRequest.md @@ -0,0 +1,72 @@ +# TokenRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Statements** | [**[]Statement**](Statement.md) | A list of statements which match roles to resources. The token will have all statements apply to it. | +**Expires** | **time.Time** | The ISO8601 datetime when the token will expire. Default is 24 hours from now. | + +## Methods + +### NewTokenRequest + +`func NewTokenRequest(statements []Statement, expires time.Time, ) *TokenRequest` + +NewTokenRequest instantiates a new TokenRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewTokenRequestWithDefaults + +`func NewTokenRequestWithDefaults() *TokenRequest` + +NewTokenRequestWithDefaults instantiates a new TokenRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetStatements + +`func (o *TokenRequest) GetStatements() []Statement` + +GetStatements returns the Statements field if non-nil, zero value otherwise. + +### GetStatementsOk + +`func (o *TokenRequest) GetStatementsOk() (*[]Statement, bool)` + +GetStatementsOk returns a tuple with the Statements field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatements + +`func (o *TokenRequest) SetStatements(v []Statement)` + +SetStatements sets Statements field to given value. + + +### GetExpires + +`func (o *TokenRequest) GetExpires() time.Time` + +GetExpires returns the Expires field if non-nil, zero value otherwise. + +### GetExpiresOk + +`func (o *TokenRequest) GetExpiresOk() (*time.Time, bool)` + +GetExpiresOk returns a tuple with the Expires field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExpires + +`func (o *TokenRequest) SetExpires(v time.Time)` + +SetExpires sets Expires field to given value. + + + +[[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/docs/User.md b/docs/User.md new file mode 100644 index 0000000..5310473 --- /dev/null +++ b/docs/User.md @@ -0,0 +1,51 @@ +# User + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**UserId** | **string** | | + +## Methods + +### NewUser + +`func NewUser(userId string, ) *User` + +NewUser instantiates a new User object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUserWithDefaults + +`func NewUserWithDefaults() *User` + +NewUserWithDefaults instantiates a new User object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetUserId + +`func (o *User) GetUserId() string` + +GetUserId returns the UserId field if non-nil, zero value otherwise. + +### GetUserIdOk + +`func (o *User) GetUserIdOk() (*string, bool)` + +GetUserIdOk returns a tuple with the UserId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserId + +`func (o *User) SetUserId(v string)` + +SetUserId sets UserId field to given value. + + + +[[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/docs/UserConnectionCredentials.md b/docs/UserConnectionCredentials.md new file mode 100644 index 0000000..59f59a0 --- /dev/null +++ b/docs/UserConnectionCredentials.md @@ -0,0 +1,51 @@ +# UserConnectionCredentials + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AccessToken** | **string** | The access token. | + +## Methods + +### NewUserConnectionCredentials + +`func NewUserConnectionCredentials(accessToken string, ) *UserConnectionCredentials` + +NewUserConnectionCredentials instantiates a new UserConnectionCredentials object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUserConnectionCredentialsWithDefaults + +`func NewUserConnectionCredentialsWithDefaults() *UserConnectionCredentials` + +NewUserConnectionCredentialsWithDefaults instantiates a new UserConnectionCredentials object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAccessToken + +`func (o *UserConnectionCredentials) GetAccessToken() string` + +GetAccessToken returns the AccessToken field if non-nil, zero value otherwise. + +### GetAccessTokenOk + +`func (o *UserConnectionCredentials) GetAccessTokenOk() (*string, bool)` + +GetAccessTokenOk returns a tuple with the AccessToken field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccessToken + +`func (o *UserConnectionCredentials) SetAccessToken(v string)` + +SetAccessToken sets AccessToken field to given value. + + + +[[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/docs/UserIdentity.md b/docs/UserIdentity.md new file mode 100644 index 0000000..51f36fe --- /dev/null +++ b/docs/UserIdentity.md @@ -0,0 +1,129 @@ +# UserIdentity + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**UserId** | **string** | The user identifier. | +**Name** | Pointer to **string** | The user's formatted display name. | [optional] +**Picture** | Pointer to **string** | A url that resolves to a picture that can be rendered. | [optional] +**Email** | Pointer to **string** | The user's verified email address sourced from their SSO IdP. | [optional] + +## Methods + +### NewUserIdentity + +`func NewUserIdentity(userId string, ) *UserIdentity` + +NewUserIdentity instantiates a new UserIdentity object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUserIdentityWithDefaults + +`func NewUserIdentityWithDefaults() *UserIdentity` + +NewUserIdentityWithDefaults instantiates a new UserIdentity object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetUserId + +`func (o *UserIdentity) GetUserId() string` + +GetUserId returns the UserId field if non-nil, zero value otherwise. + +### GetUserIdOk + +`func (o *UserIdentity) GetUserIdOk() (*string, bool)` + +GetUserIdOk returns a tuple with the UserId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserId + +`func (o *UserIdentity) SetUserId(v string)` + +SetUserId sets UserId field to given value. + + +### GetName + +`func (o *UserIdentity) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *UserIdentity) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *UserIdentity) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *UserIdentity) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetPicture + +`func (o *UserIdentity) GetPicture() string` + +GetPicture returns the Picture field if non-nil, zero value otherwise. + +### GetPictureOk + +`func (o *UserIdentity) GetPictureOk() (*string, bool)` + +GetPictureOk returns a tuple with the Picture field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPicture + +`func (o *UserIdentity) SetPicture(v string)` + +SetPicture sets Picture field to given value. + +### HasPicture + +`func (o *UserIdentity) HasPicture() bool` + +HasPicture returns a boolean if a field has been set. + +### GetEmail + +`func (o *UserIdentity) GetEmail() string` + +GetEmail returns the Email field if non-nil, zero value otherwise. + +### GetEmailOk + +`func (o *UserIdentity) GetEmailOk() (*string, bool)` + +GetEmailOk returns a tuple with the Email field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEmail + +`func (o *UserIdentity) SetEmail(v string)` + +SetEmail sets Email field to given value. + +### HasEmail + +`func (o *UserIdentity) HasEmail() bool` + +HasEmail returns a boolean if a field has been set. + + +[[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/docs/UserIdentityCollection.md b/docs/UserIdentityCollection.md new file mode 100644 index 0000000..ebf3df3 --- /dev/null +++ b/docs/UserIdentityCollection.md @@ -0,0 +1,98 @@ +# UserIdentityCollection + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Users** | [**[]UserIdentity**](UserIdentity.md) | A list of users | +**Pagination** | Pointer to [**Pagination**](Pagination.md) | | [optional] +**Links** | [**CollectionLinks**](CollectionLinks.md) | | + +## Methods + +### NewUserIdentityCollection + +`func NewUserIdentityCollection(users []UserIdentity, links CollectionLinks, ) *UserIdentityCollection` + +NewUserIdentityCollection instantiates a new UserIdentityCollection object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUserIdentityCollectionWithDefaults + +`func NewUserIdentityCollectionWithDefaults() *UserIdentityCollection` + +NewUserIdentityCollectionWithDefaults instantiates a new UserIdentityCollection object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetUsers + +`func (o *UserIdentityCollection) GetUsers() []UserIdentity` + +GetUsers returns the Users field if non-nil, zero value otherwise. + +### GetUsersOk + +`func (o *UserIdentityCollection) GetUsersOk() (*[]UserIdentity, bool)` + +GetUsersOk returns a tuple with the Users field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsers + +`func (o *UserIdentityCollection) SetUsers(v []UserIdentity)` + +SetUsers sets Users field to given value. + + +### GetPagination + +`func (o *UserIdentityCollection) GetPagination() Pagination` + +GetPagination returns the Pagination field if non-nil, zero value otherwise. + +### GetPaginationOk + +`func (o *UserIdentityCollection) GetPaginationOk() (*Pagination, bool)` + +GetPaginationOk returns a tuple with the Pagination field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPagination + +`func (o *UserIdentityCollection) SetPagination(v Pagination)` + +SetPagination sets Pagination field to given value. + +### HasPagination + +`func (o *UserIdentityCollection) HasPagination() bool` + +HasPagination returns a boolean if a field has been set. + +### GetLinks + +`func (o *UserIdentityCollection) GetLinks() CollectionLinks` + +GetLinks returns the Links field if non-nil, zero value otherwise. + +### GetLinksOk + +`func (o *UserIdentityCollection) GetLinksOk() (*CollectionLinks, bool)` + +GetLinksOk returns a tuple with the Links field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLinks + +`func (o *UserIdentityCollection) SetLinks(v CollectionLinks)` + +SetLinks sets Links field to given value. + + + +[[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/docs/UserPermissionsAPI.md b/docs/UserPermissionsAPI.md new file mode 100644 index 0000000..5c19040 --- /dev/null +++ b/docs/UserPermissionsAPI.md @@ -0,0 +1,312 @@ +# \UserPermissionsAPI + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AuthorizeUser**](UserPermissionsAPI.md#AuthorizeUser) | **Get** /v1/users/{userId}/resources/{resourceUri}/permissions/{permission} | Verify user authorization +[**GetUserPermissionsForResource**](UserPermissionsAPI.md#GetUserPermissionsForResource) | **Get** /v1/users/{userId}/resources/{resourceUri}/permissions | Get user permissions for resource +[**GetUserResources**](UserPermissionsAPI.md#GetUserResources) | **Get** /v1/users/{userId}/resources | List user resources +[**GetUserRolesForResource**](UserPermissionsAPI.md#GetUserRolesForResource) | **Get** /v1/users/{userId}/resources/{resourceUri}/roles | Get user roles for resource + + + +## AuthorizeUser + +> AuthorizeUser(ctx, userId, resourceUri, permission).Execute() + +Verify user authorization + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + userId := TODO // UserId | The user identifier to check and verify the permissions of. + resourceUri := "/organizations/org_a/documents/doc_1" // string | The uri path of a resource to validate, must be URL encoded, uri segments are allowed, the resource must be a full path. + permission := TODO // Action | Permission to check, '*' and scoped permissions can also be checked here. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.UserPermissionsAPI.AuthorizeUser(context.Background(), userId, resourceUri, permission).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UserPermissionsAPI.AuthorizeUser``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**userId** | [**UserId**](.md) | The user identifier to check and verify the permissions of. | +**resourceUri** | **string** | The uri path of a resource to validate, must be URL encoded, uri segments are allowed, the resource must be a full path. | +**permission** | [**Action**](.md) | Permission to check, '*' and scoped permissions can also be checked here. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiAuthorizeUserRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + +### Return type + + (empty response body) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[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) + + +## GetUserPermissionsForResource + +> PermissionCollection GetUserPermissionsForResource(ctx, userId, resourceUri).Execute() + +Get user permissions for resource + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + userId := TODO // UserId | The user identifier for the user to check permissions. + resourceUri := "/organizations/org_a/documents/doc_1" // string | The uri path of a resource to validate, must be URL encoded, uri segments are allowed. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UserPermissionsAPI.GetUserPermissionsForResource(context.Background(), userId, resourceUri).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UserPermissionsAPI.GetUserPermissionsForResource``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetUserPermissionsForResource`: PermissionCollection + fmt.Fprintf(os.Stdout, "Response from `UserPermissionsAPI.GetUserPermissionsForResource`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**userId** | [**UserId**](.md) | The user identifier for the user to check permissions. | +**resourceUri** | **string** | The uri path of a resource to validate, must be URL encoded, uri segments are allowed. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetUserPermissionsForResourceRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + +[**PermissionCollection**](PermissionCollection.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/links+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) + + +## GetUserResources + +> UserResourcesCollection GetUserResources(ctx, userId).ResourceUri(resourceUri).CollectionConfiguration(collectionConfiguration).Permissions(permissions).Limit(limit).Cursor(cursor).Execute() + +List user resources + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "//" +) + +func main() { + userId := TODO // UserId | The user identifier for which to list all accessible resources. + resourceUri := "/organizations" // string | The top level uri path of a resource to query for. Will only match explicit or nested sub-resources. Will not partial match resource names. (optional) + collectionConfiguration := "collectionConfiguration_example" // string | `TOP_LEVEL_ONLY` - returns only directly nested resources under the resourceUri. A query to `resourceUri=Collection` will return `Collection/resource_1`.
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" + "time" +) + + +// AccessRecordsAPIService AccessRecordsAPI service +type AccessRecordsAPIService service + +type ApiCreateClaimRequest struct { + ctx context.Context + ApiService *AccessRecordsAPIService + claimRequest *ClaimRequest +} + +func (r ApiCreateClaimRequest) ClaimRequest(claimRequest ClaimRequest) ApiCreateClaimRequest { + r.claimRequest = &claimRequest + return r +} + +func (r ApiCreateClaimRequest) Execute() (map[string]interface{}, *http.Response, error) { + return r.ApiService.CreateClaimExecute(r) +} + +/* +CreateClaim Create resource Claim + +Claim a resource by allowing a user to pick an identifier and receive admin access to that resource if it hasn't already been claimed. This only works for resources specifically marked as CLAIM. The result will be a new access record listing that user as the admin for this resource. The resourceUri will be appended to the collection resource uri using a `/` (forward slash) automatically. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateClaimRequest +*/ +func (a *AccessRecordsAPIService) CreateClaim(ctx context.Context) ApiCreateClaimRequest { + return ApiCreateClaimRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return map[string]interface{} +func (a *AccessRecordsAPIService) CreateClaimExecute(r ApiCreateClaimRequest) (map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AccessRecordsAPIService.CreateClaim") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/claims" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.claimRequest == nil { + return localVarReturnValue, nil, reportError("claimRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.claimRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCreateRecordRequest struct { + ctx context.Context + ApiService *AccessRecordsAPIService + accessRecord *AccessRecord +} + +func (r ApiCreateRecordRequest) AccessRecord(accessRecord AccessRecord) ApiCreateRecordRequest { + r.accessRecord = &accessRecord + return r +} + +func (r ApiCreateRecordRequest) Execute() (*AccessRecord, *http.Response, error) { + return r.ApiService.CreateRecordExecute(r) +} + +/* +CreateRecord Create access record + +Specify user roles for specific resources. (Records have a maximum size of ~100KB) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateRecordRequest +*/ +func (a *AccessRecordsAPIService) CreateRecord(ctx context.Context) ApiCreateRecordRequest { + return ApiCreateRecordRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return AccessRecord +func (a *AccessRecordsAPIService) CreateRecordExecute(r ApiCreateRecordRequest) (*AccessRecord, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AccessRecord + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AccessRecordsAPIService.CreateRecord") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/records" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.accessRecord == nil { + return localVarReturnValue, nil, reportError("accessRecord is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.accessRecord + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCreateRequestRequest struct { + ctx context.Context + ApiService *AccessRecordsAPIService + accessRequest *AccessRequest +} + +func (r ApiCreateRequestRequest) AccessRequest(accessRequest AccessRequest) ApiCreateRequestRequest { + r.accessRequest = &accessRequest + return r +} + +func (r ApiCreateRequestRequest) Execute() (*AccessRequest, *http.Response, error) { + return r.ApiService.CreateRequestExecute(r) +} + +/* +CreateRequest Create access request + +Specify a request in the form of an access record that an admin can approve. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateRequestRequest +*/ +func (a *AccessRecordsAPIService) CreateRequest(ctx context.Context) ApiCreateRequestRequest { + return ApiCreateRequestRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return AccessRequest +func (a *AccessRecordsAPIService) CreateRequestExecute(r ApiCreateRequestRequest) (*AccessRequest, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AccessRequest + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AccessRecordsAPIService.CreateRequest") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/requests" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.accessRequest == nil { + return localVarReturnValue, nil, reportError("accessRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.accessRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDeleteRecordRequest struct { + ctx context.Context + ApiService *AccessRecordsAPIService + recordId string +} + +func (r ApiDeleteRecordRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteRecordExecute(r) +} + +/* +DeleteRecord Deletes access record + +Remove an access record, removing associated permissions from all users in record. If a user has a permission from another record, that permission will not be removed. (Note: This disables the record by changing the status to DELETED but not completely remove the record for tracking purposes. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param recordId The identifier of the access record. + @return ApiDeleteRecordRequest +*/ +func (a *AccessRecordsAPIService) DeleteRecord(ctx context.Context, recordId string) ApiDeleteRecordRequest { + return ApiDeleteRecordRequest{ + ApiService: a, + ctx: ctx, + recordId: recordId, + } +} + +// Execute executes the request +func (a *AccessRecordsAPIService) DeleteRecordExecute(r ApiDeleteRecordRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AccessRecordsAPIService.DeleteRecord") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/records/{recordId}" + localVarPath = strings.Replace(localVarPath, "{"+"recordId"+"}", url.PathEscape(parameterValueToString(r.recordId, "recordId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.recordId) < 1 { + return nil, reportError("recordId must have at least 1 elements") + } + if strlen(r.recordId) > 100 { + return nil, reportError("recordId must have less than 100 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDeleteRequestRequest struct { + ctx context.Context + ApiService *AccessRecordsAPIService + requestId string +} + +func (r ApiDeleteRequestRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteRequestExecute(r) +} + +/* +DeleteRequest Deletes access request + +Remove an access request. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param requestId The identifier of the access request. + @return ApiDeleteRequestRequest +*/ +func (a *AccessRecordsAPIService) DeleteRequest(ctx context.Context, requestId string) ApiDeleteRequestRequest { + return ApiDeleteRequestRequest{ + ApiService: a, + ctx: ctx, + requestId: requestId, + } +} + +// Execute executes the request +func (a *AccessRecordsAPIService) DeleteRequestExecute(r ApiDeleteRequestRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AccessRecordsAPIService.DeleteRequest") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/requests/{requestId}" + localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.requestId) < 1 { + return nil, reportError("requestId must have at least 1 elements") + } + if strlen(r.requestId) > 100 { + return nil, reportError("requestId must have less than 100 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiGetRecordRequest struct { + ctx context.Context + ApiService *AccessRecordsAPIService + recordId string +} + +func (r ApiGetRecordRequest) Execute() (*AccessRecord, *http.Response, error) { + return r.ApiService.GetRecordExecute(r) +} + +/* +GetRecord Retrieve access record + +Access records contain information assigning permissions to users for resources. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param recordId The identifier of the access record. + @return ApiGetRecordRequest +*/ +func (a *AccessRecordsAPIService) GetRecord(ctx context.Context, recordId string) ApiGetRecordRequest { + return ApiGetRecordRequest{ + ApiService: a, + ctx: ctx, + recordId: recordId, + } +} + +// Execute executes the request +// @return AccessRecord +func (a *AccessRecordsAPIService) GetRecordExecute(r ApiGetRecordRequest) (*AccessRecord, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AccessRecord + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AccessRecordsAPIService.GetRecord") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/records/{recordId}" + localVarPath = strings.Replace(localVarPath, "{"+"recordId"+"}", url.PathEscape(parameterValueToString(r.recordId, "recordId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.recordId) < 1 { + return localVarReturnValue, nil, reportError("recordId must have at least 1 elements") + } + if strlen(r.recordId) > 100 { + return localVarReturnValue, nil, reportError("recordId must have less than 100 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetRecordsRequest struct { + ctx context.Context + ApiService *AccessRecordsAPIService + limit *int32 + cursor *string + filter *string + status *string +} + +// Max number of results to return +func (r ApiGetRecordsRequest) Limit(limit int32) ApiGetRecordsRequest { + r.limit = &limit + return r +} + +// Continuation cursor for paging +func (r ApiGetRecordsRequest) Cursor(cursor string) ApiGetRecordsRequest { + r.cursor = &cursor + return r +} + +// Filter to search records by. This is a case insensitive search through every text field. +func (r ApiGetRecordsRequest) Filter(filter string) ApiGetRecordsRequest { + r.filter = &filter + return r +} + +// Filter records by their current status. +func (r ApiGetRecordsRequest) Status(status string) ApiGetRecordsRequest { + r.status = &status + return r +} + +func (r ApiGetRecordsRequest) Execute() (*AccessRecordCollection, *http.Response, error) { + return r.ApiService.GetRecordsExecute(r) +} + +/* +GetRecords List access records + +Returns a paginated records list for the account. Only records the user has access to are returned. The results sort order is not stable, on subsequent requests different results may be returned. This query resource is meant for administrative actions only, therefore has a lower rate limit tier than user permissions related resources. Additionally, the results from a query to Access Records may be delayed up to 5 minutes. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetRecordsRequest +*/ +func (a *AccessRecordsAPIService) GetRecords(ctx context.Context) ApiGetRecordsRequest { + return ApiGetRecordsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return AccessRecordCollection +func (a *AccessRecordsAPIService) GetRecordsExecute(r ApiGetRecordsRequest) (*AccessRecordCollection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AccessRecordCollection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AccessRecordsAPIService.GetRecords") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/records" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } else { + var defaultValue int32 = 20 + r.limit = &defaultValue + } + if r.cursor != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cursor", r.cursor, "") + } + if r.filter != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "filter", r.filter, "") + } + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetRequestRequest struct { + ctx context.Context + ApiService *AccessRecordsAPIService + requestId string +} + +func (r ApiGetRequestRequest) Execute() (*AccessRequest, *http.Response, error) { + return r.ApiService.GetRequestExecute(r) +} + +/* +GetRequest Retrieve access request + +Access request contain information requesting permissions for users to resources. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param requestId The identifier of the access request. + @return ApiGetRequestRequest +*/ +func (a *AccessRecordsAPIService) GetRequest(ctx context.Context, requestId string) ApiGetRequestRequest { + return ApiGetRequestRequest{ + ApiService: a, + ctx: ctx, + requestId: requestId, + } +} + +// Execute executes the request +// @return AccessRequest +func (a *AccessRecordsAPIService) GetRequestExecute(r ApiGetRequestRequest) (*AccessRequest, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AccessRequest + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AccessRecordsAPIService.GetRequest") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/requests/{requestId}" + localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.requestId) < 1 { + return localVarReturnValue, nil, reportError("requestId must have at least 1 elements") + } + if strlen(r.requestId) > 100 { + return localVarReturnValue, nil, reportError("requestId must have less than 100 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetRequestsRequest struct { + ctx context.Context + ApiService *AccessRecordsAPIService + limit *int32 + cursor *string + status *string +} + +// Max number of results to return +func (r ApiGetRequestsRequest) Limit(limit int32) ApiGetRequestsRequest { + r.limit = &limit + return r +} + +// Continuation cursor for paging +func (r ApiGetRequestsRequest) Cursor(cursor string) ApiGetRequestsRequest { + r.cursor = &cursor + return r +} + +// Filter requests by their current status. +func (r ApiGetRequestsRequest) Status(status string) ApiGetRequestsRequest { + r.status = &status + return r +} + +func (r ApiGetRequestsRequest) Execute() (*AccessRequestCollection, *http.Response, error) { + return r.ApiService.GetRequestsExecute(r) +} + +/* +GetRequests List access requests + +Returns a paginated request list. Only requests the user has access to are returned. This query resource is meant for administrative actions only, therefore has a lower rate limit tier than user permissions related resources. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetRequestsRequest +*/ +func (a *AccessRecordsAPIService) GetRequests(ctx context.Context) ApiGetRequestsRequest { + return ApiGetRequestsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return AccessRequestCollection +func (a *AccessRecordsAPIService) GetRequestsExecute(r ApiGetRequestsRequest) (*AccessRequestCollection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AccessRequestCollection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AccessRecordsAPIService.GetRequests") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/requests" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } else { + var defaultValue int32 = 20 + r.limit = &defaultValue + } + if r.cursor != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cursor", r.cursor, "") + } + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRespondToAccessRequestRequest struct { + ctx context.Context + ApiService *AccessRecordsAPIService + requestId string + accessRequestResponse *AccessRequestResponse +} + +func (r ApiRespondToAccessRequestRequest) AccessRequestResponse(accessRequestResponse AccessRequestResponse) ApiRespondToAccessRequestRequest { + r.accessRequestResponse = &accessRequestResponse + return r +} + +func (r ApiRespondToAccessRequestRequest) Execute() (*AccessRequest, *http.Response, error) { + return r.ApiService.RespondToAccessRequestExecute(r) +} + +/* +RespondToAccessRequest Approve or deny access request + +Updates an access request, approving it or denying it. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param requestId The identifier of the access request. + @return ApiRespondToAccessRequestRequest +*/ +func (a *AccessRecordsAPIService) RespondToAccessRequest(ctx context.Context, requestId string) ApiRespondToAccessRequestRequest { + return ApiRespondToAccessRequestRequest{ + ApiService: a, + ctx: ctx, + requestId: requestId, + } +} + +// Execute executes the request +// @return AccessRequest +func (a *AccessRecordsAPIService) RespondToAccessRequestExecute(r ApiRespondToAccessRequestRequest) (*AccessRequest, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AccessRequest + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AccessRecordsAPIService.RespondToAccessRequest") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/requests/{requestId}" + localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.requestId) < 1 { + return localVarReturnValue, nil, reportError("requestId must have at least 1 elements") + } + if strlen(r.requestId) > 100 { + return localVarReturnValue, nil, reportError("requestId must have less than 100 elements") + } + if r.accessRequestResponse == nil { + return localVarReturnValue, nil, reportError("accessRequestResponse is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.accessRequestResponse + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUpdateRecordRequest struct { + ctx context.Context + ApiService *AccessRecordsAPIService + recordId string + accessRecord *AccessRecord + ifUnmodifiedSince *time.Time +} + +func (r ApiUpdateRecordRequest) AccessRecord(accessRecord AccessRecord) ApiUpdateRecordRequest { + r.accessRecord = &accessRecord + return r +} + +// The expected last time the record was modified. +func (r ApiUpdateRecordRequest) IfUnmodifiedSince(ifUnmodifiedSince time.Time) ApiUpdateRecordRequest { + r.ifUnmodifiedSince = &ifUnmodifiedSince + return r +} + +func (r ApiUpdateRecordRequest) Execute() (*http.Response, error) { + return r.ApiService.UpdateRecordExecute(r) +} + +/* +UpdateRecord Update access record + +Updates an access record adding or removing user permissions to resources. (Records have a maximum size of ~100KB) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param recordId The identifier of the access record. + @return ApiUpdateRecordRequest +*/ +func (a *AccessRecordsAPIService) UpdateRecord(ctx context.Context, recordId string) ApiUpdateRecordRequest { + return ApiUpdateRecordRequest{ + ApiService: a, + ctx: ctx, + recordId: recordId, + } +} + +// Execute executes the request +func (a *AccessRecordsAPIService) UpdateRecordExecute(r ApiUpdateRecordRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AccessRecordsAPIService.UpdateRecord") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/records/{recordId}" + localVarPath = strings.Replace(localVarPath, "{"+"recordId"+"}", url.PathEscape(parameterValueToString(r.recordId, "recordId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.recordId) < 1 { + return nil, reportError("recordId must have at least 1 elements") + } + if strlen(r.recordId) > 100 { + return nil, reportError("recordId must have less than 100 elements") + } + if r.accessRecord == nil { + return nil, reportError("accessRecord is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ifUnmodifiedSince != nil { + parameterAddToHeaderOrQuery(localVarHeaderParams, "If-Unmodified-Since", r.ifUnmodifiedSince, "") + } + // body params + localVarPostBody = r.accessRecord + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} diff --git a/src/api/api_accounts.go b/src/api/api_accounts.go new file mode 100644 index 0000000..65c5f66 --- /dev/null +++ b/src/api/api_accounts.go @@ -0,0 +1,436 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" + "time" +) + + +// AccountsAPIService AccountsAPI service +type AccountsAPIService service + +type ApiDelegateAuthenticationRequest struct { + ctx context.Context + ApiService *AccountsAPIService + identityRequest *IdentityRequest +} + +func (r ApiDelegateAuthenticationRequest) IdentityRequest(identityRequest IdentityRequest) ApiDelegateAuthenticationRequest { + r.identityRequest = &identityRequest + return r +} + +func (r ApiDelegateAuthenticationRequest) Execute() (*http.Response, error) { + return r.ApiService.DelegateAuthenticationExecute(r) +} + +/* +DelegateAuthentication Link external provider + +An identity is a JWT subscriber *sub* and issuer *iss*. Only one account my be linked to a particular JWT combination. Allows calling the API with a federated token directly instead of using a client access key. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDelegateAuthenticationRequest +*/ +func (a *AccountsAPIService) DelegateAuthentication(ctx context.Context) ApiDelegateAuthenticationRequest { + return ApiDelegateAuthenticationRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *AccountsAPIService) DelegateAuthenticationExecute(r ApiDelegateAuthenticationRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AccountsAPIService.DelegateAuthentication") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/identities" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.identityRequest == nil { + return nil, reportError("identityRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.identityRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiGetAccountRequest struct { + ctx context.Context + ApiService *AccountsAPIService + accountId string +} + +func (r ApiGetAccountRequest) Execute() (*Account, *http.Response, error) { + return r.ApiService.GetAccountExecute(r) +} + +/* +GetAccount Retrieve account information + +Includes the original configuration information. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param accountId The unique identifier for the account + @return ApiGetAccountRequest +*/ +func (a *AccountsAPIService) GetAccount(ctx context.Context, accountId string) ApiGetAccountRequest { + return ApiGetAccountRequest{ + ApiService: a, + ctx: ctx, + accountId: accountId, + } +} + +// Execute executes the request +// @return Account +func (a *AccountsAPIService) GetAccountExecute(r ApiGetAccountRequest) (*Account, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Account + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AccountsAPIService.GetAccount") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/accounts/{accountId}" + localVarPath = strings.Replace(localVarPath, "{"+"accountId"+"}", url.PathEscape(parameterValueToString(r.accountId, "accountId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetAccountIdentitiesRequest struct { + ctx context.Context + ApiService *AccountsAPIService +} + +func (r ApiGetAccountIdentitiesRequest) Execute() (*IdentityCollection, *http.Response, error) { + return r.ApiService.GetAccountIdentitiesExecute(r) +} + +/* +GetAccountIdentities List linked external providers + +Returns a list of identities linked for this account. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetAccountIdentitiesRequest +*/ +func (a *AccountsAPIService) GetAccountIdentities(ctx context.Context) ApiGetAccountIdentitiesRequest { + return ApiGetAccountIdentitiesRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return IdentityCollection +func (a *AccountsAPIService) GetAccountIdentitiesExecute(r ApiGetAccountIdentitiesRequest) (*IdentityCollection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *IdentityCollection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AccountsAPIService.GetAccountIdentities") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/identities" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetAccountsRequest struct { + ctx context.Context + ApiService *AccountsAPIService + earliestCacheTime *time.Time +} + +// Ensure the accounts list is not cached before this time. +func (r ApiGetAccountsRequest) EarliestCacheTime(earliestCacheTime time.Time) ApiGetAccountsRequest { + r.earliestCacheTime = &earliestCacheTime + return r +} + +func (r ApiGetAccountsRequest) Execute() (*AccountCollection, *http.Response, error) { + return r.ApiService.GetAccountsExecute(r) +} + +/* +GetAccounts List user Authress accounts + +Returns a list of accounts that the user has access to. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetAccountsRequest +*/ +func (a *AccountsAPIService) GetAccounts(ctx context.Context) ApiGetAccountsRequest { + return ApiGetAccountsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return AccountCollection +func (a *AccountsAPIService) GetAccountsExecute(r ApiGetAccountsRequest) (*AccountCollection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AccountCollection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AccountsAPIService.GetAccounts") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/accounts" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.earliestCacheTime != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "earliestCacheTime", r.earliestCacheTime, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/src/api/api_applications.go b/src/api/api_applications.go new file mode 100644 index 0000000..fa44a62 --- /dev/null +++ b/src/api/api_applications.go @@ -0,0 +1,138 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// ApplicationsAPIService ApplicationsAPI service +type ApplicationsAPIService service + +type ApiDelegateUserLoginRequest struct { + ctx context.Context + ApiService *ApplicationsAPIService + applicationId string + userId UserId +} + +func (r ApiDelegateUserLoginRequest) Execute() (*ApplicationDelegation, *http.Response, error) { + return r.ApiService.DelegateUserLoginExecute(r) +} + +/* +DelegateUserLogin Log user into third-party application + +Redirect the user to an external application to login them in. Authress uses OpenID and SAML configuration to securely pass the user's login session in your platform to an external platform. The user will then be logged into that platform. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param applicationId The application to have the user log into. + @param userId The user. + @return ApiDelegateUserLoginRequest +*/ +func (a *ApplicationsAPIService) DelegateUserLogin(ctx context.Context, applicationId string, userId UserId) ApiDelegateUserLoginRequest { + return ApiDelegateUserLoginRequest{ + ApiService: a, + ctx: ctx, + applicationId: applicationId, + userId: userId, + } +} + +// Execute executes the request +// @return ApplicationDelegation +func (a *ApplicationsAPIService) DelegateUserLoginExecute(r ApiDelegateUserLoginRequest) (*ApplicationDelegation, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ApplicationDelegation + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ApplicationsAPIService.DelegateUserLogin") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/applications/{applicationId}/users/{userId}/delegation" + localVarPath = strings.Replace(localVarPath, "{"+"applicationId"+"}", url.PathEscape(parameterValueToString(r.applicationId, "applicationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.applicationId) < 1 { + return localVarReturnValue, nil, reportError("applicationId must have at least 1 elements") + } + if strlen(r.applicationId) > 64 { + return localVarReturnValue, nil, reportError("applicationId must have less than 64 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/src/api/api_connections.go b/src/api/api_connections.go new file mode 100644 index 0000000..2a25522 --- /dev/null +++ b/src/api/api_connections.go @@ -0,0 +1,674 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// ConnectionsAPIService ConnectionsAPI service +type ConnectionsAPIService service + +type ApiCreateConnectionRequest struct { + ctx context.Context + ApiService *ConnectionsAPIService + connection *Connection +} + +func (r ApiCreateConnectionRequest) Connection(connection Connection) ApiCreateConnectionRequest { + r.connection = &connection + return r +} + +func (r ApiCreateConnectionRequest) Execute() (*Connection, *http.Response, error) { + return r.ApiService.CreateConnectionExecute(r) +} + +/* +CreateConnection Create SSO connection + +Specify identity connection details for Authress identity aggregation. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateConnectionRequest +*/ +func (a *ConnectionsAPIService) CreateConnection(ctx context.Context) ApiCreateConnectionRequest { + return ApiCreateConnectionRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return Connection +func (a *ConnectionsAPIService) CreateConnectionExecute(r ApiCreateConnectionRequest) (*Connection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Connection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ConnectionsAPIService.CreateConnection") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/connections" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.connection == nil { + return localVarReturnValue, nil, reportError("connection is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.connection + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDeleteConnectionRequest struct { + ctx context.Context + ApiService *ConnectionsAPIService + connectionId string +} + +func (r ApiDeleteConnectionRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteConnectionExecute(r) +} + +/* +DeleteConnection Delete SSO connection + +Delete an identity connection details for Authress identity aggregation. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param connectionId The connection identifier. + @return ApiDeleteConnectionRequest +*/ +func (a *ConnectionsAPIService) DeleteConnection(ctx context.Context, connectionId string) ApiDeleteConnectionRequest { + return ApiDeleteConnectionRequest{ + ApiService: a, + ctx: ctx, + connectionId: connectionId, + } +} + +// Execute executes the request +func (a *ConnectionsAPIService) DeleteConnectionExecute(r ApiDeleteConnectionRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ConnectionsAPIService.DeleteConnection") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/connections/{connectionId}" + localVarPath = strings.Replace(localVarPath, "{"+"connectionId"+"}", url.PathEscape(parameterValueToString(r.connectionId, "connectionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.connectionId) < 1 { + return nil, reportError("connectionId must have at least 1 elements") + } + if strlen(r.connectionId) > 64 { + return nil, reportError("connectionId must have less than 64 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiGetConnectionRequest struct { + ctx context.Context + ApiService *ConnectionsAPIService + connectionId string +} + +func (r ApiGetConnectionRequest) Execute() (*Connection, *http.Response, error) { + return r.ApiService.GetConnectionExecute(r) +} + +/* +GetConnection Retrieve SSO connection + +Get the identity connection details for Authress identity aggregation. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param connectionId The connection identifier. + @return ApiGetConnectionRequest +*/ +func (a *ConnectionsAPIService) GetConnection(ctx context.Context, connectionId string) ApiGetConnectionRequest { + return ApiGetConnectionRequest{ + ApiService: a, + ctx: ctx, + connectionId: connectionId, + } +} + +// Execute executes the request +// @return Connection +func (a *ConnectionsAPIService) GetConnectionExecute(r ApiGetConnectionRequest) (*Connection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Connection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ConnectionsAPIService.GetConnection") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/connections/{connectionId}" + localVarPath = strings.Replace(localVarPath, "{"+"connectionId"+"}", url.PathEscape(parameterValueToString(r.connectionId, "connectionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.connectionId) < 1 { + return localVarReturnValue, nil, reportError("connectionId must have at least 1 elements") + } + if strlen(r.connectionId) > 64 { + return localVarReturnValue, nil, reportError("connectionId must have less than 64 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetConnectionCredentialsRequest struct { + ctx context.Context + ApiService *ConnectionsAPIService + connectionId string + userId UserId +} + +func (r ApiGetConnectionCredentialsRequest) Execute() (*UserConnectionCredentials, *http.Response, error) { + return r.ApiService.GetConnectionCredentialsExecute(r) +} + +/* +GetConnectionCredentials Retrieve user connection credentials + +Get the credentials for the user that were generated as part of the latest user login flow. Returns an access token that can be used with originating connection provider, based on the original scopes and approved permissions by that service. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param connectionId The connection identifier. + @param userId The connection user. + @return ApiGetConnectionCredentialsRequest +*/ +func (a *ConnectionsAPIService) GetConnectionCredentials(ctx context.Context, connectionId string, userId UserId) ApiGetConnectionCredentialsRequest { + return ApiGetConnectionCredentialsRequest{ + ApiService: a, + ctx: ctx, + connectionId: connectionId, + userId: userId, + } +} + +// Execute executes the request +// @return UserConnectionCredentials +func (a *ConnectionsAPIService) GetConnectionCredentialsExecute(r ApiGetConnectionCredentialsRequest) (*UserConnectionCredentials, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserConnectionCredentials + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ConnectionsAPIService.GetConnectionCredentials") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/connections/{connectionId}/users/{userId}/credentials" + localVarPath = strings.Replace(localVarPath, "{"+"connectionId"+"}", url.PathEscape(parameterValueToString(r.connectionId, "connectionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.connectionId) < 1 { + return localVarReturnValue, nil, reportError("connectionId must have at least 1 elements") + } + if strlen(r.connectionId) > 64 { + return localVarReturnValue, nil, reportError("connectionId must have less than 64 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetConnectionsRequest struct { + ctx context.Context + ApiService *ConnectionsAPIService +} + +func (r ApiGetConnectionsRequest) Execute() (*ConnectionCollection, *http.Response, error) { + return r.ApiService.GetConnectionsExecute(r) +} + +/* +GetConnections List SSO connections + +Returns a paginated connection list for the account. Only connections the user has access to are returned. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetConnectionsRequest +*/ +func (a *ConnectionsAPIService) GetConnections(ctx context.Context) ApiGetConnectionsRequest { + return ApiGetConnectionsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return ConnectionCollection +func (a *ConnectionsAPIService) GetConnectionsExecute(r ApiGetConnectionsRequest) (*ConnectionCollection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ConnectionCollection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ConnectionsAPIService.GetConnections") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/connections" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUpdateConnectionRequest struct { + ctx context.Context + ApiService *ConnectionsAPIService + connectionId string + connection *Connection +} + +func (r ApiUpdateConnectionRequest) Connection(connection Connection) ApiUpdateConnectionRequest { + r.connection = &connection + return r +} + +func (r ApiUpdateConnectionRequest) Execute() (*Connection, *http.Response, error) { + return r.ApiService.UpdateConnectionExecute(r) +} + +/* +UpdateConnection Update SSO connection + +Specify identity connection details for Authress identity aggregation. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param connectionId The connection identifier. + @return ApiUpdateConnectionRequest +*/ +func (a *ConnectionsAPIService) UpdateConnection(ctx context.Context, connectionId string) ApiUpdateConnectionRequest { + return ApiUpdateConnectionRequest{ + ApiService: a, + ctx: ctx, + connectionId: connectionId, + } +} + +// Execute executes the request +// @return Connection +func (a *ConnectionsAPIService) UpdateConnectionExecute(r ApiUpdateConnectionRequest) (*Connection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Connection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ConnectionsAPIService.UpdateConnection") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/connections/{connectionId}" + localVarPath = strings.Replace(localVarPath, "{"+"connectionId"+"}", url.PathEscape(parameterValueToString(r.connectionId, "connectionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.connectionId) < 1 { + return localVarReturnValue, nil, reportError("connectionId must have at least 1 elements") + } + if strlen(r.connectionId) > 64 { + return localVarReturnValue, nil, reportError("connectionId must have less than 64 elements") + } + if r.connection == nil { + return localVarReturnValue, nil, reportError("connection is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.connection + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/src/api/api_extensions.go b/src/api/api_extensions.go new file mode 100644 index 0000000..dcbee3b --- /dev/null +++ b/src/api/api_extensions.go @@ -0,0 +1,840 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// ExtensionsAPIService ExtensionsAPI service +type ExtensionsAPIService service + +type ApiCreateExtensionRequest struct { + ctx context.Context + ApiService *ExtensionsAPIService + extension *Extension +} + +func (r ApiCreateExtensionRequest) Extension(extension Extension) ApiCreateExtensionRequest { + r.extension = &extension + return r +} + +func (r ApiCreateExtensionRequest) Execute() (*Extension, *http.Response, error) { + return r.ApiService.CreateExtensionExecute(r) +} + +/* +CreateExtension Create extension + +Specify the extension details for a new developer extension. Creating the extension enables developers to build applications that can log in to your platform and interact with your users' data. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateExtensionRequest +*/ +func (a *ExtensionsAPIService) CreateExtension(ctx context.Context) ApiCreateExtensionRequest { + return ApiCreateExtensionRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return Extension +func (a *ExtensionsAPIService) CreateExtensionExecute(r ApiCreateExtensionRequest) (*Extension, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Extension + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtensionsAPIService.CreateExtension") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/extensions" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.extension == nil { + return localVarReturnValue, nil, reportError("extension is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.extension + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDeleteExtensionRequest struct { + ctx context.Context + ApiService *ExtensionsAPIService + extensionId string +} + +func (r ApiDeleteExtensionRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteExtensionExecute(r) +} + +/* +DeleteExtension Delete extension + +Deletes the specified extension. When deleted an extension can no longer be accessed. Additionally users cannot use that extension to log in, nor can the service client associated with the extension be used to access data secured by Authress. The related Access Records will automatically be deleted. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param extensionId The extension identifier. + @return ApiDeleteExtensionRequest +*/ +func (a *ExtensionsAPIService) DeleteExtension(ctx context.Context, extensionId string) ApiDeleteExtensionRequest { + return ApiDeleteExtensionRequest{ + ApiService: a, + ctx: ctx, + extensionId: extensionId, + } +} + +// Execute executes the request +func (a *ExtensionsAPIService) DeleteExtensionExecute(r ApiDeleteExtensionRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtensionsAPIService.DeleteExtension") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/extensions/{extensionId}" + localVarPath = strings.Replace(localVarPath, "{"+"extensionId"+"}", url.PathEscape(parameterValueToString(r.extensionId, "extensionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.extensionId) < 1 { + return nil, reportError("extensionId must have at least 1 elements") + } + if strlen(r.extensionId) > 64 { + return nil, reportError("extensionId must have less than 64 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiGetExtensionRequest struct { + ctx context.Context + ApiService *ExtensionsAPIService + extensionId string +} + +func (r ApiGetExtensionRequest) Execute() (*Extension, *http.Response, error) { + return r.ApiService.GetExtensionExecute(r) +} + +/* +GetExtension Retrieve extension + +Gets the platform extension details for the existing extension. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param extensionId The extension identifier. + @return ApiGetExtensionRequest +*/ +func (a *ExtensionsAPIService) GetExtension(ctx context.Context, extensionId string) ApiGetExtensionRequest { + return ApiGetExtensionRequest{ + ApiService: a, + ctx: ctx, + extensionId: extensionId, + } +} + +// Execute executes the request +// @return Extension +func (a *ExtensionsAPIService) GetExtensionExecute(r ApiGetExtensionRequest) (*Extension, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Extension + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtensionsAPIService.GetExtension") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/extensions/{extensionId}" + localVarPath = strings.Replace(localVarPath, "{"+"extensionId"+"}", url.PathEscape(parameterValueToString(r.extensionId, "extensionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.extensionId) < 1 { + return localVarReturnValue, nil, reportError("extensionId must have at least 1 elements") + } + if strlen(r.extensionId) > 64 { + return localVarReturnValue, nil, reportError("extensionId must have less than 64 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetExtensionsRequest struct { + ctx context.Context + ApiService *ExtensionsAPIService + limit *int32 + cursor *string +} + +// Max number of results to return +func (r ApiGetExtensionsRequest) Limit(limit int32) ApiGetExtensionsRequest { + r.limit = &limit + return r +} + +// Continuation cursor for paging +func (r ApiGetExtensionsRequest) Cursor(cursor string) ApiGetExtensionsRequest { + r.cursor = &cursor + return r +} + +func (r ApiGetExtensionsRequest) Execute() (*ExtensionCollection, *http.Response, error) { + return r.ApiService.GetExtensionsExecute(r) +} + +/* +GetExtensions List extensions + +Lists the platform extensions. Extensions are the applications that developers of your platform have created for your users to interact with. Returns a paginated extension list for the account. Only extensions the user has access to are returned. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetExtensionsRequest +*/ +func (a *ExtensionsAPIService) GetExtensions(ctx context.Context) ApiGetExtensionsRequest { + return ApiGetExtensionsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return ExtensionCollection +func (a *ExtensionsAPIService) GetExtensionsExecute(r ApiGetExtensionsRequest) (*ExtensionCollection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ExtensionCollection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ExtensionsAPIService.GetExtensions") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/extensions" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } else { + var defaultValue int32 = 20 + r.limit = &defaultValue + } + if r.cursor != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cursor", r.cursor, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiLoginRequest struct { + ctx context.Context + ApiService *ExtensionsAPIService + clientId *string + codeChallenge *string + redirectUri *string + codeChallengeMethod *string +} + +// The client identifier to constrain the token to. +func (r ApiLoginRequest) ClientId(clientId string) ApiLoginRequest { + r.clientId = &clientId + return r +} + +// The PKCE Code challenge generated by the extension UI to secure the code exchange from [RFC 7636](https://datatracker.ietf.org/doc/html/rfc7636). +func (r ApiLoginRequest) CodeChallenge(codeChallenge string) ApiLoginRequest { + r.codeChallenge = &codeChallenge + return r +} + +// The location to redirect the user back to after login. This redirect_uri must be a URL that matches one of the preconfigured urls in the Authress Application. +func (r ApiLoginRequest) RedirectUri(redirectUri string) ApiLoginRequest { + r.redirectUri = &redirectUri + return r +} + +// The method used to generate the code_challenge from the code_verifier. `code_challenge_method(code_verifier) = code_challenge` +func (r ApiLoginRequest) CodeChallengeMethod(codeChallengeMethod string) ApiLoginRequest { + r.codeChallengeMethod = &codeChallengeMethod + return r +} + +func (r ApiLoginRequest) Execute() (*OAuthAuthorizeResponse, *http.Response, error) { + return r.ApiService.LoginExecute(r) +} + +/* +Login OAuth Authorize + +*Note*: This endpoint is only to be used for [Authress Platform Extensions](https://authress.io/knowledge-base/docs/extensions/). If you are not building an app marketplace, then tokens can be directly requested for Service Clients, using the relevant [SDK](https://authress.io/app/#/api).
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" + "time" +) + + +// GroupsAPIService GroupsAPI service +type GroupsAPIService service + +type ApiCreateGroupRequest struct { + ctx context.Context + ApiService *GroupsAPIService + group *Group +} + +func (r ApiCreateGroupRequest) Group(group Group) ApiCreateGroupRequest { + r.group = &group + return r +} + +func (r ApiCreateGroupRequest) Execute() (*Group, *http.Response, error) { + return r.ApiService.CreateGroupExecute(r) +} + +/* +CreateGroup Create group + +Specify users to be included in a new group. (Groups have a maximum size of ~100KB) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateGroupRequest +*/ +func (a *GroupsAPIService) CreateGroup(ctx context.Context) ApiCreateGroupRequest { + return ApiCreateGroupRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return Group +func (a *GroupsAPIService) CreateGroupExecute(r ApiCreateGroupRequest) (*Group, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Group + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "GroupsAPIService.CreateGroup") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/groups" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.group == nil { + return localVarReturnValue, nil, reportError("group is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.group + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDeleteGroupRequest struct { + ctx context.Context + ApiService *GroupsAPIService + groupId GroupId +} + +func (r ApiDeleteGroupRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteGroupExecute(r) +} + +/* +DeleteGroup Deletes group + +Remove a group, users will lose any role that was assigned through membership of this group. This action cannot be undone. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param groupId The identifier of the group. + @return ApiDeleteGroupRequest +*/ +func (a *GroupsAPIService) DeleteGroup(ctx context.Context, groupId GroupId) ApiDeleteGroupRequest { + return ApiDeleteGroupRequest{ + ApiService: a, + ctx: ctx, + groupId: groupId, + } +} + +// Execute executes the request +func (a *GroupsAPIService) DeleteGroupExecute(r ApiDeleteGroupRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "GroupsAPIService.DeleteGroup") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/groups/{groupId}" + localVarPath = strings.Replace(localVarPath, "{"+"groupId"+"}", url.PathEscape(parameterValueToString(r.groupId, "groupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiGetGroupRequest struct { + ctx context.Context + ApiService *GroupsAPIService + groupId GroupId +} + +func (r ApiGetGroupRequest) Execute() (*Group, *http.Response, error) { + return r.ApiService.GetGroupExecute(r) +} + +/* +GetGroup Retrieve group + +A group contains multiple users which can be added to an access record, and should be assigned the same roles at the same time. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param groupId The identifier of the group. + @return ApiGetGroupRequest +*/ +func (a *GroupsAPIService) GetGroup(ctx context.Context, groupId GroupId) ApiGetGroupRequest { + return ApiGetGroupRequest{ + ApiService: a, + ctx: ctx, + groupId: groupId, + } +} + +// Execute executes the request +// @return Group +func (a *GroupsAPIService) GetGroupExecute(r ApiGetGroupRequest) (*Group, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Group + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "GroupsAPIService.GetGroup") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/groups/{groupId}" + localVarPath = strings.Replace(localVarPath, "{"+"groupId"+"}", url.PathEscape(parameterValueToString(r.groupId, "groupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetGroupsRequest struct { + ctx context.Context + ApiService *GroupsAPIService + limit *int32 + cursor *string + filter *string +} + +// Max number of results to return +func (r ApiGetGroupsRequest) Limit(limit int32) ApiGetGroupsRequest { + r.limit = &limit + return r +} + +// Continuation cursor for paging +func (r ApiGetGroupsRequest) Cursor(cursor string) ApiGetGroupsRequest { + r.cursor = &cursor + return r +} + +// Filter to search groups by. This is a case insensitive search through every text field. +func (r ApiGetGroupsRequest) Filter(filter string) ApiGetGroupsRequest { + r.filter = &filter + return r +} + +func (r ApiGetGroupsRequest) Execute() (*GroupCollection, *http.Response, error) { + return r.ApiService.GetGroupsExecute(r) +} + +/* +GetGroups List groups + +Returns a paginated groups list for the account. Only groups the user has access to are returned. The results sort order is not stable, on subsequent requests different results may be returned. This query resource is meant for administrative actions only, therefore has a lower rate limit tier than user permissions related resources. Additionally, the results from a query to Groups may be delayed up to 5 minutes. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetGroupsRequest +*/ +func (a *GroupsAPIService) GetGroups(ctx context.Context) ApiGetGroupsRequest { + return ApiGetGroupsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return GroupCollection +func (a *GroupsAPIService) GetGroupsExecute(r ApiGetGroupsRequest) (*GroupCollection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GroupCollection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "GroupsAPIService.GetGroups") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/groups" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } else { + var defaultValue int32 = 20 + r.limit = &defaultValue + } + if r.cursor != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cursor", r.cursor, "") + } + if r.filter != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "filter", r.filter, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUpdateGroupRequest struct { + ctx context.Context + ApiService *GroupsAPIService + groupId GroupId + group *Group + ifUnmodifiedSince *time.Time +} + +func (r ApiUpdateGroupRequest) Group(group Group) ApiUpdateGroupRequest { + r.group = &group + return r +} + +// The expected last time the group was modified. +func (r ApiUpdateGroupRequest) IfUnmodifiedSince(ifUnmodifiedSince time.Time) ApiUpdateGroupRequest { + r.ifUnmodifiedSince = &ifUnmodifiedSince + return r +} + +func (r ApiUpdateGroupRequest) Execute() (*Group, *http.Response, error) { + return r.ApiService.UpdateGroupExecute(r) +} + +/* +UpdateGroup Update a group + +Updates a group adding or removing user. Change a group updates the permissions and roles the users have access to. (Groups have a maximum size of ~100KB) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param groupId The identifier of the group. + @return ApiUpdateGroupRequest +*/ +func (a *GroupsAPIService) UpdateGroup(ctx context.Context, groupId GroupId) ApiUpdateGroupRequest { + return ApiUpdateGroupRequest{ + ApiService: a, + ctx: ctx, + groupId: groupId, + } +} + +// Execute executes the request +// @return Group +func (a *GroupsAPIService) UpdateGroupExecute(r ApiUpdateGroupRequest) (*Group, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Group + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "GroupsAPIService.UpdateGroup") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/groups/{groupId}" + localVarPath = strings.Replace(localVarPath, "{"+"groupId"+"}", url.PathEscape(parameterValueToString(r.groupId, "groupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.group == nil { + return localVarReturnValue, nil, reportError("group is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ifUnmodifiedSince != nil { + parameterAddToHeaderOrQuery(localVarHeaderParams, "If-Unmodified-Since", r.ifUnmodifiedSince, "") + } + // body params + localVarPostBody = r.group + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/src/api/api_invites.go b/src/api/api_invites.go new file mode 100644 index 0000000..de147a4 --- /dev/null +++ b/src/api/api_invites.go @@ -0,0 +1,457 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// InvitesAPIService InvitesAPI service +type InvitesAPIService service + +type ApiCreateInviteRequest struct { + ctx context.Context + ApiService *InvitesAPIService + invite *Invite +} + +func (r ApiCreateInviteRequest) Invite(invite Invite) ApiCreateInviteRequest { + r.invite = &invite + return r +} + +func (r ApiCreateInviteRequest) Execute() (*Invite, *http.Response, error) { + return r.ApiService.CreateInviteExecute(r) +} + +/* +CreateInvite Create user invite + +Invites are used to easily assign permissions to users that have not been created in your identity provider yet. +1. This generates an invite record. +2. Send the invite ID to the user. +3. Log the user in. +4. As the user PATCH the /invite/{inviteId} endpoint +5. This accepts the invite. + When the user accepts the invite they will automatically receive the permissions assigned in the Invite. Invites automatically expire after 7 days. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateInviteRequest +*/ +func (a *InvitesAPIService) CreateInvite(ctx context.Context) ApiCreateInviteRequest { + return ApiCreateInviteRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return Invite +func (a *InvitesAPIService) CreateInviteExecute(r ApiCreateInviteRequest) (*Invite, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Invite + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InvitesAPIService.CreateInvite") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/invites" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.invite == nil { + return localVarReturnValue, nil, reportError("invite is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.invite + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDeleteInviteRequest struct { + ctx context.Context + ApiService *InvitesAPIService + inviteId string +} + +func (r ApiDeleteInviteRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteInviteExecute(r) +} + +/* +DeleteInvite Delete invite + +Deletes an invite. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param inviteId The identifier of the invite. + @return ApiDeleteInviteRequest +*/ +func (a *InvitesAPIService) DeleteInvite(ctx context.Context, inviteId string) ApiDeleteInviteRequest { + return ApiDeleteInviteRequest{ + ApiService: a, + ctx: ctx, + inviteId: inviteId, + } +} + +// Execute executes the request +func (a *InvitesAPIService) DeleteInviteExecute(r ApiDeleteInviteRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InvitesAPIService.DeleteInvite") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/invites/{inviteId}" + localVarPath = strings.Replace(localVarPath, "{"+"inviteId"+"}", url.PathEscape(parameterValueToString(r.inviteId, "inviteId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.inviteId) < 1 { + return nil, reportError("inviteId must have at least 1 elements") + } + if strlen(r.inviteId) > 256 { + return nil, reportError("inviteId must have less than 256 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiGetInviteRequest struct { + ctx context.Context + ApiService *InvitesAPIService + inviteId string +} + +func (r ApiGetInviteRequest) Execute() (*Invite, *http.Response, error) { + return r.ApiService.GetInviteExecute(r) +} + +/* +GetInvite Retrieve invite + +Gets the invite along with the relevant invite data. Invites enable users inviting other users to their tenant, organization, or account. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param inviteId The identifier of the invite. + @return ApiGetInviteRequest +*/ +func (a *InvitesAPIService) GetInvite(ctx context.Context, inviteId string) ApiGetInviteRequest { + return ApiGetInviteRequest{ + ApiService: a, + ctx: ctx, + inviteId: inviteId, + } +} + +// Execute executes the request +// @return Invite +func (a *InvitesAPIService) GetInviteExecute(r ApiGetInviteRequest) (*Invite, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Invite + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InvitesAPIService.GetInvite") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/invites/{inviteId}" + localVarPath = strings.Replace(localVarPath, "{"+"inviteId"+"}", url.PathEscape(parameterValueToString(r.inviteId, "inviteId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.inviteId) < 1 { + return localVarReturnValue, nil, reportError("inviteId must have at least 1 elements") + } + if strlen(r.inviteId) > 256 { + return localVarReturnValue, nil, reportError("inviteId must have less than 256 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRespondToInviteRequest struct { + ctx context.Context + ApiService *InvitesAPIService + inviteId string +} + +func (r ApiRespondToInviteRequest) Execute() (*Account, *http.Response, error) { + return r.ApiService.RespondToInviteExecute(r) +} + +/* +RespondToInvite Accept invite + +Accepts an invite by claiming this invite by this user. The user access token used for this request will gain the permissions associated with the invite. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param inviteId The identifier of the invite. + @return ApiRespondToInviteRequest +*/ +func (a *InvitesAPIService) RespondToInvite(ctx context.Context, inviteId string) ApiRespondToInviteRequest { + return ApiRespondToInviteRequest{ + ApiService: a, + ctx: ctx, + inviteId: inviteId, + } +} + +// Execute executes the request +// @return Account +func (a *InvitesAPIService) RespondToInviteExecute(r ApiRespondToInviteRequest) (*Account, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Account + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InvitesAPIService.RespondToInvite") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/invites/{inviteId}" + localVarPath = strings.Replace(localVarPath, "{"+"inviteId"+"}", url.PathEscape(parameterValueToString(r.inviteId, "inviteId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.inviteId) < 1 { + return localVarReturnValue, nil, reportError("inviteId must have at least 1 elements") + } + if strlen(r.inviteId) > 256 { + return localVarReturnValue, nil, reportError("inviteId must have less than 256 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/src/api/api_resource_permissions.go b/src/api/api_resource_permissions.go new file mode 100644 index 0000000..5461e23 --- /dev/null +++ b/src/api/api_resource_permissions.go @@ -0,0 +1,475 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// ResourcePermissionsAPIService ResourcePermissionsAPI service +type ResourcePermissionsAPIService service + +type ApiGetPermissionedResourceRequest struct { + ctx context.Context + ApiService *ResourcePermissionsAPIService + resourceUri string +} + +func (r ApiGetPermissionedResourceRequest) Execute() (*PermissionedResource, *http.Response, error) { + return r.ApiService.GetPermissionedResourceExecute(r) +} + +/* +GetPermissionedResource Retrieve resource configuration + +Permissions can be set globally at a resource level. This will apply to all users in an account. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param resourceUri The uri path of a resource to validate, must be URL encoded, uri segments are allowed. + @return ApiGetPermissionedResourceRequest +*/ +func (a *ResourcePermissionsAPIService) GetPermissionedResource(ctx context.Context, resourceUri string) ApiGetPermissionedResourceRequest { + return ApiGetPermissionedResourceRequest{ + ApiService: a, + ctx: ctx, + resourceUri: resourceUri, + } +} + +// Execute executes the request +// @return PermissionedResource +func (a *ResourcePermissionsAPIService) GetPermissionedResourceExecute(r ApiGetPermissionedResourceRequest) (*PermissionedResource, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PermissionedResource + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ResourcePermissionsAPIService.GetPermissionedResource") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/resources/{resourceUri}" + localVarPath = strings.Replace(localVarPath, "{"+"resourceUri"+"}", url.PathEscape(parameterValueToString(r.resourceUri, "resourceUri")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.resourceUri) < 1 { + return localVarReturnValue, nil, reportError("resourceUri must have at least 1 elements") + } + if strlen(r.resourceUri) > 512 { + return localVarReturnValue, nil, reportError("resourceUri must have less than 512 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetPermissionedResourcesRequest struct { + ctx context.Context + ApiService *ResourcePermissionsAPIService +} + +func (r ApiGetPermissionedResourcesRequest) Execute() (*PermissionedResourceCollection, *http.Response, error) { + return r.ApiService.GetPermissionedResourcesExecute(r) +} + +/* +GetPermissionedResources List all resource configurations + +Permissions can be set globally at a resource level. This endpoint returns a list of resources with globally set resource permissions. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetPermissionedResourcesRequest +*/ +func (a *ResourcePermissionsAPIService) GetPermissionedResources(ctx context.Context) ApiGetPermissionedResourcesRequest { + return ApiGetPermissionedResourcesRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return PermissionedResourceCollection +func (a *ResourcePermissionsAPIService) GetPermissionedResourcesExecute(r ApiGetPermissionedResourcesRequest) (*PermissionedResourceCollection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PermissionedResourceCollection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ResourcePermissionsAPIService.GetPermissionedResources") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/resources" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetResourceUsersRequest struct { + ctx context.Context + ApiService *ResourcePermissionsAPIService + resourceUri string + limit *int32 + cursor *string +} + +// Max number of results to return +func (r ApiGetResourceUsersRequest) Limit(limit int32) ApiGetResourceUsersRequest { + r.limit = &limit + return r +} + +// Continuation cursor for paging +func (r ApiGetResourceUsersRequest) Cursor(cursor string) ApiGetResourceUsersRequest { + r.cursor = &cursor + return r +} + +func (r ApiGetResourceUsersRequest) Execute() (*ResourceUsersCollection, *http.Response, error) { + return r.ApiService.GetResourceUsersExecute(r) +} + +/* +GetResourceUsers List users with resource access + +Get the resource users with explicit access to the resource. This result is a list of users that have some permission to the resource. Users with access to parent resources and users with access only to a sub-resource will not be returned in this result. In the case that the resource has multiple users, the list will be paginated. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param resourceUri The uri path of a resource to validate, must be URL encoded, uri segments are allowed. + @return ApiGetResourceUsersRequest +*/ +func (a *ResourcePermissionsAPIService) GetResourceUsers(ctx context.Context, resourceUri string) ApiGetResourceUsersRequest { + return ApiGetResourceUsersRequest{ + ApiService: a, + ctx: ctx, + resourceUri: resourceUri, + } +} + +// Execute executes the request +// @return ResourceUsersCollection +func (a *ResourcePermissionsAPIService) GetResourceUsersExecute(r ApiGetResourceUsersRequest) (*ResourceUsersCollection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ResourceUsersCollection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ResourcePermissionsAPIService.GetResourceUsers") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/resources/{resourceUri}/users" + localVarPath = strings.Replace(localVarPath, "{"+"resourceUri"+"}", url.PathEscape(parameterValueToString(r.resourceUri, "resourceUri")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.resourceUri) < 1 { + return localVarReturnValue, nil, reportError("resourceUri must have at least 1 elements") + } + if strlen(r.resourceUri) > 512 { + return localVarReturnValue, nil, reportError("resourceUri must have less than 512 elements") + } + + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } else { + var defaultValue int32 = 20 + r.limit = &defaultValue + } + if r.cursor != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cursor", r.cursor, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUpdatePermissionedResourceRequest struct { + ctx context.Context + ApiService *ResourcePermissionsAPIService + resourceUri string + permissionedResource *PermissionedResource +} + +// The contents of the permission to set on the resource. Overwrites existing data. +func (r ApiUpdatePermissionedResourceRequest) PermissionedResource(permissionedResource PermissionedResource) ApiUpdatePermissionedResourceRequest { + r.permissionedResource = &permissionedResource + return r +} + +func (r ApiUpdatePermissionedResourceRequest) Execute() (*http.Response, error) { + return r.ApiService.UpdatePermissionedResourceExecute(r) +} + +/* +UpdatePermissionedResource Update resource configuration + +Updates the global permissions on a resource. This applies to all users in an account. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param resourceUri The uri path of a resource to validate, must be URL encoded, uri segments are allowed. + @return ApiUpdatePermissionedResourceRequest +*/ +func (a *ResourcePermissionsAPIService) UpdatePermissionedResource(ctx context.Context, resourceUri string) ApiUpdatePermissionedResourceRequest { + return ApiUpdatePermissionedResourceRequest{ + ApiService: a, + ctx: ctx, + resourceUri: resourceUri, + } +} + +// Execute executes the request +func (a *ResourcePermissionsAPIService) UpdatePermissionedResourceExecute(r ApiUpdatePermissionedResourceRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ResourcePermissionsAPIService.UpdatePermissionedResource") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/resources/{resourceUri}" + localVarPath = strings.Replace(localVarPath, "{"+"resourceUri"+"}", url.PathEscape(parameterValueToString(r.resourceUri, "resourceUri")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.resourceUri) < 1 { + return nil, reportError("resourceUri must have at least 1 elements") + } + if strlen(r.resourceUri) > 512 { + return nil, reportError("resourceUri must have less than 512 elements") + } + if r.permissionedResource == nil { + return nil, reportError("permissionedResource is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.permissionedResource + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} diff --git a/src/api/api_roles.go b/src/api/api_roles.go new file mode 100644 index 0000000..2c6f9b9 --- /dev/null +++ b/src/api/api_roles.go @@ -0,0 +1,594 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// RolesAPIService RolesAPI service +type RolesAPIService service + +type ApiCreateRoleRequest struct { + ctx context.Context + ApiService *RolesAPIService + role *Role +} + +func (r ApiCreateRoleRequest) Role(role Role) ApiCreateRoleRequest { + r.role = &role + return r +} + +func (r ApiCreateRoleRequest) Execute() (*Role, *http.Response, error) { + return r.ApiService.CreateRoleExecute(r) +} + +/* +CreateRole Create role + +Creates a role with permissions. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateRoleRequest +*/ +func (a *RolesAPIService) CreateRole(ctx context.Context) ApiCreateRoleRequest { + return ApiCreateRoleRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return Role +func (a *RolesAPIService) CreateRoleExecute(r ApiCreateRoleRequest) (*Role, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Role + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RolesAPIService.CreateRole") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/roles" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.role == nil { + return localVarReturnValue, nil, reportError("role is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.role + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDeleteRoleRequest struct { + ctx context.Context + ApiService *RolesAPIService + roleId string +} + +func (r ApiDeleteRoleRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteRoleExecute(r) +} + +/* +DeleteRole Deletes role + +Remove a role. If a record references the role, that record will not be modified. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param roleId The identifier of the role. + @return ApiDeleteRoleRequest +*/ +func (a *RolesAPIService) DeleteRole(ctx context.Context, roleId string) ApiDeleteRoleRequest { + return ApiDeleteRoleRequest{ + ApiService: a, + ctx: ctx, + roleId: roleId, + } +} + +// Execute executes the request +func (a *RolesAPIService) DeleteRoleExecute(r ApiDeleteRoleRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RolesAPIService.DeleteRole") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/roles/{roleId}" + localVarPath = strings.Replace(localVarPath, "{"+"roleId"+"}", url.PathEscape(parameterValueToString(r.roleId, "roleId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.roleId) < 1 { + return nil, reportError("roleId must have at least 1 elements") + } + if strlen(r.roleId) > 64 { + return nil, reportError("roleId must have less than 64 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiGetRoleRequest struct { + ctx context.Context + ApiService *RolesAPIService + roleId string +} + +func (r ApiGetRoleRequest) Execute() (*Role, *http.Response, error) { + return r.ApiService.GetRoleExecute(r) +} + +/* +GetRole Retrieve role + +Roles contain a list of permissions that will be applied to any user or resource + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param roleId The identifier of the role. + @return ApiGetRoleRequest +*/ +func (a *RolesAPIService) GetRole(ctx context.Context, roleId string) ApiGetRoleRequest { + return ApiGetRoleRequest{ + ApiService: a, + ctx: ctx, + roleId: roleId, + } +} + +// Execute executes the request +// @return Role +func (a *RolesAPIService) GetRoleExecute(r ApiGetRoleRequest) (*Role, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Role + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RolesAPIService.GetRole") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/roles/{roleId}" + localVarPath = strings.Replace(localVarPath, "{"+"roleId"+"}", url.PathEscape(parameterValueToString(r.roleId, "roleId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.roleId) < 1 { + return localVarReturnValue, nil, reportError("roleId must have at least 1 elements") + } + if strlen(r.roleId) > 64 { + return localVarReturnValue, nil, reportError("roleId must have less than 64 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetRolesRequest struct { + ctx context.Context + ApiService *RolesAPIService + limit *int32 + cursor *string + filter *string +} + +// Max number of results to return. +func (r ApiGetRolesRequest) Limit(limit int32) ApiGetRolesRequest { + r.limit = &limit + return r +} + +// Continuation cursor for paging. +func (r ApiGetRolesRequest) Cursor(cursor string) ApiGetRolesRequest { + r.cursor = &cursor + return r +} + +// Filter to search roles by. This is a case insensitive search. +func (r ApiGetRolesRequest) Filter(filter string) ApiGetRolesRequest { + r.filter = &filter + return r +} + +func (r ApiGetRolesRequest) Execute() (*RoleCollection, *http.Response, error) { + return r.ApiService.GetRolesExecute(r) +} + +/* +GetRoles List roles + +Get all the account roles. Roles contain a list of permissions that will be applied to any user or resource + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetRolesRequest +*/ +func (a *RolesAPIService) GetRoles(ctx context.Context) ApiGetRolesRequest { + return ApiGetRolesRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return RoleCollection +func (a *RolesAPIService) GetRolesExecute(r ApiGetRolesRequest) (*RoleCollection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RoleCollection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RolesAPIService.GetRoles") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/roles" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } else { + var defaultValue int32 = 100 + r.limit = &defaultValue + } + if r.cursor != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cursor", r.cursor, "") + } + if r.filter != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "filter", r.filter, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUpdateRoleRequest struct { + ctx context.Context + ApiService *RolesAPIService + roleId string + role *Role +} + +func (r ApiUpdateRoleRequest) Role(role Role) ApiUpdateRoleRequest { + r.role = &role + return r +} + +func (r ApiUpdateRoleRequest) Execute() (*Role, *http.Response, error) { + return r.ApiService.UpdateRoleExecute(r) +} + +/* +UpdateRole Update role + +Updates a role adding or removing permissions. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param roleId The identifier of the role. + @return ApiUpdateRoleRequest +*/ +func (a *RolesAPIService) UpdateRole(ctx context.Context, roleId string) ApiUpdateRoleRequest { + return ApiUpdateRoleRequest{ + ApiService: a, + ctx: ctx, + roleId: roleId, + } +} + +// Execute executes the request +// @return Role +func (a *RolesAPIService) UpdateRoleExecute(r ApiUpdateRoleRequest) (*Role, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Role + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RolesAPIService.UpdateRole") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/roles/{roleId}" + localVarPath = strings.Replace(localVarPath, "{"+"roleId"+"}", url.PathEscape(parameterValueToString(r.roleId, "roleId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.roleId) < 1 { + return localVarReturnValue, nil, reportError("roleId must have at least 1 elements") + } + if strlen(r.roleId) > 64 { + return localVarReturnValue, nil, reportError("roleId must have less than 64 elements") + } + if r.role == nil { + return localVarReturnValue, nil, reportError("role is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.role + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/src/api/api_service_clients.go b/src/api/api_service_clients.go new file mode 100644 index 0000000..21f1dde --- /dev/null +++ b/src/api/api_service_clients.go @@ -0,0 +1,801 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// ServiceClientsAPIService ServiceClientsAPI service +type ServiceClientsAPIService service + +type ApiCreateClientRequest struct { + ctx context.Context + ApiService *ServiceClientsAPIService + client *Client +} + +func (r ApiCreateClientRequest) Client(client Client) ApiCreateClientRequest { + r.client = &client + return r +} + +func (r ApiCreateClientRequest) Execute() (*Client, *http.Response, error) { + return r.ApiService.CreateClientExecute(r) +} + +/* +CreateClient Create service client + +Creates a service client to interact with Authress or any other service on behalf of users. Each client has secret private keys used to authenticate with Authress. To use service clients created through other mechanisms, skip creating a client and create access records with the client identifier. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateClientRequest +*/ +func (a *ServiceClientsAPIService) CreateClient(ctx context.Context) ApiCreateClientRequest { + return ApiCreateClientRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return Client +func (a *ServiceClientsAPIService) CreateClientExecute(r ApiCreateClientRequest) (*Client, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Client + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServiceClientsAPIService.CreateClient") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/clients" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.client == nil { + return localVarReturnValue, nil, reportError("client is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.client + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDeleteAccessKeyRequest struct { + ctx context.Context + ApiService *ServiceClientsAPIService + clientId string + keyId string +} + +func (r ApiDeleteAccessKeyRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteAccessKeyExecute(r) +} + +/* +DeleteAccessKey Delete service client access key + +Deletes an access key for a client prevent it from being used to authenticate with Authress. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param clientId The unique identifier of the client. + @param keyId The ID of the access key to remove from the client. + @return ApiDeleteAccessKeyRequest +*/ +func (a *ServiceClientsAPIService) DeleteAccessKey(ctx context.Context, clientId string, keyId string) ApiDeleteAccessKeyRequest { + return ApiDeleteAccessKeyRequest{ + ApiService: a, + ctx: ctx, + clientId: clientId, + keyId: keyId, + } +} + +// Execute executes the request +func (a *ServiceClientsAPIService) DeleteAccessKeyExecute(r ApiDeleteAccessKeyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServiceClientsAPIService.DeleteAccessKey") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/clients/{clientId}/access-keys/{keyId}" + localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(parameterValueToString(r.clientId, "clientId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"keyId"+"}", url.PathEscape(parameterValueToString(r.keyId, "keyId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.clientId) < 1 { + return nil, reportError("clientId must have at least 1 elements") + } + if strlen(r.clientId) > 64 { + return nil, reportError("clientId must have less than 64 elements") + } + if strlen(r.keyId) < 1 { + return nil, reportError("keyId must have at least 1 elements") + } + if strlen(r.keyId) > 64 { + return nil, reportError("keyId must have less than 64 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDeleteClientRequest struct { + ctx context.Context + ApiService *ServiceClientsAPIService + clientId string +} + +func (r ApiDeleteClientRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteClientExecute(r) +} + +/* +DeleteClient Delete service client + +This deletes the service client. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param clientId The unique identifier for the client. + @return ApiDeleteClientRequest +*/ +func (a *ServiceClientsAPIService) DeleteClient(ctx context.Context, clientId string) ApiDeleteClientRequest { + return ApiDeleteClientRequest{ + ApiService: a, + ctx: ctx, + clientId: clientId, + } +} + +// Execute executes the request +func (a *ServiceClientsAPIService) DeleteClientExecute(r ApiDeleteClientRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServiceClientsAPIService.DeleteClient") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/clients/{clientId}" + localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(parameterValueToString(r.clientId, "clientId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.clientId) < 1 { + return nil, reportError("clientId must have at least 1 elements") + } + if strlen(r.clientId) > 64 { + return nil, reportError("clientId must have less than 64 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiGetClientRequest struct { + ctx context.Context + ApiService *ServiceClientsAPIService + clientId string +} + +func (r ApiGetClientRequest) Execute() (*Client, *http.Response, error) { + return r.ApiService.GetClientExecute(r) +} + +/* +GetClient Retrieve service client + +Returns all information related to client except for the private access keys. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param clientId The unique identifier for the client. + @return ApiGetClientRequest +*/ +func (a *ServiceClientsAPIService) GetClient(ctx context.Context, clientId string) ApiGetClientRequest { + return ApiGetClientRequest{ + ApiService: a, + ctx: ctx, + clientId: clientId, + } +} + +// Execute executes the request +// @return Client +func (a *ServiceClientsAPIService) GetClientExecute(r ApiGetClientRequest) (*Client, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Client + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServiceClientsAPIService.GetClient") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/clients/{clientId}" + localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(parameterValueToString(r.clientId, "clientId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.clientId) < 1 { + return localVarReturnValue, nil, reportError("clientId must have at least 1 elements") + } + if strlen(r.clientId) > 64 { + return localVarReturnValue, nil, reportError("clientId must have less than 64 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetClientsRequest struct { + ctx context.Context + ApiService *ServiceClientsAPIService + limit *int32 + cursor *string +} + +// Max number of results to return +func (r ApiGetClientsRequest) Limit(limit int32) ApiGetClientsRequest { + r.limit = &limit + return r +} + +// Continuation cursor for paging. +func (r ApiGetClientsRequest) Cursor(cursor string) ApiGetClientsRequest { + r.cursor = &cursor + return r +} + +func (r ApiGetClientsRequest) Execute() (*ClientCollection, *http.Response, error) { + return r.ApiService.GetClientsExecute(r) +} + +/* +GetClients List service clients + +Returns all clients that the user has access to in the account. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetClientsRequest +*/ +func (a *ServiceClientsAPIService) GetClients(ctx context.Context) ApiGetClientsRequest { + return ApiGetClientsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return ClientCollection +func (a *ServiceClientsAPIService) GetClientsExecute(r ApiGetClientsRequest) (*ClientCollection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ClientCollection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServiceClientsAPIService.GetClients") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/clients" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } else { + var defaultValue int32 = 20 + r.limit = &defaultValue + } + if r.cursor != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cursor", r.cursor, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRequestAccessKeyRequest struct { + ctx context.Context + ApiService *ServiceClientsAPIService + clientId string +} + +func (r ApiRequestAccessKeyRequest) Execute() (*ClientAccessKey, *http.Response, error) { + return r.ApiService.RequestAccessKeyExecute(r) +} + +/* +RequestAccessKey Generate service client access key + +Create a new access key for the client or upload a compliant public key, so that a service can authenticate with Authress as that client. Using the client will allow delegation of permission checking of users. Enables machine-to-machine authentication between your services and with your end users. (There is a limit of 5 Active keys per client) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param clientId The unique identifier of the client. + @return ApiRequestAccessKeyRequest +*/ +func (a *ServiceClientsAPIService) RequestAccessKey(ctx context.Context, clientId string) ApiRequestAccessKeyRequest { + return ApiRequestAccessKeyRequest{ + ApiService: a, + ctx: ctx, + clientId: clientId, + } +} + +// Execute executes the request +// @return ClientAccessKey +func (a *ServiceClientsAPIService) RequestAccessKeyExecute(r ApiRequestAccessKeyRequest) (*ClientAccessKey, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ClientAccessKey + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServiceClientsAPIService.RequestAccessKey") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/clients/{clientId}/access-keys" + localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(parameterValueToString(r.clientId, "clientId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.clientId) < 1 { + return localVarReturnValue, nil, reportError("clientId must have at least 1 elements") + } + if strlen(r.clientId) > 64 { + return localVarReturnValue, nil, reportError("clientId must have less than 64 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUpdateClientRequest struct { + ctx context.Context + ApiService *ServiceClientsAPIService + clientId string + client *Client +} + +func (r ApiUpdateClientRequest) Client(client Client) ApiUpdateClientRequest { + r.client = &client + return r +} + +func (r ApiUpdateClientRequest) Execute() (*Client, *http.Response, error) { + return r.ApiService.UpdateClientExecute(r) +} + +/* +UpdateClient Update service client + +Updates a client information. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param clientId The unique identifier for the client. + @return ApiUpdateClientRequest +*/ +func (a *ServiceClientsAPIService) UpdateClient(ctx context.Context, clientId string) ApiUpdateClientRequest { + return ApiUpdateClientRequest{ + ApiService: a, + ctx: ctx, + clientId: clientId, + } +} + +// Execute executes the request +// @return Client +func (a *ServiceClientsAPIService) UpdateClientExecute(r ApiUpdateClientRequest) (*Client, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Client + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServiceClientsAPIService.UpdateClient") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/clients/{clientId}" + localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(parameterValueToString(r.clientId, "clientId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.clientId) < 1 { + return localVarReturnValue, nil, reportError("clientId must have at least 1 elements") + } + if strlen(r.clientId) > 64 { + return localVarReturnValue, nil, reportError("clientId must have less than 64 elements") + } + if r.client == nil { + return localVarReturnValue, nil, reportError("client is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.client + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/src/api/api_tenants.go b/src/api/api_tenants.go new file mode 100644 index 0000000..06ea164 --- /dev/null +++ b/src/api/api_tenants.go @@ -0,0 +1,543 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// TenantsAPIService TenantsAPI service +type TenantsAPIService service + +type ApiCreateTenantRequest struct { + ctx context.Context + ApiService *TenantsAPIService + tenant *Tenant +} + +func (r ApiCreateTenantRequest) Tenant(tenant Tenant) ApiCreateTenantRequest { + r.tenant = &tenant + return r +} + +func (r ApiCreateTenantRequest) Execute() (*Tenant, *http.Response, error) { + return r.ApiService.CreateTenantExecute(r) +} + +/* +CreateTenant Create tenant + +Specify tenant identity details for tenant tracking, separation, and user management. Tenant identifiers are persisted to access tokens created by Authress. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateTenantRequest +*/ +func (a *TenantsAPIService) CreateTenant(ctx context.Context) ApiCreateTenantRequest { + return ApiCreateTenantRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return Tenant +func (a *TenantsAPIService) CreateTenantExecute(r ApiCreateTenantRequest) (*Tenant, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Tenant + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenantsAPIService.CreateTenant") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/tenants" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.tenant == nil { + return localVarReturnValue, nil, reportError("tenant is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.tenant + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDeleteTenantRequest struct { + ctx context.Context + ApiService *TenantsAPIService + tenantId TenantId +} + +func (r ApiDeleteTenantRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteTenantExecute(r) +} + +/* +DeleteTenant Delete tenant + +Delete a tenant. If a connection was created for the tenant then it is deleted as well. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param tenantId The tenantId. + @return ApiDeleteTenantRequest +*/ +func (a *TenantsAPIService) DeleteTenant(ctx context.Context, tenantId TenantId) ApiDeleteTenantRequest { + return ApiDeleteTenantRequest{ + ApiService: a, + ctx: ctx, + tenantId: tenantId, + } +} + +// Execute executes the request +func (a *TenantsAPIService) DeleteTenantExecute(r ApiDeleteTenantRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenantsAPIService.DeleteTenant") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/tenants/{tenantId}" + localVarPath = strings.Replace(localVarPath, "{"+"tenantId"+"}", url.PathEscape(parameterValueToString(r.tenantId, "tenantId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiGetTenantRequest struct { + ctx context.Context + ApiService *TenantsAPIService + tenantId TenantId +} + +func (r ApiGetTenantRequest) Execute() (*Tenant, *http.Response, error) { + return r.ApiService.GetTenantExecute(r) +} + +/* +GetTenant Retrieve tenant + +Get the tenant details for an Authress tenant. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param tenantId The tenantId. + @return ApiGetTenantRequest +*/ +func (a *TenantsAPIService) GetTenant(ctx context.Context, tenantId TenantId) ApiGetTenantRequest { + return ApiGetTenantRequest{ + ApiService: a, + ctx: ctx, + tenantId: tenantId, + } +} + +// Execute executes the request +// @return Tenant +func (a *TenantsAPIService) GetTenantExecute(r ApiGetTenantRequest) (*Tenant, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Tenant + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenantsAPIService.GetTenant") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/tenants/{tenantId}" + localVarPath = strings.Replace(localVarPath, "{"+"tenantId"+"}", url.PathEscape(parameterValueToString(r.tenantId, "tenantId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetTenantsRequest struct { + ctx context.Context + ApiService *TenantsAPIService +} + +func (r ApiGetTenantsRequest) Execute() (*TenantCollection, *http.Response, error) { + return r.ApiService.GetTenantsExecute(r) +} + +/* +GetTenants List tenants + +Returns a paginated tenants list for the account. Only tenants the user has access to are returned. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetTenantsRequest +*/ +func (a *TenantsAPIService) GetTenants(ctx context.Context) ApiGetTenantsRequest { + return ApiGetTenantsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return TenantCollection +func (a *TenantsAPIService) GetTenantsExecute(r ApiGetTenantsRequest) (*TenantCollection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TenantCollection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenantsAPIService.GetTenants") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/tenants" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUpdateTenantRequest struct { + ctx context.Context + ApiService *TenantsAPIService + tenantId TenantId + tenant *Tenant +} + +func (r ApiUpdateTenantRequest) Tenant(tenant Tenant) ApiUpdateTenantRequest { + r.tenant = &tenant + return r +} + +func (r ApiUpdateTenantRequest) Execute() (*Tenant, *http.Response, error) { + return r.ApiService.UpdateTenantExecute(r) +} + +/* +UpdateTenant Update tenant + +Updates the tenants information and linked tenant if it exists. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param tenantId The tenantId. + @return ApiUpdateTenantRequest +*/ +func (a *TenantsAPIService) UpdateTenant(ctx context.Context, tenantId TenantId) ApiUpdateTenantRequest { + return ApiUpdateTenantRequest{ + ApiService: a, + ctx: ctx, + tenantId: tenantId, + } +} + +// Execute executes the request +// @return Tenant +func (a *TenantsAPIService) UpdateTenantExecute(r ApiUpdateTenantRequest) (*Tenant, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Tenant + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenantsAPIService.UpdateTenant") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/tenants/{tenantId}" + localVarPath = strings.Replace(localVarPath, "{"+"tenantId"+"}", url.PathEscape(parameterValueToString(r.tenantId, "tenantId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.tenant == nil { + return localVarReturnValue, nil, reportError("tenant is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.tenant + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/src/api/api_user_permissions.go b/src/api/api_user_permissions.go new file mode 100644 index 0000000..ea7e26e --- /dev/null +++ b/src/api/api_user_permissions.go @@ -0,0 +1,516 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// UserPermissionsAPIService UserPermissionsAPI service +type UserPermissionsAPIService service + +type ApiAuthorizeUserRequest struct { + ctx context.Context + ApiService *UserPermissionsAPIService + userId UserId + resourceUri string + permission Action +} + +func (r ApiAuthorizeUserRequest) Execute() (*http.Response, error) { + return r.ApiService.AuthorizeUserExecute(r) +} + +/* +AuthorizeUser Verify user authorization + +Performs the user authorization check. Does the user have the specified permission to the resource? + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param userId The user identifier to check and verify the permissions of. + @param resourceUri The uri path of a resource to validate, must be URL encoded, uri segments are allowed, the resource must be a full path. + @param permission Permission to check, '*' and scoped permissions can also be checked here. + @return ApiAuthorizeUserRequest +*/ +func (a *UserPermissionsAPIService) AuthorizeUser(ctx context.Context, userId UserId, resourceUri string, permission Action) ApiAuthorizeUserRequest { + return ApiAuthorizeUserRequest{ + ApiService: a, + ctx: ctx, + userId: userId, + resourceUri: resourceUri, + permission: permission, + } +} + +// Execute executes the request +func (a *UserPermissionsAPIService) AuthorizeUserExecute(r ApiAuthorizeUserRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserPermissionsAPIService.AuthorizeUser") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/users/{userId}/resources/{resourceUri}/permissions/{permission}" + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"resourceUri"+"}", url.PathEscape(parameterValueToString(r.resourceUri, "resourceUri")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"permission"+"}", url.PathEscape(parameterValueToString(r.permission, "permission")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.resourceUri) < 1 { + return nil, reportError("resourceUri must have at least 1 elements") + } + if strlen(r.resourceUri) > 512 { + return nil, reportError("resourceUri must have less than 512 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiGetUserPermissionsForResourceRequest struct { + ctx context.Context + ApiService *UserPermissionsAPIService + userId UserId + resourceUri string +} + +func (r ApiGetUserPermissionsForResourceRequest) Execute() (*PermissionCollection, *http.Response, error) { + return r.ApiService.GetUserPermissionsForResourceExecute(r) +} + +/* +GetUserPermissionsForResource Get user permissions for resource + +Get a summary of the permissions a user has to a particular resource. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param userId The user identifier for the user to check permissions. + @param resourceUri The uri path of a resource to validate, must be URL encoded, uri segments are allowed. + @return ApiGetUserPermissionsForResourceRequest +*/ +func (a *UserPermissionsAPIService) GetUserPermissionsForResource(ctx context.Context, userId UserId, resourceUri string) ApiGetUserPermissionsForResourceRequest { + return ApiGetUserPermissionsForResourceRequest{ + ApiService: a, + ctx: ctx, + userId: userId, + resourceUri: resourceUri, + } +} + +// Execute executes the request +// @return PermissionCollection +func (a *UserPermissionsAPIService) GetUserPermissionsForResourceExecute(r ApiGetUserPermissionsForResourceRequest) (*PermissionCollection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PermissionCollection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserPermissionsAPIService.GetUserPermissionsForResource") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/users/{userId}/resources/{resourceUri}/permissions" + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"resourceUri"+"}", url.PathEscape(parameterValueToString(r.resourceUri, "resourceUri")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.resourceUri) < 1 { + return localVarReturnValue, nil, reportError("resourceUri must have at least 1 elements") + } + if strlen(r.resourceUri) > 512 { + return localVarReturnValue, nil, reportError("resourceUri must have less than 512 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetUserResourcesRequest struct { + ctx context.Context + ApiService *UserPermissionsAPIService + userId UserId + resourceUri *string + collectionConfiguration *string + permissions *Action + limit *int32 + cursor *string +} + +// The top level uri path of a resource to query for. Will only match explicit or nested sub-resources. Will not partial match resource names. +func (r ApiGetUserResourcesRequest) ResourceUri(resourceUri string) ApiGetUserResourcesRequest { + r.resourceUri = &resourceUri + return r +} + +// `TOP_LEVEL_ONLY` - returns only directly nested resources under the resourceUri. A query to `resourceUri=Collection` will return `Collection/resource_1`.<br>`INCLUDE_NESTED` - will return all sub-resources as well as deeply nested resources that the user has the specified permission to. A query to `resourceUri=Collection` will return `Collection/namespaces/ns/resources/resource_1`.<br><br>To return matching resources for nested resources, set this parameter to `INCLUDE_NESTED`. +func (r ApiGetUserResourcesRequest) CollectionConfiguration(collectionConfiguration string) ApiGetUserResourcesRequest { + r.collectionConfiguration = &collectionConfiguration + return r +} + +// Permission to check, '*' and scoped permissions can also be checked here. By default if the user has any permission explicitly to a resource, it will be included in the list. +func (r ApiGetUserResourcesRequest) Permissions(permissions Action) ApiGetUserResourcesRequest { + r.permissions = &permissions + return r +} + +// Max number of results to return +func (r ApiGetUserResourcesRequest) Limit(limit int32) ApiGetUserResourcesRequest { + r.limit = &limit + return r +} + +// Continuation cursor for paging +func (r ApiGetUserResourcesRequest) Cursor(cursor string) ApiGetUserResourcesRequest { + r.cursor = &cursor + return r +} + +func (r ApiGetUserResourcesRequest) Execute() (*UserResourcesCollection, *http.Response, error) { + return r.ApiService.GetUserResourcesExecute(r) +} + +/* +GetUserResources List user resources + +Get the users resources. This result is a list of resource uris that a user has an permission to. By default only the top level matching resources are returned. To get a user's list of deeply nested resources, set the `collectionConfiguration` to be `INCLUDE_NESTED`. This collection is paginated. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param userId The user identifier for which to list all accessible resources. + @return ApiGetUserResourcesRequest +*/ +func (a *UserPermissionsAPIService) GetUserResources(ctx context.Context, userId UserId) ApiGetUserResourcesRequest { + return ApiGetUserResourcesRequest{ + ApiService: a, + ctx: ctx, + userId: userId, + } +} + +// Execute executes the request +// @return UserResourcesCollection +func (a *UserPermissionsAPIService) GetUserResourcesExecute(r ApiGetUserResourcesRequest) (*UserResourcesCollection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserResourcesCollection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserPermissionsAPIService.GetUserResources") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/users/{userId}/resources" + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.resourceUri != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "resourceUri", r.resourceUri, "") + } + if r.collectionConfiguration != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "collectionConfiguration", r.collectionConfiguration, "") + } else { + var defaultValue string = "TOP_LEVEL_ONLY" + r.collectionConfiguration = &defaultValue + } + if r.permissions != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "permissions", r.permissions, "") + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } else { + var defaultValue int32 = 20 + r.limit = &defaultValue + } + if r.cursor != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cursor", r.cursor, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetUserRolesForResourceRequest struct { + ctx context.Context + ApiService *UserPermissionsAPIService + userId UserId + resourceUri string +} + +func (r ApiGetUserRolesForResourceRequest) Execute() (*UserRoleCollection, *http.Response, error) { + return r.ApiService.GetUserRolesForResourceExecute(r) +} + +/* +GetUserRolesForResource Get user roles for resource + +Get a summary of the roles a user has to a particular resource. Users can be assigned roles from multiple access records, this may cause the same role to appear in the list more than once. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param userId The user to get roles for. + @param resourceUri The uri path of a resource to get roles for, must be URL encoded. Checks for explicit resource roles, roles attached to parent resources are not returned. + @return ApiGetUserRolesForResourceRequest +*/ +func (a *UserPermissionsAPIService) GetUserRolesForResource(ctx context.Context, userId UserId, resourceUri string) ApiGetUserRolesForResourceRequest { + return ApiGetUserRolesForResourceRequest{ + ApiService: a, + ctx: ctx, + userId: userId, + resourceUri: resourceUri, + } +} + +// Execute executes the request +// @return UserRoleCollection +func (a *UserPermissionsAPIService) GetUserRolesForResourceExecute(r ApiGetUserRolesForResourceRequest) (*UserRoleCollection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserRoleCollection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserPermissionsAPIService.GetUserRolesForResource") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/users/{userId}/resources/{resourceUri}/roles" + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"resourceUri"+"}", url.PathEscape(parameterValueToString(r.resourceUri, "resourceUri")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.resourceUri) < 1 { + return localVarReturnValue, nil, reportError("resourceUri must have at least 1 elements") + } + if strlen(r.resourceUri) > 512 { + return localVarReturnValue, nil, reportError("resourceUri must have less than 512 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/src/api/api_users.go b/src/api/api_users.go new file mode 100644 index 0000000..880d4a8 --- /dev/null +++ b/src/api/api_users.go @@ -0,0 +1,362 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// UsersAPIService UsersAPI service +type UsersAPIService service + +type ApiDeleteUserRequest struct { + ctx context.Context + ApiService *UsersAPIService + userId UserId +} + +func (r ApiDeleteUserRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteUserExecute(r) +} + +/* +DeleteUser Delete a user + +Removes the user, all access the user has been granted through Authress access records, and any related user data. This action is completed asynchronously. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param userId The user identifier. + @return ApiDeleteUserRequest +*/ +func (a *UsersAPIService) DeleteUser(ctx context.Context, userId UserId) ApiDeleteUserRequest { + return ApiDeleteUserRequest{ + ApiService: a, + ctx: ctx, + userId: userId, + } +} + +// Execute executes the request +func (a *UsersAPIService) DeleteUserExecute(r ApiDeleteUserRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.DeleteUser") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/users/{userId}" + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiGetUserRequest struct { + ctx context.Context + ApiService *UsersAPIService + userId UserId +} + +func (r ApiGetUserRequest) Execute() (*UserIdentity, *http.Response, error) { + return r.ApiService.GetUserExecute(r) +} + +/* +GetUser Retrieve a user + +Get the user data associated with a user. The data returned by this endpoint is highly variable based on the source OAuth provider. Avoid depending on undocumented properties. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param userId The user identifier. + @return ApiGetUserRequest +*/ +func (a *UsersAPIService) GetUser(ctx context.Context, userId UserId) ApiGetUserRequest { + return ApiGetUserRequest{ + ApiService: a, + ctx: ctx, + userId: userId, + } +} + +// Execute executes the request +// @return UserIdentity +func (a *UsersAPIService) GetUserExecute(r ApiGetUserRequest) (*UserIdentity, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserIdentity + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.GetUser") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/users/{userId}" + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetUsersRequest struct { + ctx context.Context + ApiService *UsersAPIService + limit *int32 + cursor *string + filter *string + tenantId *TenantId +} + +// Max number of results to return +func (r ApiGetUsersRequest) Limit(limit int32) ApiGetUsersRequest { + r.limit = &limit + return r +} + +// Continuation cursor for paging +func (r ApiGetUsersRequest) Cursor(cursor string) ApiGetUsersRequest { + r.cursor = &cursor + return r +} + +// Filter to search users by. This is a case insensitive search through every text field. +func (r ApiGetUsersRequest) Filter(filter string) ApiGetUsersRequest { + r.filter = &filter + return r +} + +// Return only users that are part of the specified tenant. Users can only be part of one tenant, using this parameter will limit returned users that have logged into this tenant. +func (r ApiGetUsersRequest) TenantId(tenantId TenantId) ApiGetUsersRequest { + r.tenantId = &tenantId + return r +} + +func (r ApiGetUsersRequest) Execute() (*UserIdentityCollection, *http.Response, error) { + return r.ApiService.GetUsersExecute(r) +} + +/* +GetUsers List users + +Returns a paginated user list for the account. The data returned by this endpoint is highly variable based on the source OAuth provider. Avoid depending on undocumented properties. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetUsersRequest +*/ +func (a *UsersAPIService) GetUsers(ctx context.Context) ApiGetUsersRequest { + return ApiGetUsersRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return UserIdentityCollection +func (a *UsersAPIService) GetUsersExecute(r ApiGetUsersRequest) (*UserIdentityCollection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserIdentityCollection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersAPIService.GetUsers") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/users" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } else { + var defaultValue int32 = 100 + r.limit = &defaultValue + } + if r.cursor != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cursor", r.cursor, "") + } + if r.filter != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "filter", r.filter, "") + } + if r.tenantId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "tenantId", r.tenantId, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/links+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/src/client.go b/src/client.go new file mode 100644 index 0000000..aec5bbf --- /dev/null +++ b/src/client.go @@ -0,0 +1,702 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`) + XmlCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Authress API vv1 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + AccessRecordsAPI *AccessRecordsAPIService + + AccountsAPI *AccountsAPIService + + ApplicationsAPI *ApplicationsAPIService + + ConnectionsAPI *ConnectionsAPIService + + ExtensionsAPI *ExtensionsAPIService + + GroupsAPI *GroupsAPIService + + InvitesAPI *InvitesAPIService + + ResourcePermissionsAPI *ResourcePermissionsAPIService + + RolesAPI *RolesAPIService + + ServiceClientsAPI *ServiceClientsAPIService + + TenantsAPI *TenantsAPIService + + UserPermissionsAPI *UserPermissionsAPIService + + UsersAPI *UsersAPIService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.AccessRecordsAPI = (*AccessRecordsAPIService)(&c.common) + c.AccountsAPI = (*AccountsAPIService)(&c.common) + c.ApplicationsAPI = (*ApplicationsAPIService)(&c.common) + c.ConnectionsAPI = (*ConnectionsAPIService)(&c.common) + c.ExtensionsAPI = (*ExtensionsAPIService)(&c.common) + c.GroupsAPI = (*GroupsAPIService)(&c.common) + c.InvitesAPI = (*InvitesAPIService)(&c.common) + c.ResourcePermissionsAPI = (*ResourcePermissionsAPIService)(&c.common) + c.RolesAPI = (*RolesAPIService)(&c.common) + c.ServiceClientsAPI = (*ServiceClientsAPIService)(&c.common) + c.TenantsAPI = (*TenantsAPIService)(&c.common) + c.UserPermissionsAPI = (*UserPermissionsAPIService)(&c.common) + c.UsersAPI = (*UsersAPIService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextAccessToken takes a string oauth2 access token as authentication for the request. + ContextAccessToken = contextKey("accesstoken") + + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/99.99.99/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/src/models/model_access_record.go b/src/models/model_access_record.go new file mode 100644 index 0000000..bfdf53c --- /dev/null +++ b/src/models/model_access_record.go @@ -0,0 +1,609 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "time" + "bytes" + "fmt" +) + +// checks if the AccessRecord type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AccessRecord{} + +// AccessRecord The access record which links users to roles. +type AccessRecord struct { + // Unique identifier for the record, can be specified on record creation. + RecordId *string `json:"recordId,omitempty"` + // A helpful name for this record + Name string `json:"name"` + // More details about this record + Description NullableString `json:"description,omitempty"` + // Percentage capacity of record that is filled. + Capacity *float32 `json:"capacity,omitempty"` + // The expected last time the record was updated + LastUpdated *time.Time `json:"lastUpdated,omitempty"` + // Current status of the access record. + Status *string `json:"status,omitempty"` + Account *AccessRecordAccount `json:"account,omitempty"` + // The list of users this record applies to + Users []User `json:"users,omitempty"` + // The list of admin that can edit this record even if they do not have global record edit permissions. + Admins []User `json:"admins,omitempty"` + // The list of groups this record applies to. Users in these groups will be receive access to the resources listed. + Groups []LinkedGroup `json:"groups,omitempty"` + // A list of statements which match roles to resources. + Statements []Statement `json:"statements"` + Links *AccountLinks `json:"links,omitempty"` + // The tags associated with this resource, this property is an map. { key1: value1, key2: value2 } + Tags map[string]string `json:"tags,omitempty"` +} + +type _AccessRecord AccessRecord + +// NewAccessRecord instantiates a new AccessRecord object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAccessRecord(name string, statements []Statement) *AccessRecord { + this := AccessRecord{} + this.Name = name + this.Statements = statements + return &this +} + +// NewAccessRecordWithDefaults instantiates a new AccessRecord object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAccessRecordWithDefaults() *AccessRecord { + this := AccessRecord{} + return &this +} + +// GetRecordId returns the RecordId field value if set, zero value otherwise. +func (o *AccessRecord) GetRecordId() string { + if o == nil || IsNil(o.RecordId) { + var ret string + return ret + } + return *o.RecordId +} + +// GetRecordIdOk returns a tuple with the RecordId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccessRecord) GetRecordIdOk() (*string, bool) { + if o == nil || IsNil(o.RecordId) { + return nil, false + } + return o.RecordId, true +} + +// HasRecordId returns a boolean if a field has been set. +func (o *AccessRecord) HasRecordId() bool { + if o != nil && !IsNil(o.RecordId) { + return true + } + + return false +} + +// SetRecordId gets a reference to the given string and assigns it to the RecordId field. +func (o *AccessRecord) SetRecordId(v string) { + o.RecordId = &v +} + +// GetName returns the Name field value +func (o *AccessRecord) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *AccessRecord) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *AccessRecord) SetName(v string) { + o.Name = v +} + +// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AccessRecord) GetDescription() string { + if o == nil || IsNil(o.Description.Get()) { + var ret string + return ret + } + return *o.Description.Get() +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AccessRecord) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Description.Get(), o.Description.IsSet() +} + +// HasDescription returns a boolean if a field has been set. +func (o *AccessRecord) HasDescription() bool { + if o != nil && o.Description.IsSet() { + return true + } + + return false +} + +// SetDescription gets a reference to the given NullableString and assigns it to the Description field. +func (o *AccessRecord) SetDescription(v string) { + o.Description.Set(&v) +} +// SetDescriptionNil sets the value for Description to be an explicit nil +func (o *AccessRecord) SetDescriptionNil() { + o.Description.Set(nil) +} + +// UnsetDescription ensures that no value is present for Description, not even an explicit nil +func (o *AccessRecord) UnsetDescription() { + o.Description.Unset() +} + +// GetCapacity returns the Capacity field value if set, zero value otherwise. +func (o *AccessRecord) GetCapacity() float32 { + if o == nil || IsNil(o.Capacity) { + var ret float32 + return ret + } + return *o.Capacity +} + +// GetCapacityOk returns a tuple with the Capacity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccessRecord) GetCapacityOk() (*float32, bool) { + if o == nil || IsNil(o.Capacity) { + return nil, false + } + return o.Capacity, true +} + +// HasCapacity returns a boolean if a field has been set. +func (o *AccessRecord) HasCapacity() bool { + if o != nil && !IsNil(o.Capacity) { + return true + } + + return false +} + +// SetCapacity gets a reference to the given float32 and assigns it to the Capacity field. +func (o *AccessRecord) SetCapacity(v float32) { + o.Capacity = &v +} + +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise. +func (o *AccessRecord) GetLastUpdated() time.Time { + if o == nil || IsNil(o.LastUpdated) { + var ret time.Time + return ret + } + return *o.LastUpdated +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccessRecord) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil || IsNil(o.LastUpdated) { + return nil, false + } + return o.LastUpdated, true +} + +// HasLastUpdated returns a boolean if a field has been set. +func (o *AccessRecord) HasLastUpdated() bool { + if o != nil && !IsNil(o.LastUpdated) { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given time.Time and assigns it to the LastUpdated field. +func (o *AccessRecord) SetLastUpdated(v time.Time) { + o.LastUpdated = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *AccessRecord) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccessRecord) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *AccessRecord) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *AccessRecord) SetStatus(v string) { + o.Status = &v +} + +// GetAccount returns the Account field value if set, zero value otherwise. +func (o *AccessRecord) GetAccount() AccessRecordAccount { + if o == nil || IsNil(o.Account) { + var ret AccessRecordAccount + return ret + } + return *o.Account +} + +// GetAccountOk returns a tuple with the Account field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccessRecord) GetAccountOk() (*AccessRecordAccount, bool) { + if o == nil || IsNil(o.Account) { + return nil, false + } + return o.Account, true +} + +// HasAccount returns a boolean if a field has been set. +func (o *AccessRecord) HasAccount() bool { + if o != nil && !IsNil(o.Account) { + return true + } + + return false +} + +// SetAccount gets a reference to the given AccessRecordAccount and assigns it to the Account field. +func (o *AccessRecord) SetAccount(v AccessRecordAccount) { + o.Account = &v +} + +// GetUsers returns the Users field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AccessRecord) GetUsers() []User { + if o == nil { + var ret []User + return ret + } + return o.Users +} + +// GetUsersOk returns a tuple with the Users field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AccessRecord) GetUsersOk() ([]User, bool) { + if o == nil || IsNil(o.Users) { + return nil, false + } + return o.Users, true +} + +// HasUsers returns a boolean if a field has been set. +func (o *AccessRecord) HasUsers() bool { + if o != nil && IsNil(o.Users) { + return true + } + + return false +} + +// SetUsers gets a reference to the given []User and assigns it to the Users field. +func (o *AccessRecord) SetUsers(v []User) { + o.Users = v +} + +// GetAdmins returns the Admins field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AccessRecord) GetAdmins() []User { + if o == nil { + var ret []User + return ret + } + return o.Admins +} + +// GetAdminsOk returns a tuple with the Admins field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AccessRecord) GetAdminsOk() ([]User, bool) { + if o == nil || IsNil(o.Admins) { + return nil, false + } + return o.Admins, true +} + +// HasAdmins returns a boolean if a field has been set. +func (o *AccessRecord) HasAdmins() bool { + if o != nil && IsNil(o.Admins) { + return true + } + + return false +} + +// SetAdmins gets a reference to the given []User and assigns it to the Admins field. +func (o *AccessRecord) SetAdmins(v []User) { + o.Admins = v +} + +// GetGroups returns the Groups field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AccessRecord) GetGroups() []LinkedGroup { + if o == nil { + var ret []LinkedGroup + return ret + } + return o.Groups +} + +// GetGroupsOk returns a tuple with the Groups field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AccessRecord) GetGroupsOk() ([]LinkedGroup, bool) { + if o == nil || IsNil(o.Groups) { + return nil, false + } + return o.Groups, true +} + +// HasGroups returns a boolean if a field has been set. +func (o *AccessRecord) HasGroups() bool { + if o != nil && IsNil(o.Groups) { + return true + } + + return false +} + +// SetGroups gets a reference to the given []LinkedGroup and assigns it to the Groups field. +func (o *AccessRecord) SetGroups(v []LinkedGroup) { + o.Groups = v +} + +// GetStatements returns the Statements field value +func (o *AccessRecord) GetStatements() []Statement { + if o == nil { + var ret []Statement + return ret + } + + return o.Statements +} + +// GetStatementsOk returns a tuple with the Statements field value +// and a boolean to check if the value has been set. +func (o *AccessRecord) GetStatementsOk() ([]Statement, bool) { + if o == nil { + return nil, false + } + return o.Statements, true +} + +// SetStatements sets field value +func (o *AccessRecord) SetStatements(v []Statement) { + o.Statements = v +} + +// GetLinks returns the Links field value if set, zero value otherwise. +func (o *AccessRecord) GetLinks() AccountLinks { + if o == nil || IsNil(o.Links) { + var ret AccountLinks + return ret + } + return *o.Links +} + +// GetLinksOk returns a tuple with the Links field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccessRecord) GetLinksOk() (*AccountLinks, bool) { + if o == nil || IsNil(o.Links) { + return nil, false + } + return o.Links, true +} + +// HasLinks returns a boolean if a field has been set. +func (o *AccessRecord) HasLinks() bool { + if o != nil && !IsNil(o.Links) { + return true + } + + return false +} + +// SetLinks gets a reference to the given AccountLinks and assigns it to the Links field. +func (o *AccessRecord) SetLinks(v AccountLinks) { + o.Links = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AccessRecord) GetTags() map[string]string { + if o == nil { + var ret map[string]string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AccessRecord) GetTagsOk() (*map[string]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return &o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *AccessRecord) HasTags() bool { + if o != nil && IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given map[string]string and assigns it to the Tags field. +func (o *AccessRecord) SetTags(v map[string]string) { + o.Tags = v +} + +func (o AccessRecord) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AccessRecord) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.RecordId) { + toSerialize["recordId"] = o.RecordId + } + toSerialize["name"] = o.Name + if o.Description.IsSet() { + toSerialize["description"] = o.Description.Get() + } + if !IsNil(o.Capacity) { + toSerialize["capacity"] = o.Capacity + } + if !IsNil(o.LastUpdated) { + toSerialize["lastUpdated"] = o.LastUpdated + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.Account) { + toSerialize["account"] = o.Account + } + if o.Users != nil { + toSerialize["users"] = o.Users + } + if o.Admins != nil { + toSerialize["admins"] = o.Admins + } + if o.Groups != nil { + toSerialize["groups"] = o.Groups + } + toSerialize["statements"] = o.Statements + if !IsNil(o.Links) { + toSerialize["links"] = o.Links + } + if o.Tags != nil { + toSerialize["tags"] = o.Tags + } + return toSerialize, nil +} + +func (o *AccessRecord) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "statements", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAccessRecord := _AccessRecord{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varAccessRecord) + + if err != nil { + return err + } + + *o = AccessRecord(varAccessRecord) + + return err +} + +type NullableAccessRecord struct { + value *AccessRecord + isSet bool +} + +func (v NullableAccessRecord) Get() *AccessRecord { + return v.value +} + +func (v *NullableAccessRecord) Set(val *AccessRecord) { + v.value = val + v.isSet = true +} + +func (v NullableAccessRecord) IsSet() bool { + return v.isSet +} + +func (v *NullableAccessRecord) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAccessRecord(val *AccessRecord) *NullableAccessRecord { + return &NullableAccessRecord{value: val, isSet: true} +} + +func (v NullableAccessRecord) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAccessRecord) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_access_record_account.go b/src/models/model_access_record_account.go new file mode 100644 index 0000000..ce10675 --- /dev/null +++ b/src/models/model_access_record_account.go @@ -0,0 +1,159 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the AccessRecordAccount type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AccessRecordAccount{} + +// AccessRecordAccount struct for AccessRecordAccount +type AccessRecordAccount struct { + AccountId string `json:"accountId"` +} + +type _AccessRecordAccount AccessRecordAccount + +// NewAccessRecordAccount instantiates a new AccessRecordAccount object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAccessRecordAccount(accountId string) *AccessRecordAccount { + this := AccessRecordAccount{} + this.AccountId = accountId + return &this +} + +// NewAccessRecordAccountWithDefaults instantiates a new AccessRecordAccount object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAccessRecordAccountWithDefaults() *AccessRecordAccount { + this := AccessRecordAccount{} + return &this +} + +// GetAccountId returns the AccountId field value +func (o *AccessRecordAccount) GetAccountId() string { + if o == nil { + var ret string + return ret + } + + return o.AccountId +} + +// GetAccountIdOk returns a tuple with the AccountId field value +// and a boolean to check if the value has been set. +func (o *AccessRecordAccount) GetAccountIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountId, true +} + +// SetAccountId sets field value +func (o *AccessRecordAccount) SetAccountId(v string) { + o.AccountId = v +} + +func (o AccessRecordAccount) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AccessRecordAccount) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountId"] = o.AccountId + return toSerialize, nil +} + +func (o *AccessRecordAccount) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "accountId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAccessRecordAccount := _AccessRecordAccount{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varAccessRecordAccount) + + if err != nil { + return err + } + + *o = AccessRecordAccount(varAccessRecordAccount) + + return err +} + +type NullableAccessRecordAccount struct { + value *AccessRecordAccount + isSet bool +} + +func (v NullableAccessRecordAccount) Get() *AccessRecordAccount { + return v.value +} + +func (v *NullableAccessRecordAccount) Set(val *AccessRecordAccount) { + v.value = val + v.isSet = true +} + +func (v NullableAccessRecordAccount) IsSet() bool { + return v.isSet +} + +func (v *NullableAccessRecordAccount) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAccessRecordAccount(val *AccessRecordAccount) *NullableAccessRecordAccount { + return &NullableAccessRecordAccount{value: val, isSet: true} +} + +func (v NullableAccessRecordAccount) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAccessRecordAccount) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_access_record_collection.go b/src/models/model_access_record_collection.go new file mode 100644 index 0000000..9dd6828 --- /dev/null +++ b/src/models/model_access_record_collection.go @@ -0,0 +1,224 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the AccessRecordCollection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AccessRecordCollection{} + +// AccessRecordCollection A collection of access records +type AccessRecordCollection struct { + // A list of access records + Records []AccessRecord `json:"records"` + Pagination *Pagination `json:"pagination,omitempty"` + Links CollectionLinks `json:"links"` +} + +type _AccessRecordCollection AccessRecordCollection + +// NewAccessRecordCollection instantiates a new AccessRecordCollection object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAccessRecordCollection(records []AccessRecord, links CollectionLinks) *AccessRecordCollection { + this := AccessRecordCollection{} + this.Records = records + this.Links = links + return &this +} + +// NewAccessRecordCollectionWithDefaults instantiates a new AccessRecordCollection object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAccessRecordCollectionWithDefaults() *AccessRecordCollection { + this := AccessRecordCollection{} + return &this +} + +// GetRecords returns the Records field value +func (o *AccessRecordCollection) GetRecords() []AccessRecord { + if o == nil { + var ret []AccessRecord + return ret + } + + return o.Records +} + +// GetRecordsOk returns a tuple with the Records field value +// and a boolean to check if the value has been set. +func (o *AccessRecordCollection) GetRecordsOk() ([]AccessRecord, bool) { + if o == nil { + return nil, false + } + return o.Records, true +} + +// SetRecords sets field value +func (o *AccessRecordCollection) SetRecords(v []AccessRecord) { + o.Records = v +} + +// GetPagination returns the Pagination field value if set, zero value otherwise. +func (o *AccessRecordCollection) GetPagination() Pagination { + if o == nil || IsNil(o.Pagination) { + var ret Pagination + return ret + } + return *o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccessRecordCollection) GetPaginationOk() (*Pagination, bool) { + if o == nil || IsNil(o.Pagination) { + return nil, false + } + return o.Pagination, true +} + +// HasPagination returns a boolean if a field has been set. +func (o *AccessRecordCollection) HasPagination() bool { + if o != nil && !IsNil(o.Pagination) { + return true + } + + return false +} + +// SetPagination gets a reference to the given Pagination and assigns it to the Pagination field. +func (o *AccessRecordCollection) SetPagination(v Pagination) { + o.Pagination = &v +} + +// GetLinks returns the Links field value +func (o *AccessRecordCollection) GetLinks() CollectionLinks { + if o == nil { + var ret CollectionLinks + return ret + } + + return o.Links +} + +// GetLinksOk returns a tuple with the Links field value +// and a boolean to check if the value has been set. +func (o *AccessRecordCollection) GetLinksOk() (*CollectionLinks, bool) { + if o == nil { + return nil, false + } + return &o.Links, true +} + +// SetLinks sets field value +func (o *AccessRecordCollection) SetLinks(v CollectionLinks) { + o.Links = v +} + +func (o AccessRecordCollection) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AccessRecordCollection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["records"] = o.Records + if !IsNil(o.Pagination) { + toSerialize["pagination"] = o.Pagination + } + toSerialize["links"] = o.Links + return toSerialize, nil +} + +func (o *AccessRecordCollection) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "records", + "links", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAccessRecordCollection := _AccessRecordCollection{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varAccessRecordCollection) + + if err != nil { + return err + } + + *o = AccessRecordCollection(varAccessRecordCollection) + + return err +} + +type NullableAccessRecordCollection struct { + value *AccessRecordCollection + isSet bool +} + +func (v NullableAccessRecordCollection) Get() *AccessRecordCollection { + return v.value +} + +func (v *NullableAccessRecordCollection) Set(val *AccessRecordCollection) { + v.value = val + v.isSet = true +} + +func (v NullableAccessRecordCollection) IsSet() bool { + return v.isSet +} + +func (v *NullableAccessRecordCollection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAccessRecordCollection(val *AccessRecordCollection) *NullableAccessRecordCollection { + return &NullableAccessRecordCollection{value: val, isSet: true} +} + +func (v NullableAccessRecordCollection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAccessRecordCollection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_access_request.go b/src/models/model_access_request.go new file mode 100644 index 0000000..68248d1 --- /dev/null +++ b/src/models/model_access_request.go @@ -0,0 +1,337 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "time" + "bytes" + "fmt" +) + +// checks if the AccessRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AccessRequest{} + +// AccessRequest The access requested by a user. +type AccessRequest struct { + // Unique identifier for the request. + RequestId string `json:"requestId"` + // The expected last time the request was updated + LastUpdated *time.Time `json:"lastUpdated,omitempty"` + // Current status of the access request. + Status *string `json:"status,omitempty"` + Access AccessTemplate `json:"access"` + Links *AccountLinks `json:"links,omitempty"` + // The tags associated with this resource, this property is an map. { key1: value1, key2: value2 } + Tags map[string]string `json:"tags,omitempty"` +} + +type _AccessRequest AccessRequest + +// NewAccessRequest instantiates a new AccessRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAccessRequest(requestId string, access AccessTemplate) *AccessRequest { + this := AccessRequest{} + this.RequestId = requestId + this.Access = access + return &this +} + +// NewAccessRequestWithDefaults instantiates a new AccessRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAccessRequestWithDefaults() *AccessRequest { + this := AccessRequest{} + return &this +} + +// GetRequestId returns the RequestId field value +func (o *AccessRequest) GetRequestId() string { + if o == nil { + var ret string + return ret + } + + return o.RequestId +} + +// GetRequestIdOk returns a tuple with the RequestId field value +// and a boolean to check if the value has been set. +func (o *AccessRequest) GetRequestIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RequestId, true +} + +// SetRequestId sets field value +func (o *AccessRequest) SetRequestId(v string) { + o.RequestId = v +} + +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise. +func (o *AccessRequest) GetLastUpdated() time.Time { + if o == nil || IsNil(o.LastUpdated) { + var ret time.Time + return ret + } + return *o.LastUpdated +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccessRequest) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil || IsNil(o.LastUpdated) { + return nil, false + } + return o.LastUpdated, true +} + +// HasLastUpdated returns a boolean if a field has been set. +func (o *AccessRequest) HasLastUpdated() bool { + if o != nil && !IsNil(o.LastUpdated) { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given time.Time and assigns it to the LastUpdated field. +func (o *AccessRequest) SetLastUpdated(v time.Time) { + o.LastUpdated = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *AccessRequest) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccessRequest) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *AccessRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *AccessRequest) SetStatus(v string) { + o.Status = &v +} + +// GetAccess returns the Access field value +func (o *AccessRequest) GetAccess() AccessTemplate { + if o == nil { + var ret AccessTemplate + return ret + } + + return o.Access +} + +// GetAccessOk returns a tuple with the Access field value +// and a boolean to check if the value has been set. +func (o *AccessRequest) GetAccessOk() (*AccessTemplate, bool) { + if o == nil { + return nil, false + } + return &o.Access, true +} + +// SetAccess sets field value +func (o *AccessRequest) SetAccess(v AccessTemplate) { + o.Access = v +} + +// GetLinks returns the Links field value if set, zero value otherwise. +func (o *AccessRequest) GetLinks() AccountLinks { + if o == nil || IsNil(o.Links) { + var ret AccountLinks + return ret + } + return *o.Links +} + +// GetLinksOk returns a tuple with the Links field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccessRequest) GetLinksOk() (*AccountLinks, bool) { + if o == nil || IsNil(o.Links) { + return nil, false + } + return o.Links, true +} + +// HasLinks returns a boolean if a field has been set. +func (o *AccessRequest) HasLinks() bool { + if o != nil && !IsNil(o.Links) { + return true + } + + return false +} + +// SetLinks gets a reference to the given AccountLinks and assigns it to the Links field. +func (o *AccessRequest) SetLinks(v AccountLinks) { + o.Links = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AccessRequest) GetTags() map[string]string { + if o == nil { + var ret map[string]string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AccessRequest) GetTagsOk() (*map[string]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return &o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *AccessRequest) HasTags() bool { + if o != nil && IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given map[string]string and assigns it to the Tags field. +func (o *AccessRequest) SetTags(v map[string]string) { + o.Tags = v +} + +func (o AccessRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AccessRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["requestId"] = o.RequestId + if !IsNil(o.LastUpdated) { + toSerialize["lastUpdated"] = o.LastUpdated + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + toSerialize["access"] = o.Access + if !IsNil(o.Links) { + toSerialize["links"] = o.Links + } + if o.Tags != nil { + toSerialize["tags"] = o.Tags + } + return toSerialize, nil +} + +func (o *AccessRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "requestId", + "access", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAccessRequest := _AccessRequest{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varAccessRequest) + + if err != nil { + return err + } + + *o = AccessRequest(varAccessRequest) + + return err +} + +type NullableAccessRequest struct { + value *AccessRequest + isSet bool +} + +func (v NullableAccessRequest) Get() *AccessRequest { + return v.value +} + +func (v *NullableAccessRequest) Set(val *AccessRequest) { + v.value = val + v.isSet = true +} + +func (v NullableAccessRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableAccessRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAccessRequest(val *AccessRequest) *NullableAccessRequest { + return &NullableAccessRequest{value: val, isSet: true} +} + +func (v NullableAccessRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAccessRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_access_request_collection.go b/src/models/model_access_request_collection.go new file mode 100644 index 0000000..f095e45 --- /dev/null +++ b/src/models/model_access_request_collection.go @@ -0,0 +1,232 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the AccessRequestCollection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AccessRequestCollection{} + +// AccessRequestCollection A collection of access requests +type AccessRequestCollection struct { + // A list of access requests + Records []AccessRequest `json:"records,omitempty"` + Pagination *Pagination `json:"pagination,omitempty"` + Links CollectionLinks `json:"links"` +} + +type _AccessRequestCollection AccessRequestCollection + +// NewAccessRequestCollection instantiates a new AccessRequestCollection object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAccessRequestCollection(links CollectionLinks) *AccessRequestCollection { + this := AccessRequestCollection{} + this.Links = links + return &this +} + +// NewAccessRequestCollectionWithDefaults instantiates a new AccessRequestCollection object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAccessRequestCollectionWithDefaults() *AccessRequestCollection { + this := AccessRequestCollection{} + return &this +} + +// GetRecords returns the Records field value if set, zero value otherwise. +func (o *AccessRequestCollection) GetRecords() []AccessRequest { + if o == nil || IsNil(o.Records) { + var ret []AccessRequest + return ret + } + return o.Records +} + +// GetRecordsOk returns a tuple with the Records field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccessRequestCollection) GetRecordsOk() ([]AccessRequest, bool) { + if o == nil || IsNil(o.Records) { + return nil, false + } + return o.Records, true +} + +// HasRecords returns a boolean if a field has been set. +func (o *AccessRequestCollection) HasRecords() bool { + if o != nil && !IsNil(o.Records) { + return true + } + + return false +} + +// SetRecords gets a reference to the given []AccessRequest and assigns it to the Records field. +func (o *AccessRequestCollection) SetRecords(v []AccessRequest) { + o.Records = v +} + +// GetPagination returns the Pagination field value if set, zero value otherwise. +func (o *AccessRequestCollection) GetPagination() Pagination { + if o == nil || IsNil(o.Pagination) { + var ret Pagination + return ret + } + return *o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccessRequestCollection) GetPaginationOk() (*Pagination, bool) { + if o == nil || IsNil(o.Pagination) { + return nil, false + } + return o.Pagination, true +} + +// HasPagination returns a boolean if a field has been set. +func (o *AccessRequestCollection) HasPagination() bool { + if o != nil && !IsNil(o.Pagination) { + return true + } + + return false +} + +// SetPagination gets a reference to the given Pagination and assigns it to the Pagination field. +func (o *AccessRequestCollection) SetPagination(v Pagination) { + o.Pagination = &v +} + +// GetLinks returns the Links field value +func (o *AccessRequestCollection) GetLinks() CollectionLinks { + if o == nil { + var ret CollectionLinks + return ret + } + + return o.Links +} + +// GetLinksOk returns a tuple with the Links field value +// and a boolean to check if the value has been set. +func (o *AccessRequestCollection) GetLinksOk() (*CollectionLinks, bool) { + if o == nil { + return nil, false + } + return &o.Links, true +} + +// SetLinks sets field value +func (o *AccessRequestCollection) SetLinks(v CollectionLinks) { + o.Links = v +} + +func (o AccessRequestCollection) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AccessRequestCollection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Records) { + toSerialize["records"] = o.Records + } + if !IsNil(o.Pagination) { + toSerialize["pagination"] = o.Pagination + } + toSerialize["links"] = o.Links + return toSerialize, nil +} + +func (o *AccessRequestCollection) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "links", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAccessRequestCollection := _AccessRequestCollection{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varAccessRequestCollection) + + if err != nil { + return err + } + + *o = AccessRequestCollection(varAccessRequestCollection) + + return err +} + +type NullableAccessRequestCollection struct { + value *AccessRequestCollection + isSet bool +} + +func (v NullableAccessRequestCollection) Get() *AccessRequestCollection { + return v.value +} + +func (v *NullableAccessRequestCollection) Set(val *AccessRequestCollection) { + v.value = val + v.isSet = true +} + +func (v NullableAccessRequestCollection) IsSet() bool { + return v.isSet +} + +func (v *NullableAccessRequestCollection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAccessRequestCollection(val *AccessRequestCollection) *NullableAccessRequestCollection { + return &NullableAccessRequestCollection{value: val, isSet: true} +} + +func (v NullableAccessRequestCollection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAccessRequestCollection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_access_request_response.go b/src/models/model_access_request_response.go new file mode 100644 index 0000000..0a03fcb --- /dev/null +++ b/src/models/model_access_request_response.go @@ -0,0 +1,160 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the AccessRequestResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AccessRequestResponse{} + +// AccessRequestResponse A dynamic body to support request PATCH operations +type AccessRequestResponse struct { + // New result, either approve or deny the request + Status string `json:"status"` +} + +type _AccessRequestResponse AccessRequestResponse + +// NewAccessRequestResponse instantiates a new AccessRequestResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAccessRequestResponse(status string) *AccessRequestResponse { + this := AccessRequestResponse{} + this.Status = status + return &this +} + +// NewAccessRequestResponseWithDefaults instantiates a new AccessRequestResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAccessRequestResponseWithDefaults() *AccessRequestResponse { + this := AccessRequestResponse{} + return &this +} + +// GetStatus returns the Status field value +func (o *AccessRequestResponse) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *AccessRequestResponse) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *AccessRequestResponse) SetStatus(v string) { + o.Status = v +} + +func (o AccessRequestResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AccessRequestResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["status"] = o.Status + return toSerialize, nil +} + +func (o *AccessRequestResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "status", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAccessRequestResponse := _AccessRequestResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varAccessRequestResponse) + + if err != nil { + return err + } + + *o = AccessRequestResponse(varAccessRequestResponse) + + return err +} + +type NullableAccessRequestResponse struct { + value *AccessRequestResponse + isSet bool +} + +func (v NullableAccessRequestResponse) Get() *AccessRequestResponse { + return v.value +} + +func (v *NullableAccessRequestResponse) Set(val *AccessRequestResponse) { + v.value = val + v.isSet = true +} + +func (v NullableAccessRequestResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableAccessRequestResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAccessRequestResponse(val *AccessRequestResponse) *NullableAccessRequestResponse { + return &NullableAccessRequestResponse{value: val, isSet: true} +} + +func (v NullableAccessRequestResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAccessRequestResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_access_template.go b/src/models/model_access_template.go new file mode 100644 index 0000000..26da257 --- /dev/null +++ b/src/models/model_access_template.go @@ -0,0 +1,189 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the AccessTemplate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AccessTemplate{} + +// AccessTemplate A logical grouping of access related elements +type AccessTemplate struct { + // The list of users the access applies to + Users []User `json:"users"` + // A list of statements which match roles to resources. + Statements []Statement `json:"statements"` +} + +type _AccessTemplate AccessTemplate + +// NewAccessTemplate instantiates a new AccessTemplate object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAccessTemplate(users []User, statements []Statement) *AccessTemplate { + this := AccessTemplate{} + this.Users = users + this.Statements = statements + return &this +} + +// NewAccessTemplateWithDefaults instantiates a new AccessTemplate object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAccessTemplateWithDefaults() *AccessTemplate { + this := AccessTemplate{} + return &this +} + +// GetUsers returns the Users field value +func (o *AccessTemplate) GetUsers() []User { + if o == nil { + var ret []User + return ret + } + + return o.Users +} + +// GetUsersOk returns a tuple with the Users field value +// and a boolean to check if the value has been set. +func (o *AccessTemplate) GetUsersOk() ([]User, bool) { + if o == nil { + return nil, false + } + return o.Users, true +} + +// SetUsers sets field value +func (o *AccessTemplate) SetUsers(v []User) { + o.Users = v +} + +// GetStatements returns the Statements field value +func (o *AccessTemplate) GetStatements() []Statement { + if o == nil { + var ret []Statement + return ret + } + + return o.Statements +} + +// GetStatementsOk returns a tuple with the Statements field value +// and a boolean to check if the value has been set. +func (o *AccessTemplate) GetStatementsOk() ([]Statement, bool) { + if o == nil { + return nil, false + } + return o.Statements, true +} + +// SetStatements sets field value +func (o *AccessTemplate) SetStatements(v []Statement) { + o.Statements = v +} + +func (o AccessTemplate) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AccessTemplate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["users"] = o.Users + toSerialize["statements"] = o.Statements + return toSerialize, nil +} + +func (o *AccessTemplate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "users", + "statements", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAccessTemplate := _AccessTemplate{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varAccessTemplate) + + if err != nil { + return err + } + + *o = AccessTemplate(varAccessTemplate) + + return err +} + +type NullableAccessTemplate struct { + value *AccessTemplate + isSet bool +} + +func (v NullableAccessTemplate) Get() *AccessTemplate { + return v.value +} + +func (v *NullableAccessTemplate) Set(val *AccessTemplate) { + v.value = val + v.isSet = true +} + +func (v NullableAccessTemplate) IsSet() bool { + return v.isSet +} + +func (v *NullableAccessTemplate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAccessTemplate(val *AccessTemplate) *NullableAccessTemplate { + return &NullableAccessTemplate{value: val, isSet: true} +} + +func (v NullableAccessTemplate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAccessTemplate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_account.go b/src/models/model_account.go new file mode 100644 index 0000000..ef66b67 --- /dev/null +++ b/src/models/model_account.go @@ -0,0 +1,298 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "time" + "bytes" + "fmt" +) + +// checks if the Account type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Account{} + +// Account struct for Account +type Account struct { + AccountId string `json:"accountId"` + CreatedTime time.Time `json:"createdTime"` + Name NullableString `json:"name,omitempty"` + Company map[string]interface{} `json:"company"` + Links *AccountLinks `json:"links,omitempty"` +} + +type _Account Account + +// NewAccount instantiates a new Account object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAccount(accountId string, createdTime time.Time, company map[string]interface{}) *Account { + this := Account{} + this.AccountId = accountId + this.CreatedTime = createdTime + this.Company = company + return &this +} + +// NewAccountWithDefaults instantiates a new Account object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAccountWithDefaults() *Account { + this := Account{} + return &this +} + +// GetAccountId returns the AccountId field value +func (o *Account) GetAccountId() string { + if o == nil { + var ret string + return ret + } + + return o.AccountId +} + +// GetAccountIdOk returns a tuple with the AccountId field value +// and a boolean to check if the value has been set. +func (o *Account) GetAccountIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountId, true +} + +// SetAccountId sets field value +func (o *Account) SetAccountId(v string) { + o.AccountId = v +} + +// GetCreatedTime returns the CreatedTime field value +func (o *Account) GetCreatedTime() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.CreatedTime +} + +// GetCreatedTimeOk returns a tuple with the CreatedTime field value +// and a boolean to check if the value has been set. +func (o *Account) GetCreatedTimeOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedTime, true +} + +// SetCreatedTime sets field value +func (o *Account) SetCreatedTime(v time.Time) { + o.CreatedTime = v +} + +// GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Account) GetName() string { + if o == nil || IsNil(o.Name.Get()) { + var ret string + return ret + } + return *o.Name.Get() +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Account) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Name.Get(), o.Name.IsSet() +} + +// HasName returns a boolean if a field has been set. +func (o *Account) HasName() bool { + if o != nil && o.Name.IsSet() { + return true + } + + return false +} + +// SetName gets a reference to the given NullableString and assigns it to the Name field. +func (o *Account) SetName(v string) { + o.Name.Set(&v) +} +// SetNameNil sets the value for Name to be an explicit nil +func (o *Account) SetNameNil() { + o.Name.Set(nil) +} + +// UnsetName ensures that no value is present for Name, not even an explicit nil +func (o *Account) UnsetName() { + o.Name.Unset() +} + +// GetCompany returns the Company field value +func (o *Account) GetCompany() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Company +} + +// GetCompanyOk returns a tuple with the Company field value +// and a boolean to check if the value has been set. +func (o *Account) GetCompanyOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Company, true +} + +// SetCompany sets field value +func (o *Account) SetCompany(v map[string]interface{}) { + o.Company = v +} + +// GetLinks returns the Links field value if set, zero value otherwise. +func (o *Account) GetLinks() AccountLinks { + if o == nil || IsNil(o.Links) { + var ret AccountLinks + return ret + } + return *o.Links +} + +// GetLinksOk returns a tuple with the Links field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Account) GetLinksOk() (*AccountLinks, bool) { + if o == nil || IsNil(o.Links) { + return nil, false + } + return o.Links, true +} + +// HasLinks returns a boolean if a field has been set. +func (o *Account) HasLinks() bool { + if o != nil && !IsNil(o.Links) { + return true + } + + return false +} + +// SetLinks gets a reference to the given AccountLinks and assigns it to the Links field. +func (o *Account) SetLinks(v AccountLinks) { + o.Links = &v +} + +func (o Account) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Account) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountId"] = o.AccountId + toSerialize["createdTime"] = o.CreatedTime + if o.Name.IsSet() { + toSerialize["name"] = o.Name.Get() + } + toSerialize["company"] = o.Company + if !IsNil(o.Links) { + toSerialize["links"] = o.Links + } + return toSerialize, nil +} + +func (o *Account) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "accountId", + "createdTime", + "company", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAccount := _Account{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varAccount) + + if err != nil { + return err + } + + *o = Account(varAccount) + + return err +} + +type NullableAccount struct { + value *Account + isSet bool +} + +func (v NullableAccount) Get() *Account { + return v.value +} + +func (v *NullableAccount) Set(val *Account) { + v.value = val + v.isSet = true +} + +func (v NullableAccount) IsSet() bool { + return v.isSet +} + +func (v *NullableAccount) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAccount(val *Account) *NullableAccount { + return &NullableAccount{value: val, isSet: true} +} + +func (v NullableAccount) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAccount) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_account_collection.go b/src/models/model_account_collection.go new file mode 100644 index 0000000..524820b --- /dev/null +++ b/src/models/model_account_collection.go @@ -0,0 +1,159 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the AccountCollection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AccountCollection{} + +// AccountCollection struct for AccountCollection +type AccountCollection struct { + Accounts Account `json:"accounts"` +} + +type _AccountCollection AccountCollection + +// NewAccountCollection instantiates a new AccountCollection object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAccountCollection(accounts Account) *AccountCollection { + this := AccountCollection{} + this.Accounts = accounts + return &this +} + +// NewAccountCollectionWithDefaults instantiates a new AccountCollection object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAccountCollectionWithDefaults() *AccountCollection { + this := AccountCollection{} + return &this +} + +// GetAccounts returns the Accounts field value +func (o *AccountCollection) GetAccounts() Account { + if o == nil { + var ret Account + return ret + } + + return o.Accounts +} + +// GetAccountsOk returns a tuple with the Accounts field value +// and a boolean to check if the value has been set. +func (o *AccountCollection) GetAccountsOk() (*Account, bool) { + if o == nil { + return nil, false + } + return &o.Accounts, true +} + +// SetAccounts sets field value +func (o *AccountCollection) SetAccounts(v Account) { + o.Accounts = v +} + +func (o AccountCollection) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AccountCollection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accounts"] = o.Accounts + return toSerialize, nil +} + +func (o *AccountCollection) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "accounts", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAccountCollection := _AccountCollection{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varAccountCollection) + + if err != nil { + return err + } + + *o = AccountCollection(varAccountCollection) + + return err +} + +type NullableAccountCollection struct { + value *AccountCollection + isSet bool +} + +func (v NullableAccountCollection) Get() *AccountCollection { + return v.value +} + +func (v *NullableAccountCollection) Set(val *AccountCollection) { + v.value = val + v.isSet = true +} + +func (v NullableAccountCollection) IsSet() bool { + return v.isSet +} + +func (v *NullableAccountCollection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAccountCollection(val *AccountCollection) *NullableAccountCollection { + return &NullableAccountCollection{value: val, isSet: true} +} + +func (v NullableAccountCollection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAccountCollection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_account_links.go b/src/models/model_account_links.go new file mode 100644 index 0000000..bcb0623 --- /dev/null +++ b/src/models/model_account_links.go @@ -0,0 +1,161 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the AccountLinks type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AccountLinks{} + +// AccountLinks struct for AccountLinks +type AccountLinks struct { + Self NullableLink `json:"self"` +} + +type _AccountLinks AccountLinks + +// NewAccountLinks instantiates a new AccountLinks object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAccountLinks(self NullableLink) *AccountLinks { + this := AccountLinks{} + this.Self = self + return &this +} + +// NewAccountLinksWithDefaults instantiates a new AccountLinks object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAccountLinksWithDefaults() *AccountLinks { + this := AccountLinks{} + return &this +} + +// GetSelf returns the Self field value +// If the value is explicit nil, the zero value for Link will be returned +func (o *AccountLinks) GetSelf() Link { + if o == nil || o.Self.Get() == nil { + var ret Link + return ret + } + + return *o.Self.Get() +} + +// GetSelfOk returns a tuple with the Self field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AccountLinks) GetSelfOk() (*Link, bool) { + if o == nil { + return nil, false + } + return o.Self.Get(), o.Self.IsSet() +} + +// SetSelf sets field value +func (o *AccountLinks) SetSelf(v Link) { + o.Self.Set(&v) +} + +func (o AccountLinks) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AccountLinks) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["self"] = o.Self.Get() + return toSerialize, nil +} + +func (o *AccountLinks) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "self", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAccountLinks := _AccountLinks{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varAccountLinks) + + if err != nil { + return err + } + + *o = AccountLinks(varAccountLinks) + + return err +} + +type NullableAccountLinks struct { + value *AccountLinks + isSet bool +} + +func (v NullableAccountLinks) Get() *AccountLinks { + return v.value +} + +func (v *NullableAccountLinks) Set(val *AccountLinks) { + v.value = val + v.isSet = true +} + +func (v NullableAccountLinks) IsSet() bool { + return v.isSet +} + +func (v *NullableAccountLinks) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAccountLinks(val *AccountLinks) *NullableAccountLinks { + return &NullableAccountLinks{value: val, isSet: true} +} + +func (v NullableAccountLinks) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAccountLinks) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_application_delegation.go b/src/models/model_application_delegation.go new file mode 100644 index 0000000..7e49f87 --- /dev/null +++ b/src/models/model_application_delegation.go @@ -0,0 +1,160 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ApplicationDelegation type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApplicationDelegation{} + +// ApplicationDelegation The delegation response. +type ApplicationDelegation struct { + // Redirect the user to this url to automatically log them into a third-party application. + AuthenticationUrl string `json:"authenticationUrl"` +} + +type _ApplicationDelegation ApplicationDelegation + +// NewApplicationDelegation instantiates a new ApplicationDelegation object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewApplicationDelegation(authenticationUrl string) *ApplicationDelegation { + this := ApplicationDelegation{} + this.AuthenticationUrl = authenticationUrl + return &this +} + +// NewApplicationDelegationWithDefaults instantiates a new ApplicationDelegation object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewApplicationDelegationWithDefaults() *ApplicationDelegation { + this := ApplicationDelegation{} + return &this +} + +// GetAuthenticationUrl returns the AuthenticationUrl field value +func (o *ApplicationDelegation) GetAuthenticationUrl() string { + if o == nil { + var ret string + return ret + } + + return o.AuthenticationUrl +} + +// GetAuthenticationUrlOk returns a tuple with the AuthenticationUrl field value +// and a boolean to check if the value has been set. +func (o *ApplicationDelegation) GetAuthenticationUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AuthenticationUrl, true +} + +// SetAuthenticationUrl sets field value +func (o *ApplicationDelegation) SetAuthenticationUrl(v string) { + o.AuthenticationUrl = v +} + +func (o ApplicationDelegation) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApplicationDelegation) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["authenticationUrl"] = o.AuthenticationUrl + return toSerialize, nil +} + +func (o *ApplicationDelegation) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "authenticationUrl", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varApplicationDelegation := _ApplicationDelegation{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varApplicationDelegation) + + if err != nil { + return err + } + + *o = ApplicationDelegation(varApplicationDelegation) + + return err +} + +type NullableApplicationDelegation struct { + value *ApplicationDelegation + isSet bool +} + +func (v NullableApplicationDelegation) Get() *ApplicationDelegation { + return v.value +} + +func (v *NullableApplicationDelegation) Set(val *ApplicationDelegation) { + v.value = val + v.isSet = true +} + +func (v NullableApplicationDelegation) IsSet() bool { + return v.isSet +} + +func (v *NullableApplicationDelegation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApplicationDelegation(val *ApplicationDelegation) *NullableApplicationDelegation { + return &NullableApplicationDelegation{value: val, isSet: true} +} + +func (v NullableApplicationDelegation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApplicationDelegation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_claim_request.go b/src/models/model_claim_request.go new file mode 100644 index 0000000..18fdd37 --- /dev/null +++ b/src/models/model_claim_request.go @@ -0,0 +1,189 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ClaimRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ClaimRequest{} + +// ClaimRequest struct for ClaimRequest +type ClaimRequest struct { + // The parent resource to add a sub-resource to. The resource must have a resource configuration that add the permission CLAIM for this to work. + CollectionResource string `json:"collectionResource"` + // The sub-resource the user is requesting Admin ownership over. + ResourceId string `json:"resourceId"` +} + +type _ClaimRequest ClaimRequest + +// NewClaimRequest instantiates a new ClaimRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewClaimRequest(collectionResource string, resourceId string) *ClaimRequest { + this := ClaimRequest{} + this.CollectionResource = collectionResource + this.ResourceId = resourceId + return &this +} + +// NewClaimRequestWithDefaults instantiates a new ClaimRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewClaimRequestWithDefaults() *ClaimRequest { + this := ClaimRequest{} + return &this +} + +// GetCollectionResource returns the CollectionResource field value +func (o *ClaimRequest) GetCollectionResource() string { + if o == nil { + var ret string + return ret + } + + return o.CollectionResource +} + +// GetCollectionResourceOk returns a tuple with the CollectionResource field value +// and a boolean to check if the value has been set. +func (o *ClaimRequest) GetCollectionResourceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CollectionResource, true +} + +// SetCollectionResource sets field value +func (o *ClaimRequest) SetCollectionResource(v string) { + o.CollectionResource = v +} + +// GetResourceId returns the ResourceId field value +func (o *ClaimRequest) GetResourceId() string { + if o == nil { + var ret string + return ret + } + + return o.ResourceId +} + +// GetResourceIdOk returns a tuple with the ResourceId field value +// and a boolean to check if the value has been set. +func (o *ClaimRequest) GetResourceIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ResourceId, true +} + +// SetResourceId sets field value +func (o *ClaimRequest) SetResourceId(v string) { + o.ResourceId = v +} + +func (o ClaimRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ClaimRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["collectionResource"] = o.CollectionResource + toSerialize["resourceId"] = o.ResourceId + return toSerialize, nil +} + +func (o *ClaimRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "collectionResource", + "resourceId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varClaimRequest := _ClaimRequest{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varClaimRequest) + + if err != nil { + return err + } + + *o = ClaimRequest(varClaimRequest) + + return err +} + +type NullableClaimRequest struct { + value *ClaimRequest + isSet bool +} + +func (v NullableClaimRequest) Get() *ClaimRequest { + return v.value +} + +func (v *NullableClaimRequest) Set(val *ClaimRequest) { + v.value = val + v.isSet = true +} + +func (v NullableClaimRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableClaimRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableClaimRequest(val *ClaimRequest) *NullableClaimRequest { + return &NullableClaimRequest{value: val, isSet: true} +} + +func (v NullableClaimRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableClaimRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_client.go b/src/models/model_client.go new file mode 100644 index 0000000..2a2b1ff --- /dev/null +++ b/src/models/model_client.go @@ -0,0 +1,347 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "time" + "bytes" + "fmt" +) + +// checks if the Client type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Client{} + +// Client A client configuration. +type Client struct { + // The unique ID of the client. + ClientId string `json:"clientId"` + CreatedTime time.Time `json:"createdTime"` + // The name of the client + Name NullableString `json:"name,omitempty"` + Options *ClientOptions `json:"options,omitempty"` + // A list of the service client access keys. + VerificationKeys []ClientAccessKey `json:"verificationKeys,omitempty"` + // The tags associated with this resource, this property is an map. { key1: value1, key2: value2 } + Tags map[string]string `json:"tags,omitempty"` +} + +type _Client Client + +// NewClient instantiates a new Client object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewClient(clientId string, createdTime time.Time) *Client { + this := Client{} + this.ClientId = clientId + this.CreatedTime = createdTime + return &this +} + +// NewClientWithDefaults instantiates a new Client object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewClientWithDefaults() *Client { + this := Client{} + return &this +} + +// GetClientId returns the ClientId field value +func (o *Client) GetClientId() string { + if o == nil { + var ret string + return ret + } + + return o.ClientId +} + +// GetClientIdOk returns a tuple with the ClientId field value +// and a boolean to check if the value has been set. +func (o *Client) GetClientIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientId, true +} + +// SetClientId sets field value +func (o *Client) SetClientId(v string) { + o.ClientId = v +} + +// GetCreatedTime returns the CreatedTime field value +func (o *Client) GetCreatedTime() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.CreatedTime +} + +// GetCreatedTimeOk returns a tuple with the CreatedTime field value +// and a boolean to check if the value has been set. +func (o *Client) GetCreatedTimeOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedTime, true +} + +// SetCreatedTime sets field value +func (o *Client) SetCreatedTime(v time.Time) { + o.CreatedTime = v +} + +// GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Client) GetName() string { + if o == nil || IsNil(o.Name.Get()) { + var ret string + return ret + } + return *o.Name.Get() +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Client) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Name.Get(), o.Name.IsSet() +} + +// HasName returns a boolean if a field has been set. +func (o *Client) HasName() bool { + if o != nil && o.Name.IsSet() { + return true + } + + return false +} + +// SetName gets a reference to the given NullableString and assigns it to the Name field. +func (o *Client) SetName(v string) { + o.Name.Set(&v) +} +// SetNameNil sets the value for Name to be an explicit nil +func (o *Client) SetNameNil() { + o.Name.Set(nil) +} + +// UnsetName ensures that no value is present for Name, not even an explicit nil +func (o *Client) UnsetName() { + o.Name.Unset() +} + +// GetOptions returns the Options field value if set, zero value otherwise. +func (o *Client) GetOptions() ClientOptions { + if o == nil || IsNil(o.Options) { + var ret ClientOptions + return ret + } + return *o.Options +} + +// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Client) GetOptionsOk() (*ClientOptions, bool) { + if o == nil || IsNil(o.Options) { + return nil, false + } + return o.Options, true +} + +// HasOptions returns a boolean if a field has been set. +func (o *Client) HasOptions() bool { + if o != nil && !IsNil(o.Options) { + return true + } + + return false +} + +// SetOptions gets a reference to the given ClientOptions and assigns it to the Options field. +func (o *Client) SetOptions(v ClientOptions) { + o.Options = &v +} + +// GetVerificationKeys returns the VerificationKeys field value if set, zero value otherwise. +func (o *Client) GetVerificationKeys() []ClientAccessKey { + if o == nil || IsNil(o.VerificationKeys) { + var ret []ClientAccessKey + return ret + } + return o.VerificationKeys +} + +// GetVerificationKeysOk returns a tuple with the VerificationKeys field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Client) GetVerificationKeysOk() ([]ClientAccessKey, bool) { + if o == nil || IsNil(o.VerificationKeys) { + return nil, false + } + return o.VerificationKeys, true +} + +// HasVerificationKeys returns a boolean if a field has been set. +func (o *Client) HasVerificationKeys() bool { + if o != nil && !IsNil(o.VerificationKeys) { + return true + } + + return false +} + +// SetVerificationKeys gets a reference to the given []ClientAccessKey and assigns it to the VerificationKeys field. +func (o *Client) SetVerificationKeys(v []ClientAccessKey) { + o.VerificationKeys = v +} + +// GetTags returns the Tags field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Client) GetTags() map[string]string { + if o == nil { + var ret map[string]string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Client) GetTagsOk() (*map[string]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return &o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *Client) HasTags() bool { + if o != nil && IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given map[string]string and assigns it to the Tags field. +func (o *Client) SetTags(v map[string]string) { + o.Tags = v +} + +func (o Client) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Client) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["clientId"] = o.ClientId + toSerialize["createdTime"] = o.CreatedTime + if o.Name.IsSet() { + toSerialize["name"] = o.Name.Get() + } + if !IsNil(o.Options) { + toSerialize["options"] = o.Options + } + if !IsNil(o.VerificationKeys) { + toSerialize["verificationKeys"] = o.VerificationKeys + } + if o.Tags != nil { + toSerialize["tags"] = o.Tags + } + return toSerialize, nil +} + +func (o *Client) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "clientId", + "createdTime", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varClient := _Client{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varClient) + + if err != nil { + return err + } + + *o = Client(varClient) + + return err +} + +type NullableClient struct { + value *Client + isSet bool +} + +func (v NullableClient) Get() *Client { + return v.value +} + +func (v *NullableClient) Set(val *Client) { + v.value = val + v.isSet = true +} + +func (v NullableClient) IsSet() bool { + return v.isSet +} + +func (v *NullableClient) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableClient(val *Client) *NullableClient { + return &NullableClient{value: val, isSet: true} +} + +func (v NullableClient) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableClient) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_client_access_key.go b/src/models/model_client_access_key.go new file mode 100644 index 0000000..a751ce2 --- /dev/null +++ b/src/models/model_client_access_key.go @@ -0,0 +1,355 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "time" + "bytes" + "fmt" +) + +// checks if the ClientAccessKey type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ClientAccessKey{} + +// ClientAccessKey A client access key configuration. The configuration contains information about the key. On first creation the configuration also contains the raw `clientSecret` and `accessKey` for use with OAuth and the Authress SDKs. +type ClientAccessKey struct { + // The unique ID of the client. + KeyId *string `json:"keyId,omitempty"` + // The unique ID of the client. + ClientId string `json:"clientId"` + // Specify a public key on access key creation to bring your own private key. When left blank, Authress will automatically generate a private and public key pair and then return the private key as part of the request. This property holds the public key. + PublicKey NullableString `json:"publicKey,omitempty"` + GenerationDate *time.Time `json:"generationDate,omitempty"` + // The unencoded OAuth client secret used with the OAuth endpoints to request a JWT using the `client_credentials` grant type. Pass the clientId and the clientSecret to the documented /tokens endpoint. + ClientSecret *string `json:"clientSecret,omitempty"` + // An encoded access key which contains identifying information for client access token creation. For direct use with the Authress SDKs. This private access key must be saved on first creation as it is discarded afterwards. Authress only saves the corresponding public key to verify the private access key. + AccessKey *string `json:"accessKey,omitempty"` +} + +type _ClientAccessKey ClientAccessKey + +// NewClientAccessKey instantiates a new ClientAccessKey object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewClientAccessKey(clientId string) *ClientAccessKey { + this := ClientAccessKey{} + this.ClientId = clientId + return &this +} + +// NewClientAccessKeyWithDefaults instantiates a new ClientAccessKey object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewClientAccessKeyWithDefaults() *ClientAccessKey { + this := ClientAccessKey{} + return &this +} + +// GetKeyId returns the KeyId field value if set, zero value otherwise. +func (o *ClientAccessKey) GetKeyId() string { + if o == nil || IsNil(o.KeyId) { + var ret string + return ret + } + return *o.KeyId +} + +// GetKeyIdOk returns a tuple with the KeyId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ClientAccessKey) GetKeyIdOk() (*string, bool) { + if o == nil || IsNil(o.KeyId) { + return nil, false + } + return o.KeyId, true +} + +// HasKeyId returns a boolean if a field has been set. +func (o *ClientAccessKey) HasKeyId() bool { + if o != nil && !IsNil(o.KeyId) { + return true + } + + return false +} + +// SetKeyId gets a reference to the given string and assigns it to the KeyId field. +func (o *ClientAccessKey) SetKeyId(v string) { + o.KeyId = &v +} + +// GetClientId returns the ClientId field value +func (o *ClientAccessKey) GetClientId() string { + if o == nil { + var ret string + return ret + } + + return o.ClientId +} + +// GetClientIdOk returns a tuple with the ClientId field value +// and a boolean to check if the value has been set. +func (o *ClientAccessKey) GetClientIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientId, true +} + +// SetClientId sets field value +func (o *ClientAccessKey) SetClientId(v string) { + o.ClientId = v +} + +// GetPublicKey returns the PublicKey field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ClientAccessKey) GetPublicKey() string { + if o == nil || IsNil(o.PublicKey.Get()) { + var ret string + return ret + } + return *o.PublicKey.Get() +} + +// GetPublicKeyOk returns a tuple with the PublicKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClientAccessKey) GetPublicKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.PublicKey.Get(), o.PublicKey.IsSet() +} + +// HasPublicKey returns a boolean if a field has been set. +func (o *ClientAccessKey) HasPublicKey() bool { + if o != nil && o.PublicKey.IsSet() { + return true + } + + return false +} + +// SetPublicKey gets a reference to the given NullableString and assigns it to the PublicKey field. +func (o *ClientAccessKey) SetPublicKey(v string) { + o.PublicKey.Set(&v) +} +// SetPublicKeyNil sets the value for PublicKey to be an explicit nil +func (o *ClientAccessKey) SetPublicKeyNil() { + o.PublicKey.Set(nil) +} + +// UnsetPublicKey ensures that no value is present for PublicKey, not even an explicit nil +func (o *ClientAccessKey) UnsetPublicKey() { + o.PublicKey.Unset() +} + +// GetGenerationDate returns the GenerationDate field value if set, zero value otherwise. +func (o *ClientAccessKey) GetGenerationDate() time.Time { + if o == nil || IsNil(o.GenerationDate) { + var ret time.Time + return ret + } + return *o.GenerationDate +} + +// GetGenerationDateOk returns a tuple with the GenerationDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ClientAccessKey) GetGenerationDateOk() (*time.Time, bool) { + if o == nil || IsNil(o.GenerationDate) { + return nil, false + } + return o.GenerationDate, true +} + +// HasGenerationDate returns a boolean if a field has been set. +func (o *ClientAccessKey) HasGenerationDate() bool { + if o != nil && !IsNil(o.GenerationDate) { + return true + } + + return false +} + +// SetGenerationDate gets a reference to the given time.Time and assigns it to the GenerationDate field. +func (o *ClientAccessKey) SetGenerationDate(v time.Time) { + o.GenerationDate = &v +} + +// GetClientSecret returns the ClientSecret field value if set, zero value otherwise. +func (o *ClientAccessKey) GetClientSecret() string { + if o == nil || IsNil(o.ClientSecret) { + var ret string + return ret + } + return *o.ClientSecret +} + +// GetClientSecretOk returns a tuple with the ClientSecret field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ClientAccessKey) GetClientSecretOk() (*string, bool) { + if o == nil || IsNil(o.ClientSecret) { + return nil, false + } + return o.ClientSecret, true +} + +// HasClientSecret returns a boolean if a field has been set. +func (o *ClientAccessKey) HasClientSecret() bool { + if o != nil && !IsNil(o.ClientSecret) { + return true + } + + return false +} + +// SetClientSecret gets a reference to the given string and assigns it to the ClientSecret field. +func (o *ClientAccessKey) SetClientSecret(v string) { + o.ClientSecret = &v +} + +// GetAccessKey returns the AccessKey field value if set, zero value otherwise. +func (o *ClientAccessKey) GetAccessKey() string { + if o == nil || IsNil(o.AccessKey) { + var ret string + return ret + } + return *o.AccessKey +} + +// GetAccessKeyOk returns a tuple with the AccessKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ClientAccessKey) GetAccessKeyOk() (*string, bool) { + if o == nil || IsNil(o.AccessKey) { + return nil, false + } + return o.AccessKey, true +} + +// HasAccessKey returns a boolean if a field has been set. +func (o *ClientAccessKey) HasAccessKey() bool { + if o != nil && !IsNil(o.AccessKey) { + return true + } + + return false +} + +// SetAccessKey gets a reference to the given string and assigns it to the AccessKey field. +func (o *ClientAccessKey) SetAccessKey(v string) { + o.AccessKey = &v +} + +func (o ClientAccessKey) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ClientAccessKey) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.KeyId) { + toSerialize["keyId"] = o.KeyId + } + toSerialize["clientId"] = o.ClientId + if o.PublicKey.IsSet() { + toSerialize["publicKey"] = o.PublicKey.Get() + } + if !IsNil(o.GenerationDate) { + toSerialize["generationDate"] = o.GenerationDate + } + if !IsNil(o.ClientSecret) { + toSerialize["clientSecret"] = o.ClientSecret + } + if !IsNil(o.AccessKey) { + toSerialize["accessKey"] = o.AccessKey + } + return toSerialize, nil +} + +func (o *ClientAccessKey) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "clientId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varClientAccessKey := _ClientAccessKey{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varClientAccessKey) + + if err != nil { + return err + } + + *o = ClientAccessKey(varClientAccessKey) + + return err +} + +type NullableClientAccessKey struct { + value *ClientAccessKey + isSet bool +} + +func (v NullableClientAccessKey) Get() *ClientAccessKey { + return v.value +} + +func (v *NullableClientAccessKey) Set(val *ClientAccessKey) { + v.value = val + v.isSet = true +} + +func (v NullableClientAccessKey) IsSet() bool { + return v.isSet +} + +func (v *NullableClientAccessKey) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableClientAccessKey(val *ClientAccessKey) *NullableClientAccessKey { + return &NullableClientAccessKey{value: val, isSet: true} +} + +func (v NullableClientAccessKey) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableClientAccessKey) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_client_collection.go b/src/models/model_client_collection.go new file mode 100644 index 0000000..eac4137 --- /dev/null +++ b/src/models/model_client_collection.go @@ -0,0 +1,224 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ClientCollection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ClientCollection{} + +// ClientCollection The collection of a list of clients +type ClientCollection struct { + // A list of clients + Clients []Client `json:"clients"` + Pagination *Pagination `json:"pagination,omitempty"` + Links CollectionLinks `json:"links"` +} + +type _ClientCollection ClientCollection + +// NewClientCollection instantiates a new ClientCollection object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewClientCollection(clients []Client, links CollectionLinks) *ClientCollection { + this := ClientCollection{} + this.Clients = clients + this.Links = links + return &this +} + +// NewClientCollectionWithDefaults instantiates a new ClientCollection object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewClientCollectionWithDefaults() *ClientCollection { + this := ClientCollection{} + return &this +} + +// GetClients returns the Clients field value +func (o *ClientCollection) GetClients() []Client { + if o == nil { + var ret []Client + return ret + } + + return o.Clients +} + +// GetClientsOk returns a tuple with the Clients field value +// and a boolean to check if the value has been set. +func (o *ClientCollection) GetClientsOk() ([]Client, bool) { + if o == nil { + return nil, false + } + return o.Clients, true +} + +// SetClients sets field value +func (o *ClientCollection) SetClients(v []Client) { + o.Clients = v +} + +// GetPagination returns the Pagination field value if set, zero value otherwise. +func (o *ClientCollection) GetPagination() Pagination { + if o == nil || IsNil(o.Pagination) { + var ret Pagination + return ret + } + return *o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ClientCollection) GetPaginationOk() (*Pagination, bool) { + if o == nil || IsNil(o.Pagination) { + return nil, false + } + return o.Pagination, true +} + +// HasPagination returns a boolean if a field has been set. +func (o *ClientCollection) HasPagination() bool { + if o != nil && !IsNil(o.Pagination) { + return true + } + + return false +} + +// SetPagination gets a reference to the given Pagination and assigns it to the Pagination field. +func (o *ClientCollection) SetPagination(v Pagination) { + o.Pagination = &v +} + +// GetLinks returns the Links field value +func (o *ClientCollection) GetLinks() CollectionLinks { + if o == nil { + var ret CollectionLinks + return ret + } + + return o.Links +} + +// GetLinksOk returns a tuple with the Links field value +// and a boolean to check if the value has been set. +func (o *ClientCollection) GetLinksOk() (*CollectionLinks, bool) { + if o == nil { + return nil, false + } + return &o.Links, true +} + +// SetLinks sets field value +func (o *ClientCollection) SetLinks(v CollectionLinks) { + o.Links = v +} + +func (o ClientCollection) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ClientCollection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["clients"] = o.Clients + if !IsNil(o.Pagination) { + toSerialize["pagination"] = o.Pagination + } + toSerialize["links"] = o.Links + return toSerialize, nil +} + +func (o *ClientCollection) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "clients", + "links", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varClientCollection := _ClientCollection{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varClientCollection) + + if err != nil { + return err + } + + *o = ClientCollection(varClientCollection) + + return err +} + +type NullableClientCollection struct { + value *ClientCollection + isSet bool +} + +func (v NullableClientCollection) Get() *ClientCollection { + return v.value +} + +func (v *NullableClientCollection) Set(val *ClientCollection) { + v.value = val + v.isSet = true +} + +func (v NullableClientCollection) IsSet() bool { + return v.isSet +} + +func (v *NullableClientCollection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableClientCollection(val *ClientCollection) *NullableClientCollection { + return &NullableClientCollection{value: val, isSet: true} +} + +func (v NullableClientCollection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableClientCollection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_client_options.go b/src/models/model_client_options.go new file mode 100644 index 0000000..281db77 --- /dev/null +++ b/src/models/model_client_options.go @@ -0,0 +1,193 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" +) + +// checks if the ClientOptions type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ClientOptions{} + +// ClientOptions A set of client specific options +type ClientOptions struct { + // Grant the client access to verify authorization on behalf of any user. + GrantUserPermissionsAccess NullableBool `json:"grantUserPermissionsAccess,omitempty"` + // Grant the client access to generate oauth tokens on behalf of the Authress account. **Security Warning**: This means that this client can impersonate any user, and should only be used when connecting an existing custom Authorization Server to Authress, when that server does not support a standard OAuth connection. + GrantTokenGeneration NullableBool `json:"grantTokenGeneration,omitempty"` +} + +// NewClientOptions instantiates a new ClientOptions object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewClientOptions() *ClientOptions { + this := ClientOptions{} + var grantUserPermissionsAccess bool = false + this.GrantUserPermissionsAccess = *NewNullableBool(&grantUserPermissionsAccess) + var grantTokenGeneration bool = false + this.GrantTokenGeneration = *NewNullableBool(&grantTokenGeneration) + return &this +} + +// NewClientOptionsWithDefaults instantiates a new ClientOptions object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewClientOptionsWithDefaults() *ClientOptions { + this := ClientOptions{} + var grantUserPermissionsAccess bool = false + this.GrantUserPermissionsAccess = *NewNullableBool(&grantUserPermissionsAccess) + var grantTokenGeneration bool = false + this.GrantTokenGeneration = *NewNullableBool(&grantTokenGeneration) + return &this +} + +// GetGrantUserPermissionsAccess returns the GrantUserPermissionsAccess field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ClientOptions) GetGrantUserPermissionsAccess() bool { + if o == nil || IsNil(o.GrantUserPermissionsAccess.Get()) { + var ret bool + return ret + } + return *o.GrantUserPermissionsAccess.Get() +} + +// GetGrantUserPermissionsAccessOk returns a tuple with the GrantUserPermissionsAccess field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClientOptions) GetGrantUserPermissionsAccessOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.GrantUserPermissionsAccess.Get(), o.GrantUserPermissionsAccess.IsSet() +} + +// HasGrantUserPermissionsAccess returns a boolean if a field has been set. +func (o *ClientOptions) HasGrantUserPermissionsAccess() bool { + if o != nil && o.GrantUserPermissionsAccess.IsSet() { + return true + } + + return false +} + +// SetGrantUserPermissionsAccess gets a reference to the given NullableBool and assigns it to the GrantUserPermissionsAccess field. +func (o *ClientOptions) SetGrantUserPermissionsAccess(v bool) { + o.GrantUserPermissionsAccess.Set(&v) +} +// SetGrantUserPermissionsAccessNil sets the value for GrantUserPermissionsAccess to be an explicit nil +func (o *ClientOptions) SetGrantUserPermissionsAccessNil() { + o.GrantUserPermissionsAccess.Set(nil) +} + +// UnsetGrantUserPermissionsAccess ensures that no value is present for GrantUserPermissionsAccess, not even an explicit nil +func (o *ClientOptions) UnsetGrantUserPermissionsAccess() { + o.GrantUserPermissionsAccess.Unset() +} + +// GetGrantTokenGeneration returns the GrantTokenGeneration field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ClientOptions) GetGrantTokenGeneration() bool { + if o == nil || IsNil(o.GrantTokenGeneration.Get()) { + var ret bool + return ret + } + return *o.GrantTokenGeneration.Get() +} + +// GetGrantTokenGenerationOk returns a tuple with the GrantTokenGeneration field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClientOptions) GetGrantTokenGenerationOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.GrantTokenGeneration.Get(), o.GrantTokenGeneration.IsSet() +} + +// HasGrantTokenGeneration returns a boolean if a field has been set. +func (o *ClientOptions) HasGrantTokenGeneration() bool { + if o != nil && o.GrantTokenGeneration.IsSet() { + return true + } + + return false +} + +// SetGrantTokenGeneration gets a reference to the given NullableBool and assigns it to the GrantTokenGeneration field. +func (o *ClientOptions) SetGrantTokenGeneration(v bool) { + o.GrantTokenGeneration.Set(&v) +} +// SetGrantTokenGenerationNil sets the value for GrantTokenGeneration to be an explicit nil +func (o *ClientOptions) SetGrantTokenGenerationNil() { + o.GrantTokenGeneration.Set(nil) +} + +// UnsetGrantTokenGeneration ensures that no value is present for GrantTokenGeneration, not even an explicit nil +func (o *ClientOptions) UnsetGrantTokenGeneration() { + o.GrantTokenGeneration.Unset() +} + +func (o ClientOptions) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ClientOptions) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.GrantUserPermissionsAccess.IsSet() { + toSerialize["grantUserPermissionsAccess"] = o.GrantUserPermissionsAccess.Get() + } + if o.GrantTokenGeneration.IsSet() { + toSerialize["grantTokenGeneration"] = o.GrantTokenGeneration.Get() + } + return toSerialize, nil +} + +type NullableClientOptions struct { + value *ClientOptions + isSet bool +} + +func (v NullableClientOptions) Get() *ClientOptions { + return v.value +} + +func (v *NullableClientOptions) Set(val *ClientOptions) { + v.value = val + v.isSet = true +} + +func (v NullableClientOptions) IsSet() bool { + return v.isSet +} + +func (v *NullableClientOptions) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableClientOptions(val *ClientOptions) *NullableClientOptions { + return &NullableClientOptions{value: val, isSet: true} +} + +func (v NullableClientOptions) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableClientOptions) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_collection_links.go b/src/models/model_collection_links.go new file mode 100644 index 0000000..47b30b0 --- /dev/null +++ b/src/models/model_collection_links.go @@ -0,0 +1,207 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the CollectionLinks type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CollectionLinks{} + +// CollectionLinks struct for CollectionLinks +type CollectionLinks struct { + Self NullableLink `json:"self"` + Next NullableLink `json:"next,omitempty"` +} + +type _CollectionLinks CollectionLinks + +// NewCollectionLinks instantiates a new CollectionLinks object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCollectionLinks(self NullableLink) *CollectionLinks { + this := CollectionLinks{} + this.Self = self + return &this +} + +// NewCollectionLinksWithDefaults instantiates a new CollectionLinks object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCollectionLinksWithDefaults() *CollectionLinks { + this := CollectionLinks{} + return &this +} + +// GetSelf returns the Self field value +// If the value is explicit nil, the zero value for Link will be returned +func (o *CollectionLinks) GetSelf() Link { + if o == nil || o.Self.Get() == nil { + var ret Link + return ret + } + + return *o.Self.Get() +} + +// GetSelfOk returns a tuple with the Self field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CollectionLinks) GetSelfOk() (*Link, bool) { + if o == nil { + return nil, false + } + return o.Self.Get(), o.Self.IsSet() +} + +// SetSelf sets field value +func (o *CollectionLinks) SetSelf(v Link) { + o.Self.Set(&v) +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CollectionLinks) GetNext() Link { + if o == nil || IsNil(o.Next.Get()) { + var ret Link + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CollectionLinks) GetNextOk() (*Link, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *CollectionLinks) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullableLink and assigns it to the Next field. +func (o *CollectionLinks) SetNext(v Link) { + o.Next.Set(&v) +} +// SetNextNil sets the value for Next to be an explicit nil +func (o *CollectionLinks) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *CollectionLinks) UnsetNext() { + o.Next.Unset() +} + +func (o CollectionLinks) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CollectionLinks) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["self"] = o.Self.Get() + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + return toSerialize, nil +} + +func (o *CollectionLinks) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "self", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCollectionLinks := _CollectionLinks{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCollectionLinks) + + if err != nil { + return err + } + + *o = CollectionLinks(varCollectionLinks) + + return err +} + +type NullableCollectionLinks struct { + value *CollectionLinks + isSet bool +} + +func (v NullableCollectionLinks) Get() *CollectionLinks { + return v.value +} + +func (v *NullableCollectionLinks) Set(val *CollectionLinks) { + v.value = val + v.isSet = true +} + +func (v NullableCollectionLinks) IsSet() bool { + return v.isSet +} + +func (v *NullableCollectionLinks) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCollectionLinks(val *CollectionLinks) *NullableCollectionLinks { + return &NullableCollectionLinks{value: val, isSet: true} +} + +func (v NullableCollectionLinks) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCollectionLinks) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_connection.go b/src/models/model_connection.go new file mode 100644 index 0000000..18d0898 --- /dev/null +++ b/src/models/model_connection.go @@ -0,0 +1,662 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "time" +) + +// checks if the Connection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Connection{} + +// Connection struct for Connection +type Connection struct { + Type *string `json:"type,omitempty"` + ConnectionId NullableString `json:"connectionId,omitempty"` + // Authorization URL of the provider (where the user logs in). For OAuth this is the authorization URL, for SAML, this is the **SSO URL**. + AuthenticationUrl *string `json:"authenticationUrl,omitempty"` + // The token exchange url (where we validate the token). + TokenUrl NullableString `json:"tokenUrl,omitempty"` + // The unique identifier tied to the provider's domain used for TLS verification. In OAuth, this is the JWT **iss** property. in SAML this is the **Entity ID**. + IssuerUrl NullableString `json:"issuerUrl,omitempty"` + // The Provider's SAML public certificate which can be used to verify the signature in signed SAML assertions from the provider. + ProviderCertificate NullableString `json:"providerCertificate,omitempty"` + // Provider's client ID used to verify the token + ClientId NullableString `json:"clientId,omitempty"` + // Provider's client secret used to verify the token + ClientSecret NullableString `json:"clientSecret,omitempty"` + UserDataConfiguration NullableConnectionUserDataConfiguration `json:"userDataConfiguration,omitempty"` + Data NullableConnectionData `json:"data,omitempty"` + DefaultConnectionProperties NullableConnectionDefaultConnectionProperties `json:"defaultConnectionProperties,omitempty"` + CreatedTime *time.Time `json:"createdTime,omitempty"` + // The tags associated with this resource, this property is an map. { key1: value1, key2: value2 } + Tags map[string]string `json:"tags,omitempty"` +} + +// NewConnection instantiates a new Connection object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConnection() *Connection { + this := Connection{} + var type_ string = "OAUTH2" + this.Type = &type_ + return &this +} + +// NewConnectionWithDefaults instantiates a new Connection object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConnectionWithDefaults() *Connection { + this := Connection{} + var type_ string = "OAUTH2" + this.Type = &type_ + return &this +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *Connection) GetType() string { + if o == nil || IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Connection) GetTypeOk() (*string, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *Connection) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *Connection) SetType(v string) { + o.Type = &v +} + +// GetConnectionId returns the ConnectionId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Connection) GetConnectionId() string { + if o == nil || IsNil(o.ConnectionId.Get()) { + var ret string + return ret + } + return *o.ConnectionId.Get() +} + +// GetConnectionIdOk returns a tuple with the ConnectionId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Connection) GetConnectionIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ConnectionId.Get(), o.ConnectionId.IsSet() +} + +// HasConnectionId returns a boolean if a field has been set. +func (o *Connection) HasConnectionId() bool { + if o != nil && o.ConnectionId.IsSet() { + return true + } + + return false +} + +// SetConnectionId gets a reference to the given NullableString and assigns it to the ConnectionId field. +func (o *Connection) SetConnectionId(v string) { + o.ConnectionId.Set(&v) +} +// SetConnectionIdNil sets the value for ConnectionId to be an explicit nil +func (o *Connection) SetConnectionIdNil() { + o.ConnectionId.Set(nil) +} + +// UnsetConnectionId ensures that no value is present for ConnectionId, not even an explicit nil +func (o *Connection) UnsetConnectionId() { + o.ConnectionId.Unset() +} + +// GetAuthenticationUrl returns the AuthenticationUrl field value if set, zero value otherwise. +func (o *Connection) GetAuthenticationUrl() string { + if o == nil || IsNil(o.AuthenticationUrl) { + var ret string + return ret + } + return *o.AuthenticationUrl +} + +// GetAuthenticationUrlOk returns a tuple with the AuthenticationUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Connection) GetAuthenticationUrlOk() (*string, bool) { + if o == nil || IsNil(o.AuthenticationUrl) { + return nil, false + } + return o.AuthenticationUrl, true +} + +// HasAuthenticationUrl returns a boolean if a field has been set. +func (o *Connection) HasAuthenticationUrl() bool { + if o != nil && !IsNil(o.AuthenticationUrl) { + return true + } + + return false +} + +// SetAuthenticationUrl gets a reference to the given string and assigns it to the AuthenticationUrl field. +func (o *Connection) SetAuthenticationUrl(v string) { + o.AuthenticationUrl = &v +} + +// GetTokenUrl returns the TokenUrl field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Connection) GetTokenUrl() string { + if o == nil || IsNil(o.TokenUrl.Get()) { + var ret string + return ret + } + return *o.TokenUrl.Get() +} + +// GetTokenUrlOk returns a tuple with the TokenUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Connection) GetTokenUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.TokenUrl.Get(), o.TokenUrl.IsSet() +} + +// HasTokenUrl returns a boolean if a field has been set. +func (o *Connection) HasTokenUrl() bool { + if o != nil && o.TokenUrl.IsSet() { + return true + } + + return false +} + +// SetTokenUrl gets a reference to the given NullableString and assigns it to the TokenUrl field. +func (o *Connection) SetTokenUrl(v string) { + o.TokenUrl.Set(&v) +} +// SetTokenUrlNil sets the value for TokenUrl to be an explicit nil +func (o *Connection) SetTokenUrlNil() { + o.TokenUrl.Set(nil) +} + +// UnsetTokenUrl ensures that no value is present for TokenUrl, not even an explicit nil +func (o *Connection) UnsetTokenUrl() { + o.TokenUrl.Unset() +} + +// GetIssuerUrl returns the IssuerUrl field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Connection) GetIssuerUrl() string { + if o == nil || IsNil(o.IssuerUrl.Get()) { + var ret string + return ret + } + return *o.IssuerUrl.Get() +} + +// GetIssuerUrlOk returns a tuple with the IssuerUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Connection) GetIssuerUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.IssuerUrl.Get(), o.IssuerUrl.IsSet() +} + +// HasIssuerUrl returns a boolean if a field has been set. +func (o *Connection) HasIssuerUrl() bool { + if o != nil && o.IssuerUrl.IsSet() { + return true + } + + return false +} + +// SetIssuerUrl gets a reference to the given NullableString and assigns it to the IssuerUrl field. +func (o *Connection) SetIssuerUrl(v string) { + o.IssuerUrl.Set(&v) +} +// SetIssuerUrlNil sets the value for IssuerUrl to be an explicit nil +func (o *Connection) SetIssuerUrlNil() { + o.IssuerUrl.Set(nil) +} + +// UnsetIssuerUrl ensures that no value is present for IssuerUrl, not even an explicit nil +func (o *Connection) UnsetIssuerUrl() { + o.IssuerUrl.Unset() +} + +// GetProviderCertificate returns the ProviderCertificate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Connection) GetProviderCertificate() string { + if o == nil || IsNil(o.ProviderCertificate.Get()) { + var ret string + return ret + } + return *o.ProviderCertificate.Get() +} + +// GetProviderCertificateOk returns a tuple with the ProviderCertificate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Connection) GetProviderCertificateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ProviderCertificate.Get(), o.ProviderCertificate.IsSet() +} + +// HasProviderCertificate returns a boolean if a field has been set. +func (o *Connection) HasProviderCertificate() bool { + if o != nil && o.ProviderCertificate.IsSet() { + return true + } + + return false +} + +// SetProviderCertificate gets a reference to the given NullableString and assigns it to the ProviderCertificate field. +func (o *Connection) SetProviderCertificate(v string) { + o.ProviderCertificate.Set(&v) +} +// SetProviderCertificateNil sets the value for ProviderCertificate to be an explicit nil +func (o *Connection) SetProviderCertificateNil() { + o.ProviderCertificate.Set(nil) +} + +// UnsetProviderCertificate ensures that no value is present for ProviderCertificate, not even an explicit nil +func (o *Connection) UnsetProviderCertificate() { + o.ProviderCertificate.Unset() +} + +// GetClientId returns the ClientId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Connection) GetClientId() string { + if o == nil || IsNil(o.ClientId.Get()) { + var ret string + return ret + } + return *o.ClientId.Get() +} + +// GetClientIdOk returns a tuple with the ClientId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Connection) GetClientIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ClientId.Get(), o.ClientId.IsSet() +} + +// HasClientId returns a boolean if a field has been set. +func (o *Connection) HasClientId() bool { + if o != nil && o.ClientId.IsSet() { + return true + } + + return false +} + +// SetClientId gets a reference to the given NullableString and assigns it to the ClientId field. +func (o *Connection) SetClientId(v string) { + o.ClientId.Set(&v) +} +// SetClientIdNil sets the value for ClientId to be an explicit nil +func (o *Connection) SetClientIdNil() { + o.ClientId.Set(nil) +} + +// UnsetClientId ensures that no value is present for ClientId, not even an explicit nil +func (o *Connection) UnsetClientId() { + o.ClientId.Unset() +} + +// GetClientSecret returns the ClientSecret field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Connection) GetClientSecret() string { + if o == nil || IsNil(o.ClientSecret.Get()) { + var ret string + return ret + } + return *o.ClientSecret.Get() +} + +// GetClientSecretOk returns a tuple with the ClientSecret field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Connection) GetClientSecretOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ClientSecret.Get(), o.ClientSecret.IsSet() +} + +// HasClientSecret returns a boolean if a field has been set. +func (o *Connection) HasClientSecret() bool { + if o != nil && o.ClientSecret.IsSet() { + return true + } + + return false +} + +// SetClientSecret gets a reference to the given NullableString and assigns it to the ClientSecret field. +func (o *Connection) SetClientSecret(v string) { + o.ClientSecret.Set(&v) +} +// SetClientSecretNil sets the value for ClientSecret to be an explicit nil +func (o *Connection) SetClientSecretNil() { + o.ClientSecret.Set(nil) +} + +// UnsetClientSecret ensures that no value is present for ClientSecret, not even an explicit nil +func (o *Connection) UnsetClientSecret() { + o.ClientSecret.Unset() +} + +// GetUserDataConfiguration returns the UserDataConfiguration field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Connection) GetUserDataConfiguration() ConnectionUserDataConfiguration { + if o == nil || IsNil(o.UserDataConfiguration.Get()) { + var ret ConnectionUserDataConfiguration + return ret + } + return *o.UserDataConfiguration.Get() +} + +// GetUserDataConfigurationOk returns a tuple with the UserDataConfiguration field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Connection) GetUserDataConfigurationOk() (*ConnectionUserDataConfiguration, bool) { + if o == nil { + return nil, false + } + return o.UserDataConfiguration.Get(), o.UserDataConfiguration.IsSet() +} + +// HasUserDataConfiguration returns a boolean if a field has been set. +func (o *Connection) HasUserDataConfiguration() bool { + if o != nil && o.UserDataConfiguration.IsSet() { + return true + } + + return false +} + +// SetUserDataConfiguration gets a reference to the given NullableConnectionUserDataConfiguration and assigns it to the UserDataConfiguration field. +func (o *Connection) SetUserDataConfiguration(v ConnectionUserDataConfiguration) { + o.UserDataConfiguration.Set(&v) +} +// SetUserDataConfigurationNil sets the value for UserDataConfiguration to be an explicit nil +func (o *Connection) SetUserDataConfigurationNil() { + o.UserDataConfiguration.Set(nil) +} + +// UnsetUserDataConfiguration ensures that no value is present for UserDataConfiguration, not even an explicit nil +func (o *Connection) UnsetUserDataConfiguration() { + o.UserDataConfiguration.Unset() +} + +// GetData returns the Data field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Connection) GetData() ConnectionData { + if o == nil || IsNil(o.Data.Get()) { + var ret ConnectionData + return ret + } + return *o.Data.Get() +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Connection) GetDataOk() (*ConnectionData, bool) { + if o == nil { + return nil, false + } + return o.Data.Get(), o.Data.IsSet() +} + +// HasData returns a boolean if a field has been set. +func (o *Connection) HasData() bool { + if o != nil && o.Data.IsSet() { + return true + } + + return false +} + +// SetData gets a reference to the given NullableConnectionData and assigns it to the Data field. +func (o *Connection) SetData(v ConnectionData) { + o.Data.Set(&v) +} +// SetDataNil sets the value for Data to be an explicit nil +func (o *Connection) SetDataNil() { + o.Data.Set(nil) +} + +// UnsetData ensures that no value is present for Data, not even an explicit nil +func (o *Connection) UnsetData() { + o.Data.Unset() +} + +// GetDefaultConnectionProperties returns the DefaultConnectionProperties field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Connection) GetDefaultConnectionProperties() ConnectionDefaultConnectionProperties { + if o == nil || IsNil(o.DefaultConnectionProperties.Get()) { + var ret ConnectionDefaultConnectionProperties + return ret + } + return *o.DefaultConnectionProperties.Get() +} + +// GetDefaultConnectionPropertiesOk returns a tuple with the DefaultConnectionProperties field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Connection) GetDefaultConnectionPropertiesOk() (*ConnectionDefaultConnectionProperties, bool) { + if o == nil { + return nil, false + } + return o.DefaultConnectionProperties.Get(), o.DefaultConnectionProperties.IsSet() +} + +// HasDefaultConnectionProperties returns a boolean if a field has been set. +func (o *Connection) HasDefaultConnectionProperties() bool { + if o != nil && o.DefaultConnectionProperties.IsSet() { + return true + } + + return false +} + +// SetDefaultConnectionProperties gets a reference to the given NullableConnectionDefaultConnectionProperties and assigns it to the DefaultConnectionProperties field. +func (o *Connection) SetDefaultConnectionProperties(v ConnectionDefaultConnectionProperties) { + o.DefaultConnectionProperties.Set(&v) +} +// SetDefaultConnectionPropertiesNil sets the value for DefaultConnectionProperties to be an explicit nil +func (o *Connection) SetDefaultConnectionPropertiesNil() { + o.DefaultConnectionProperties.Set(nil) +} + +// UnsetDefaultConnectionProperties ensures that no value is present for DefaultConnectionProperties, not even an explicit nil +func (o *Connection) UnsetDefaultConnectionProperties() { + o.DefaultConnectionProperties.Unset() +} + +// GetCreatedTime returns the CreatedTime field value if set, zero value otherwise. +func (o *Connection) GetCreatedTime() time.Time { + if o == nil || IsNil(o.CreatedTime) { + var ret time.Time + return ret + } + return *o.CreatedTime +} + +// GetCreatedTimeOk returns a tuple with the CreatedTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Connection) GetCreatedTimeOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedTime) { + return nil, false + } + return o.CreatedTime, true +} + +// HasCreatedTime returns a boolean if a field has been set. +func (o *Connection) HasCreatedTime() bool { + if o != nil && !IsNil(o.CreatedTime) { + return true + } + + return false +} + +// SetCreatedTime gets a reference to the given time.Time and assigns it to the CreatedTime field. +func (o *Connection) SetCreatedTime(v time.Time) { + o.CreatedTime = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Connection) GetTags() map[string]string { + if o == nil { + var ret map[string]string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Connection) GetTagsOk() (*map[string]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return &o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *Connection) HasTags() bool { + if o != nil && IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given map[string]string and assigns it to the Tags field. +func (o *Connection) SetTags(v map[string]string) { + o.Tags = v +} + +func (o Connection) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Connection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if o.ConnectionId.IsSet() { + toSerialize["connectionId"] = o.ConnectionId.Get() + } + if !IsNil(o.AuthenticationUrl) { + toSerialize["authenticationUrl"] = o.AuthenticationUrl + } + if o.TokenUrl.IsSet() { + toSerialize["tokenUrl"] = o.TokenUrl.Get() + } + if o.IssuerUrl.IsSet() { + toSerialize["issuerUrl"] = o.IssuerUrl.Get() + } + if o.ProviderCertificate.IsSet() { + toSerialize["providerCertificate"] = o.ProviderCertificate.Get() + } + if o.ClientId.IsSet() { + toSerialize["clientId"] = o.ClientId.Get() + } + if o.ClientSecret.IsSet() { + toSerialize["clientSecret"] = o.ClientSecret.Get() + } + if o.UserDataConfiguration.IsSet() { + toSerialize["userDataConfiguration"] = o.UserDataConfiguration.Get() + } + if o.Data.IsSet() { + toSerialize["data"] = o.Data.Get() + } + if o.DefaultConnectionProperties.IsSet() { + toSerialize["defaultConnectionProperties"] = o.DefaultConnectionProperties.Get() + } + if !IsNil(o.CreatedTime) { + toSerialize["createdTime"] = o.CreatedTime + } + if o.Tags != nil { + toSerialize["tags"] = o.Tags + } + return toSerialize, nil +} + +type NullableConnection struct { + value *Connection + isSet bool +} + +func (v NullableConnection) Get() *Connection { + return v.value +} + +func (v *NullableConnection) Set(val *Connection) { + v.value = val + v.isSet = true +} + +func (v NullableConnection) IsSet() bool { + return v.isSet +} + +func (v *NullableConnection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConnection(val *Connection) *NullableConnection { + return &NullableConnection{value: val, isSet: true} +} + +func (v NullableConnection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConnection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_connection_collection.go b/src/models/model_connection_collection.go new file mode 100644 index 0000000..505e879 --- /dev/null +++ b/src/models/model_connection_collection.go @@ -0,0 +1,195 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ConnectionCollection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConnectionCollection{} + +// ConnectionCollection A collection of connections. +type ConnectionCollection struct { + Connections []Connection `json:"connections"` + Pagination *Pagination `json:"pagination,omitempty"` +} + +type _ConnectionCollection ConnectionCollection + +// NewConnectionCollection instantiates a new ConnectionCollection object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConnectionCollection(connections []Connection) *ConnectionCollection { + this := ConnectionCollection{} + this.Connections = connections + return &this +} + +// NewConnectionCollectionWithDefaults instantiates a new ConnectionCollection object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConnectionCollectionWithDefaults() *ConnectionCollection { + this := ConnectionCollection{} + return &this +} + +// GetConnections returns the Connections field value +func (o *ConnectionCollection) GetConnections() []Connection { + if o == nil { + var ret []Connection + return ret + } + + return o.Connections +} + +// GetConnectionsOk returns a tuple with the Connections field value +// and a boolean to check if the value has been set. +func (o *ConnectionCollection) GetConnectionsOk() ([]Connection, bool) { + if o == nil { + return nil, false + } + return o.Connections, true +} + +// SetConnections sets field value +func (o *ConnectionCollection) SetConnections(v []Connection) { + o.Connections = v +} + +// GetPagination returns the Pagination field value if set, zero value otherwise. +func (o *ConnectionCollection) GetPagination() Pagination { + if o == nil || IsNil(o.Pagination) { + var ret Pagination + return ret + } + return *o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConnectionCollection) GetPaginationOk() (*Pagination, bool) { + if o == nil || IsNil(o.Pagination) { + return nil, false + } + return o.Pagination, true +} + +// HasPagination returns a boolean if a field has been set. +func (o *ConnectionCollection) HasPagination() bool { + if o != nil && !IsNil(o.Pagination) { + return true + } + + return false +} + +// SetPagination gets a reference to the given Pagination and assigns it to the Pagination field. +func (o *ConnectionCollection) SetPagination(v Pagination) { + o.Pagination = &v +} + +func (o ConnectionCollection) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConnectionCollection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["connections"] = o.Connections + if !IsNil(o.Pagination) { + toSerialize["pagination"] = o.Pagination + } + return toSerialize, nil +} + +func (o *ConnectionCollection) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "connections", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varConnectionCollection := _ConnectionCollection{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varConnectionCollection) + + if err != nil { + return err + } + + *o = ConnectionCollection(varConnectionCollection) + + return err +} + +type NullableConnectionCollection struct { + value *ConnectionCollection + isSet bool +} + +func (v NullableConnectionCollection) Get() *ConnectionCollection { + return v.value +} + +func (v *NullableConnectionCollection) Set(val *ConnectionCollection) { + v.value = val + v.isSet = true +} + +func (v NullableConnectionCollection) IsSet() bool { + return v.isSet +} + +func (v *NullableConnectionCollection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConnectionCollection(val *ConnectionCollection) *NullableConnectionCollection { + return &NullableConnectionCollection{value: val, isSet: true} +} + +func (v NullableConnectionCollection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConnectionCollection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_connection_data.go b/src/models/model_connection_data.go new file mode 100644 index 0000000..a86c9ae --- /dev/null +++ b/src/models/model_connection_data.go @@ -0,0 +1,374 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" +) + +// checks if the ConnectionData type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConnectionData{} + +// ConnectionData struct for ConnectionData +type ConnectionData struct { + TenantId *TenantId `json:"tenantId,omitempty"` + // The name of this connection when displayed in the Authress management portal + Name NullableString `json:"name,omitempty"` + // URL encode OAuth token parameters - Some authentication APIs don't support JSON, in these cases enable the url encoded form data parameters. + SupportedContentType NullableString `json:"supportedContentType,omitempty"` + // By default, the **sub** claim of the JWT is used to identify the user from this provider. However, not all providers are OpenID compliant. Here you can provide an optional user data endpoint to fetch additional user profile information and an expression to identify a new user ID from available properties. + OidcUserEndpointUrl NullableString `json:"oidcUserEndpointUrl,omitempty"` + // By default, the **sub** claim of the JWT is used to identify the user from this provider. However, not all providers are OpenID compliant. Here you can provide an optional user expression to identify a new user ID from available properties found from the oidcUserEndpointUrl. (The default is **{sub}**, any claims may be used.) + UserIdExpression NullableString `json:"userIdExpression,omitempty"` + // Authress generates unique user IDs for every user, however if you trust your identity provider to handle unique ID generate across **ALL customers**, then it is safe to reuse the user ID from the provider. + TrustIdentityUserId NullableBool `json:"trustIdentityUserId,omitempty"` +} + +// NewConnectionData instantiates a new ConnectionData object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConnectionData() *ConnectionData { + this := ConnectionData{} + var supportedContentType SUPPORTED_CONTENT_TYPE = "application/json" + this.SupportedContentType = *NewNullableString(&supportedContentType) + var userIdExpression string = "{sub}" + this.UserIdExpression = *NewNullableString(&userIdExpression) + var trustIdentityUserId bool = false + this.TrustIdentityUserId = *NewNullableBool(&trustIdentityUserId) + return &this +} + +// NewConnectionDataWithDefaults instantiates a new ConnectionData object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConnectionDataWithDefaults() *ConnectionData { + this := ConnectionData{} + var supportedContentType SUPPORTED_CONTENT_TYPE = "application/json" + this.SupportedContentType = *NewNullableString(&supportedContentType) + var userIdExpression string = "{sub}" + this.UserIdExpression = *NewNullableString(&userIdExpression) + var trustIdentityUserId bool = false + this.TrustIdentityUserId = *NewNullableBool(&trustIdentityUserId) + return &this +} + +// GetTenantId returns the TenantId field value if set, zero value otherwise. +func (o *ConnectionData) GetTenantId() TenantId { + if o == nil || IsNil(o.TenantId) { + var ret TenantId + return ret + } + return *o.TenantId +} + +// GetTenantIdOk returns a tuple with the TenantId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConnectionData) GetTenantIdOk() (*TenantId, bool) { + if o == nil || IsNil(o.TenantId) { + return nil, false + } + return o.TenantId, true +} + +// HasTenantId returns a boolean if a field has been set. +func (o *ConnectionData) HasTenantId() bool { + if o != nil && !IsNil(o.TenantId) { + return true + } + + return false +} + +// SetTenantId gets a reference to the given TenantId and assigns it to the TenantId field. +func (o *ConnectionData) SetTenantId(v TenantId) { + o.TenantId = &v +} + +// GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ConnectionData) GetName() string { + if o == nil || IsNil(o.Name.Get()) { + var ret string + return ret + } + return *o.Name.Get() +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ConnectionData) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Name.Get(), o.Name.IsSet() +} + +// HasName returns a boolean if a field has been set. +func (o *ConnectionData) HasName() bool { + if o != nil && o.Name.IsSet() { + return true + } + + return false +} + +// SetName gets a reference to the given NullableString and assigns it to the Name field. +func (o *ConnectionData) SetName(v string) { + o.Name.Set(&v) +} +// SetNameNil sets the value for Name to be an explicit nil +func (o *ConnectionData) SetNameNil() { + o.Name.Set(nil) +} + +// UnsetName ensures that no value is present for Name, not even an explicit nil +func (o *ConnectionData) UnsetName() { + o.Name.Unset() +} + +// GetSupportedContentType returns the SupportedContentType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ConnectionData) GetSupportedContentType() string { + if o == nil || IsNil(o.SupportedContentType.Get()) { + var ret string + return ret + } + return *o.SupportedContentType.Get() +} + +// GetSupportedContentTypeOk returns a tuple with the SupportedContentType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ConnectionData) GetSupportedContentTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.SupportedContentType.Get(), o.SupportedContentType.IsSet() +} + +// HasSupportedContentType returns a boolean if a field has been set. +func (o *ConnectionData) HasSupportedContentType() bool { + if o != nil && o.SupportedContentType.IsSet() { + return true + } + + return false +} + +// SetSupportedContentType gets a reference to the given NullableString and assigns it to the SupportedContentType field. +func (o *ConnectionData) SetSupportedContentType(v string) { + o.SupportedContentType.Set(&v) +} +// SetSupportedContentTypeNil sets the value for SupportedContentType to be an explicit nil +func (o *ConnectionData) SetSupportedContentTypeNil() { + o.SupportedContentType.Set(nil) +} + +// UnsetSupportedContentType ensures that no value is present for SupportedContentType, not even an explicit nil +func (o *ConnectionData) UnsetSupportedContentType() { + o.SupportedContentType.Unset() +} + +// GetOidcUserEndpointUrl returns the OidcUserEndpointUrl field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ConnectionData) GetOidcUserEndpointUrl() string { + if o == nil || IsNil(o.OidcUserEndpointUrl.Get()) { + var ret string + return ret + } + return *o.OidcUserEndpointUrl.Get() +} + +// GetOidcUserEndpointUrlOk returns a tuple with the OidcUserEndpointUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ConnectionData) GetOidcUserEndpointUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.OidcUserEndpointUrl.Get(), o.OidcUserEndpointUrl.IsSet() +} + +// HasOidcUserEndpointUrl returns a boolean if a field has been set. +func (o *ConnectionData) HasOidcUserEndpointUrl() bool { + if o != nil && o.OidcUserEndpointUrl.IsSet() { + return true + } + + return false +} + +// SetOidcUserEndpointUrl gets a reference to the given NullableString and assigns it to the OidcUserEndpointUrl field. +func (o *ConnectionData) SetOidcUserEndpointUrl(v string) { + o.OidcUserEndpointUrl.Set(&v) +} +// SetOidcUserEndpointUrlNil sets the value for OidcUserEndpointUrl to be an explicit nil +func (o *ConnectionData) SetOidcUserEndpointUrlNil() { + o.OidcUserEndpointUrl.Set(nil) +} + +// UnsetOidcUserEndpointUrl ensures that no value is present for OidcUserEndpointUrl, not even an explicit nil +func (o *ConnectionData) UnsetOidcUserEndpointUrl() { + o.OidcUserEndpointUrl.Unset() +} + +// GetUserIdExpression returns the UserIdExpression field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ConnectionData) GetUserIdExpression() string { + if o == nil || IsNil(o.UserIdExpression.Get()) { + var ret string + return ret + } + return *o.UserIdExpression.Get() +} + +// GetUserIdExpressionOk returns a tuple with the UserIdExpression field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ConnectionData) GetUserIdExpressionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.UserIdExpression.Get(), o.UserIdExpression.IsSet() +} + +// HasUserIdExpression returns a boolean if a field has been set. +func (o *ConnectionData) HasUserIdExpression() bool { + if o != nil && o.UserIdExpression.IsSet() { + return true + } + + return false +} + +// SetUserIdExpression gets a reference to the given NullableString and assigns it to the UserIdExpression field. +func (o *ConnectionData) SetUserIdExpression(v string) { + o.UserIdExpression.Set(&v) +} +// SetUserIdExpressionNil sets the value for UserIdExpression to be an explicit nil +func (o *ConnectionData) SetUserIdExpressionNil() { + o.UserIdExpression.Set(nil) +} + +// UnsetUserIdExpression ensures that no value is present for UserIdExpression, not even an explicit nil +func (o *ConnectionData) UnsetUserIdExpression() { + o.UserIdExpression.Unset() +} + +// GetTrustIdentityUserId returns the TrustIdentityUserId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ConnectionData) GetTrustIdentityUserId() bool { + if o == nil || IsNil(o.TrustIdentityUserId.Get()) { + var ret bool + return ret + } + return *o.TrustIdentityUserId.Get() +} + +// GetTrustIdentityUserIdOk returns a tuple with the TrustIdentityUserId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ConnectionData) GetTrustIdentityUserIdOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.TrustIdentityUserId.Get(), o.TrustIdentityUserId.IsSet() +} + +// HasTrustIdentityUserId returns a boolean if a field has been set. +func (o *ConnectionData) HasTrustIdentityUserId() bool { + if o != nil && o.TrustIdentityUserId.IsSet() { + return true + } + + return false +} + +// SetTrustIdentityUserId gets a reference to the given NullableBool and assigns it to the TrustIdentityUserId field. +func (o *ConnectionData) SetTrustIdentityUserId(v bool) { + o.TrustIdentityUserId.Set(&v) +} +// SetTrustIdentityUserIdNil sets the value for TrustIdentityUserId to be an explicit nil +func (o *ConnectionData) SetTrustIdentityUserIdNil() { + o.TrustIdentityUserId.Set(nil) +} + +// UnsetTrustIdentityUserId ensures that no value is present for TrustIdentityUserId, not even an explicit nil +func (o *ConnectionData) UnsetTrustIdentityUserId() { + o.TrustIdentityUserId.Unset() +} + +func (o ConnectionData) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConnectionData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.TenantId) { + toSerialize["tenantId"] = o.TenantId + } + if o.Name.IsSet() { + toSerialize["name"] = o.Name.Get() + } + if o.SupportedContentType.IsSet() { + toSerialize["supportedContentType"] = o.SupportedContentType.Get() + } + if o.OidcUserEndpointUrl.IsSet() { + toSerialize["oidcUserEndpointUrl"] = o.OidcUserEndpointUrl.Get() + } + if o.UserIdExpression.IsSet() { + toSerialize["userIdExpression"] = o.UserIdExpression.Get() + } + if o.TrustIdentityUserId.IsSet() { + toSerialize["trustIdentityUserId"] = o.TrustIdentityUserId.Get() + } + return toSerialize, nil +} + +type NullableConnectionData struct { + value *ConnectionData + isSet bool +} + +func (v NullableConnectionData) Get() *ConnectionData { + return v.value +} + +func (v *NullableConnectionData) Set(val *ConnectionData) { + v.value = val + v.isSet = true +} + +func (v NullableConnectionData) IsSet() bool { + return v.isSet +} + +func (v *NullableConnectionData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConnectionData(val *ConnectionData) *NullableConnectionData { + return &NullableConnectionData{value: val, isSet: true} +} + +func (v NullableConnectionData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConnectionData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_connection_default_connection_properties.go b/src/models/model_connection_default_connection_properties.go new file mode 100644 index 0000000..ec80d34 --- /dev/null +++ b/src/models/model_connection_default_connection_properties.go @@ -0,0 +1,171 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" +) + +// checks if the ConnectionDefaultConnectionProperties type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConnectionDefaultConnectionProperties{} + +// ConnectionDefaultConnectionProperties struct for ConnectionDefaultConnectionProperties +type ConnectionDefaultConnectionProperties struct { + // Default OAuth scopes to use for every request (leave blank to remove scopes). + Scope NullableString `json:"scope,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ConnectionDefaultConnectionProperties ConnectionDefaultConnectionProperties + +// NewConnectionDefaultConnectionProperties instantiates a new ConnectionDefaultConnectionProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConnectionDefaultConnectionProperties() *ConnectionDefaultConnectionProperties { + this := ConnectionDefaultConnectionProperties{} + var scope string = "profile email openid" + this.Scope = *NewNullableString(&scope) + return &this +} + +// NewConnectionDefaultConnectionPropertiesWithDefaults instantiates a new ConnectionDefaultConnectionProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConnectionDefaultConnectionPropertiesWithDefaults() *ConnectionDefaultConnectionProperties { + this := ConnectionDefaultConnectionProperties{} + var scope string = "profile email openid" + this.Scope = *NewNullableString(&scope) + return &this +} + +// GetScope returns the Scope field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ConnectionDefaultConnectionProperties) GetScope() string { + if o == nil || IsNil(o.Scope.Get()) { + var ret string + return ret + } + return *o.Scope.Get() +} + +// GetScopeOk returns a tuple with the Scope field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ConnectionDefaultConnectionProperties) GetScopeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Scope.Get(), o.Scope.IsSet() +} + +// HasScope returns a boolean if a field has been set. +func (o *ConnectionDefaultConnectionProperties) HasScope() bool { + if o != nil && o.Scope.IsSet() { + return true + } + + return false +} + +// SetScope gets a reference to the given NullableString and assigns it to the Scope field. +func (o *ConnectionDefaultConnectionProperties) SetScope(v string) { + o.Scope.Set(&v) +} +// SetScopeNil sets the value for Scope to be an explicit nil +func (o *ConnectionDefaultConnectionProperties) SetScopeNil() { + o.Scope.Set(nil) +} + +// UnsetScope ensures that no value is present for Scope, not even an explicit nil +func (o *ConnectionDefaultConnectionProperties) UnsetScope() { + o.Scope.Unset() +} + +func (o ConnectionDefaultConnectionProperties) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConnectionDefaultConnectionProperties) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Scope.IsSet() { + toSerialize["scope"] = o.Scope.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ConnectionDefaultConnectionProperties) UnmarshalJSON(data []byte) (err error) { + varConnectionDefaultConnectionProperties := _ConnectionDefaultConnectionProperties{} + + err = json.Unmarshal(data, &varConnectionDefaultConnectionProperties) + + if err != nil { + return err + } + + *o = ConnectionDefaultConnectionProperties(varConnectionDefaultConnectionProperties) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "scope") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableConnectionDefaultConnectionProperties struct { + value *ConnectionDefaultConnectionProperties + isSet bool +} + +func (v NullableConnectionDefaultConnectionProperties) Get() *ConnectionDefaultConnectionProperties { + return v.value +} + +func (v *NullableConnectionDefaultConnectionProperties) Set(val *ConnectionDefaultConnectionProperties) { + v.value = val + v.isSet = true +} + +func (v NullableConnectionDefaultConnectionProperties) IsSet() bool { + return v.isSet +} + +func (v *NullableConnectionDefaultConnectionProperties) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConnectionDefaultConnectionProperties(val *ConnectionDefaultConnectionProperties) *NullableConnectionDefaultConnectionProperties { + return &NullableConnectionDefaultConnectionProperties{value: val, isSet: true} +} + +func (v NullableConnectionDefaultConnectionProperties) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConnectionDefaultConnectionProperties) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_connection_user_data_configuration.go b/src/models/model_connection_user_data_configuration.go new file mode 100644 index 0000000..5e802fd --- /dev/null +++ b/src/models/model_connection_user_data_configuration.go @@ -0,0 +1,138 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" +) + +// checks if the ConnectionUserDataConfiguration type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConnectionUserDataConfiguration{} + +// ConnectionUserDataConfiguration struct for ConnectionUserDataConfiguration +type ConnectionUserDataConfiguration struct { + // User data residency - The data residency to store the user specific data in. To ensure high performance and reliability, set to **null**, or to store the user's data only in one specific region, set the region here. Specifying the region reduces reliability, durability, and performance at the benefit of controlling the locality. + Location NullableString `json:"location,omitempty"` +} + +// NewConnectionUserDataConfiguration instantiates a new ConnectionUserDataConfiguration object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConnectionUserDataConfiguration() *ConnectionUserDataConfiguration { + this := ConnectionUserDataConfiguration{} + return &this +} + +// NewConnectionUserDataConfigurationWithDefaults instantiates a new ConnectionUserDataConfiguration object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConnectionUserDataConfigurationWithDefaults() *ConnectionUserDataConfiguration { + this := ConnectionUserDataConfiguration{} + return &this +} + +// GetLocation returns the Location field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ConnectionUserDataConfiguration) GetLocation() string { + if o == nil || IsNil(o.Location.Get()) { + var ret string + return ret + } + return *o.Location.Get() +} + +// GetLocationOk returns a tuple with the Location field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ConnectionUserDataConfiguration) GetLocationOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Location.Get(), o.Location.IsSet() +} + +// HasLocation returns a boolean if a field has been set. +func (o *ConnectionUserDataConfiguration) HasLocation() bool { + if o != nil && o.Location.IsSet() { + return true + } + + return false +} + +// SetLocation gets a reference to the given NullableString and assigns it to the Location field. +func (o *ConnectionUserDataConfiguration) SetLocation(v string) { + o.Location.Set(&v) +} +// SetLocationNil sets the value for Location to be an explicit nil +func (o *ConnectionUserDataConfiguration) SetLocationNil() { + o.Location.Set(nil) +} + +// UnsetLocation ensures that no value is present for Location, not even an explicit nil +func (o *ConnectionUserDataConfiguration) UnsetLocation() { + o.Location.Unset() +} + +func (o ConnectionUserDataConfiguration) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConnectionUserDataConfiguration) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Location.IsSet() { + toSerialize["location"] = o.Location.Get() + } + return toSerialize, nil +} + +type NullableConnectionUserDataConfiguration struct { + value *ConnectionUserDataConfiguration + isSet bool +} + +func (v NullableConnectionUserDataConfiguration) Get() *ConnectionUserDataConfiguration { + return v.value +} + +func (v *NullableConnectionUserDataConfiguration) Set(val *ConnectionUserDataConfiguration) { + v.value = val + v.isSet = true +} + +func (v NullableConnectionUserDataConfiguration) IsSet() bool { + return v.isSet +} + +func (v *NullableConnectionUserDataConfiguration) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConnectionUserDataConfiguration(val *ConnectionUserDataConfiguration) *NullableConnectionUserDataConfiguration { + return &NullableConnectionUserDataConfiguration{value: val, isSet: true} +} + +func (v NullableConnectionUserDataConfiguration) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConnectionUserDataConfiguration) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_extension.go b/src/models/model_extension.go new file mode 100644 index 0000000..efbbaa1 --- /dev/null +++ b/src/models/model_extension.go @@ -0,0 +1,337 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "time" + "bytes" + "fmt" +) + +// checks if the Extension type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Extension{} + +// Extension struct for Extension +type Extension struct { + ExtensionId string `json:"extensionId"` + // The name of the extension. This name is visible in the Authress management portal + Name NullableString `json:"name,omitempty"` + CreatedTime time.Time `json:"createdTime"` + Application *ExtensionApplication `json:"application,omitempty"` + Client ExtensionClient `json:"client"` + // The tags associated with this resource, this property is an map. { key1: value1, key2: value2 } + Tags map[string]string `json:"tags,omitempty"` +} + +type _Extension Extension + +// NewExtension instantiates a new Extension object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewExtension(extensionId string, createdTime time.Time, client ExtensionClient) *Extension { + this := Extension{} + this.ExtensionId = extensionId + this.CreatedTime = createdTime + this.Client = client + return &this +} + +// NewExtensionWithDefaults instantiates a new Extension object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewExtensionWithDefaults() *Extension { + this := Extension{} + return &this +} + +// GetExtensionId returns the ExtensionId field value +func (o *Extension) GetExtensionId() string { + if o == nil { + var ret string + return ret + } + + return o.ExtensionId +} + +// GetExtensionIdOk returns a tuple with the ExtensionId field value +// and a boolean to check if the value has been set. +func (o *Extension) GetExtensionIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ExtensionId, true +} + +// SetExtensionId sets field value +func (o *Extension) SetExtensionId(v string) { + o.ExtensionId = v +} + +// GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Extension) GetName() string { + if o == nil || IsNil(o.Name.Get()) { + var ret string + return ret + } + return *o.Name.Get() +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Extension) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Name.Get(), o.Name.IsSet() +} + +// HasName returns a boolean if a field has been set. +func (o *Extension) HasName() bool { + if o != nil && o.Name.IsSet() { + return true + } + + return false +} + +// SetName gets a reference to the given NullableString and assigns it to the Name field. +func (o *Extension) SetName(v string) { + o.Name.Set(&v) +} +// SetNameNil sets the value for Name to be an explicit nil +func (o *Extension) SetNameNil() { + o.Name.Set(nil) +} + +// UnsetName ensures that no value is present for Name, not even an explicit nil +func (o *Extension) UnsetName() { + o.Name.Unset() +} + +// GetCreatedTime returns the CreatedTime field value +func (o *Extension) GetCreatedTime() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.CreatedTime +} + +// GetCreatedTimeOk returns a tuple with the CreatedTime field value +// and a boolean to check if the value has been set. +func (o *Extension) GetCreatedTimeOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedTime, true +} + +// SetCreatedTime sets field value +func (o *Extension) SetCreatedTime(v time.Time) { + o.CreatedTime = v +} + +// GetApplication returns the Application field value if set, zero value otherwise. +func (o *Extension) GetApplication() ExtensionApplication { + if o == nil || IsNil(o.Application) { + var ret ExtensionApplication + return ret + } + return *o.Application +} + +// GetApplicationOk returns a tuple with the Application field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Extension) GetApplicationOk() (*ExtensionApplication, bool) { + if o == nil || IsNil(o.Application) { + return nil, false + } + return o.Application, true +} + +// HasApplication returns a boolean if a field has been set. +func (o *Extension) HasApplication() bool { + if o != nil && !IsNil(o.Application) { + return true + } + + return false +} + +// SetApplication gets a reference to the given ExtensionApplication and assigns it to the Application field. +func (o *Extension) SetApplication(v ExtensionApplication) { + o.Application = &v +} + +// GetClient returns the Client field value +func (o *Extension) GetClient() ExtensionClient { + if o == nil { + var ret ExtensionClient + return ret + } + + return o.Client +} + +// GetClientOk returns a tuple with the Client field value +// and a boolean to check if the value has been set. +func (o *Extension) GetClientOk() (*ExtensionClient, bool) { + if o == nil { + return nil, false + } + return &o.Client, true +} + +// SetClient sets field value +func (o *Extension) SetClient(v ExtensionClient) { + o.Client = v +} + +// GetTags returns the Tags field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Extension) GetTags() map[string]string { + if o == nil { + var ret map[string]string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Extension) GetTagsOk() (*map[string]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return &o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *Extension) HasTags() bool { + if o != nil && IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given map[string]string and assigns it to the Tags field. +func (o *Extension) SetTags(v map[string]string) { + o.Tags = v +} + +func (o Extension) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Extension) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["extensionId"] = o.ExtensionId + if o.Name.IsSet() { + toSerialize["name"] = o.Name.Get() + } + toSerialize["createdTime"] = o.CreatedTime + if !IsNil(o.Application) { + toSerialize["application"] = o.Application + } + toSerialize["client"] = o.Client + if o.Tags != nil { + toSerialize["tags"] = o.Tags + } + return toSerialize, nil +} + +func (o *Extension) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "extensionId", + "createdTime", + "client", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varExtension := _Extension{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varExtension) + + if err != nil { + return err + } + + *o = Extension(varExtension) + + return err +} + +type NullableExtension struct { + value *Extension + isSet bool +} + +func (v NullableExtension) Get() *Extension { + return v.value +} + +func (v *NullableExtension) Set(val *Extension) { + v.value = val + v.isSet = true +} + +func (v NullableExtension) IsSet() bool { + return v.isSet +} + +func (v *NullableExtension) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableExtension(val *Extension) *NullableExtension { + return &NullableExtension{value: val, isSet: true} +} + +func (v NullableExtension) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableExtension) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_extension_application.go b/src/models/model_extension_application.go new file mode 100644 index 0000000..6402ade --- /dev/null +++ b/src/models/model_extension_application.go @@ -0,0 +1,233 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ExtensionApplication type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ExtensionApplication{} + +// ExtensionApplication The extension's application configuration. The application contains the necessary information for users to log in to the extension. +type ExtensionApplication struct { + // The unique ID of the application. + ApplicationId string `json:"applicationId"` + RedirectUrls []string `json:"redirectUrls,omitempty"` + Links *Links `json:"links,omitempty"` +} + +type _ExtensionApplication ExtensionApplication + +// NewExtensionApplication instantiates a new ExtensionApplication object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewExtensionApplication(applicationId string) *ExtensionApplication { + this := ExtensionApplication{} + this.ApplicationId = applicationId + return &this +} + +// NewExtensionApplicationWithDefaults instantiates a new ExtensionApplication object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewExtensionApplicationWithDefaults() *ExtensionApplication { + this := ExtensionApplication{} + return &this +} + +// GetApplicationId returns the ApplicationId field value +func (o *ExtensionApplication) GetApplicationId() string { + if o == nil { + var ret string + return ret + } + + return o.ApplicationId +} + +// GetApplicationIdOk returns a tuple with the ApplicationId field value +// and a boolean to check if the value has been set. +func (o *ExtensionApplication) GetApplicationIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ApplicationId, true +} + +// SetApplicationId sets field value +func (o *ExtensionApplication) SetApplicationId(v string) { + o.ApplicationId = v +} + +// GetRedirectUrls returns the RedirectUrls field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ExtensionApplication) GetRedirectUrls() []string { + if o == nil { + var ret []string + return ret + } + return o.RedirectUrls +} + +// GetRedirectUrlsOk returns a tuple with the RedirectUrls field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ExtensionApplication) GetRedirectUrlsOk() ([]string, bool) { + if o == nil || IsNil(o.RedirectUrls) { + return nil, false + } + return o.RedirectUrls, true +} + +// HasRedirectUrls returns a boolean if a field has been set. +func (o *ExtensionApplication) HasRedirectUrls() bool { + if o != nil && IsNil(o.RedirectUrls) { + return true + } + + return false +} + +// SetRedirectUrls gets a reference to the given []string and assigns it to the RedirectUrls field. +func (o *ExtensionApplication) SetRedirectUrls(v []string) { + o.RedirectUrls = v +} + +// GetLinks returns the Links field value if set, zero value otherwise. +func (o *ExtensionApplication) GetLinks() Links { + if o == nil || IsNil(o.Links) { + var ret Links + return ret + } + return *o.Links +} + +// GetLinksOk returns a tuple with the Links field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ExtensionApplication) GetLinksOk() (*Links, bool) { + if o == nil || IsNil(o.Links) { + return nil, false + } + return o.Links, true +} + +// HasLinks returns a boolean if a field has been set. +func (o *ExtensionApplication) HasLinks() bool { + if o != nil && !IsNil(o.Links) { + return true + } + + return false +} + +// SetLinks gets a reference to the given Links and assigns it to the Links field. +func (o *ExtensionApplication) SetLinks(v Links) { + o.Links = &v +} + +func (o ExtensionApplication) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ExtensionApplication) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["applicationId"] = o.ApplicationId + if o.RedirectUrls != nil { + toSerialize["redirectUrls"] = o.RedirectUrls + } + if !IsNil(o.Links) { + toSerialize["links"] = o.Links + } + return toSerialize, nil +} + +func (o *ExtensionApplication) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "applicationId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varExtensionApplication := _ExtensionApplication{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varExtensionApplication) + + if err != nil { + return err + } + + *o = ExtensionApplication(varExtensionApplication) + + return err +} + +type NullableExtensionApplication struct { + value *ExtensionApplication + isSet bool +} + +func (v NullableExtensionApplication) Get() *ExtensionApplication { + return v.value +} + +func (v *NullableExtensionApplication) Set(val *ExtensionApplication) { + v.value = val + v.isSet = true +} + +func (v NullableExtensionApplication) IsSet() bool { + return v.isSet +} + +func (v *NullableExtensionApplication) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableExtensionApplication(val *ExtensionApplication) *NullableExtensionApplication { + return &NullableExtensionApplication{value: val, isSet: true} +} + +func (v NullableExtensionApplication) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableExtensionApplication) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_extension_client.go b/src/models/model_extension_client.go new file mode 100644 index 0000000..7566eeb --- /dev/null +++ b/src/models/model_extension_client.go @@ -0,0 +1,196 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ExtensionClient type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ExtensionClient{} + +// ExtensionClient The extension's client configuration. +type ExtensionClient struct { + // The unique ID of the client. + ClientId string `json:"clientId"` + Links *Links `json:"links,omitempty"` +} + +type _ExtensionClient ExtensionClient + +// NewExtensionClient instantiates a new ExtensionClient object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewExtensionClient(clientId string) *ExtensionClient { + this := ExtensionClient{} + this.ClientId = clientId + return &this +} + +// NewExtensionClientWithDefaults instantiates a new ExtensionClient object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewExtensionClientWithDefaults() *ExtensionClient { + this := ExtensionClient{} + return &this +} + +// GetClientId returns the ClientId field value +func (o *ExtensionClient) GetClientId() string { + if o == nil { + var ret string + return ret + } + + return o.ClientId +} + +// GetClientIdOk returns a tuple with the ClientId field value +// and a boolean to check if the value has been set. +func (o *ExtensionClient) GetClientIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientId, true +} + +// SetClientId sets field value +func (o *ExtensionClient) SetClientId(v string) { + o.ClientId = v +} + +// GetLinks returns the Links field value if set, zero value otherwise. +func (o *ExtensionClient) GetLinks() Links { + if o == nil || IsNil(o.Links) { + var ret Links + return ret + } + return *o.Links +} + +// GetLinksOk returns a tuple with the Links field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ExtensionClient) GetLinksOk() (*Links, bool) { + if o == nil || IsNil(o.Links) { + return nil, false + } + return o.Links, true +} + +// HasLinks returns a boolean if a field has been set. +func (o *ExtensionClient) HasLinks() bool { + if o != nil && !IsNil(o.Links) { + return true + } + + return false +} + +// SetLinks gets a reference to the given Links and assigns it to the Links field. +func (o *ExtensionClient) SetLinks(v Links) { + o.Links = &v +} + +func (o ExtensionClient) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ExtensionClient) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["clientId"] = o.ClientId + if !IsNil(o.Links) { + toSerialize["links"] = o.Links + } + return toSerialize, nil +} + +func (o *ExtensionClient) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "clientId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varExtensionClient := _ExtensionClient{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varExtensionClient) + + if err != nil { + return err + } + + *o = ExtensionClient(varExtensionClient) + + return err +} + +type NullableExtensionClient struct { + value *ExtensionClient + isSet bool +} + +func (v NullableExtensionClient) Get() *ExtensionClient { + return v.value +} + +func (v *NullableExtensionClient) Set(val *ExtensionClient) { + v.value = val + v.isSet = true +} + +func (v NullableExtensionClient) IsSet() bool { + return v.isSet +} + +func (v *NullableExtensionClient) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableExtensionClient(val *ExtensionClient) *NullableExtensionClient { + return &NullableExtensionClient{value: val, isSet: true} +} + +func (v NullableExtensionClient) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableExtensionClient) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_extension_collection.go b/src/models/model_extension_collection.go new file mode 100644 index 0000000..90f8ed5 --- /dev/null +++ b/src/models/model_extension_collection.go @@ -0,0 +1,195 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ExtensionCollection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ExtensionCollection{} + +// ExtensionCollection A collection of platform extensions. +type ExtensionCollection struct { + Extensions []Extension `json:"extensions"` + Pagination *Pagination `json:"pagination,omitempty"` +} + +type _ExtensionCollection ExtensionCollection + +// NewExtensionCollection instantiates a new ExtensionCollection object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewExtensionCollection(extensions []Extension) *ExtensionCollection { + this := ExtensionCollection{} + this.Extensions = extensions + return &this +} + +// NewExtensionCollectionWithDefaults instantiates a new ExtensionCollection object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewExtensionCollectionWithDefaults() *ExtensionCollection { + this := ExtensionCollection{} + return &this +} + +// GetExtensions returns the Extensions field value +func (o *ExtensionCollection) GetExtensions() []Extension { + if o == nil { + var ret []Extension + return ret + } + + return o.Extensions +} + +// GetExtensionsOk returns a tuple with the Extensions field value +// and a boolean to check if the value has been set. +func (o *ExtensionCollection) GetExtensionsOk() ([]Extension, bool) { + if o == nil { + return nil, false + } + return o.Extensions, true +} + +// SetExtensions sets field value +func (o *ExtensionCollection) SetExtensions(v []Extension) { + o.Extensions = v +} + +// GetPagination returns the Pagination field value if set, zero value otherwise. +func (o *ExtensionCollection) GetPagination() Pagination { + if o == nil || IsNil(o.Pagination) { + var ret Pagination + return ret + } + return *o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ExtensionCollection) GetPaginationOk() (*Pagination, bool) { + if o == nil || IsNil(o.Pagination) { + return nil, false + } + return o.Pagination, true +} + +// HasPagination returns a boolean if a field has been set. +func (o *ExtensionCollection) HasPagination() bool { + if o != nil && !IsNil(o.Pagination) { + return true + } + + return false +} + +// SetPagination gets a reference to the given Pagination and assigns it to the Pagination field. +func (o *ExtensionCollection) SetPagination(v Pagination) { + o.Pagination = &v +} + +func (o ExtensionCollection) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ExtensionCollection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["extensions"] = o.Extensions + if !IsNil(o.Pagination) { + toSerialize["pagination"] = o.Pagination + } + return toSerialize, nil +} + +func (o *ExtensionCollection) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "extensions", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varExtensionCollection := _ExtensionCollection{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varExtensionCollection) + + if err != nil { + return err + } + + *o = ExtensionCollection(varExtensionCollection) + + return err +} + +type NullableExtensionCollection struct { + value *ExtensionCollection + isSet bool +} + +func (v NullableExtensionCollection) Get() *ExtensionCollection { + return v.value +} + +func (v *NullableExtensionCollection) Set(val *ExtensionCollection) { + v.value = val + v.isSet = true +} + +func (v NullableExtensionCollection) IsSet() bool { + return v.isSet +} + +func (v *NullableExtensionCollection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableExtensionCollection(val *ExtensionCollection) *NullableExtensionCollection { + return &NullableExtensionCollection{value: val, isSet: true} +} + +func (v NullableExtensionCollection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableExtensionCollection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_group.go b/src/models/model_group.go new file mode 100644 index 0000000..abd420b --- /dev/null +++ b/src/models/model_group.go @@ -0,0 +1,367 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "time" + "bytes" + "fmt" +) + +// checks if the Group type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Group{} + +// Group A group of users, which can be added to access records. +type Group struct { + // Unique identifier for the groupId, can be specified on record creation. Must begin with grp_. + GroupId *string `json:"groupId,omitempty"` + // A helpful name for this record + Name string `json:"name"` + // The expected last time the group was updated + LastUpdated *time.Time `json:"lastUpdated,omitempty"` + // The list of users in this group + Users []User `json:"users"` + // The list of admins that can edit this record even if they do not have global record edit permissions. + Admins []User `json:"admins"` + Links *AccountLinks `json:"links,omitempty"` + // The tags associated with this resource, this property is an map. { key1: value1, key2: value2 } + Tags map[string]string `json:"tags,omitempty"` +} + +type _Group Group + +// NewGroup instantiates a new Group object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGroup(name string, users []User, admins []User) *Group { + this := Group{} + this.Name = name + this.Users = users + this.Admins = admins + return &this +} + +// NewGroupWithDefaults instantiates a new Group object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGroupWithDefaults() *Group { + this := Group{} + return &this +} + +// GetGroupId returns the GroupId field value if set, zero value otherwise. +func (o *Group) GetGroupId() string { + if o == nil || IsNil(o.GroupId) { + var ret string + return ret + } + return *o.GroupId +} + +// GetGroupIdOk returns a tuple with the GroupId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Group) GetGroupIdOk() (*string, bool) { + if o == nil || IsNil(o.GroupId) { + return nil, false + } + return o.GroupId, true +} + +// HasGroupId returns a boolean if a field has been set. +func (o *Group) HasGroupId() bool { + if o != nil && !IsNil(o.GroupId) { + return true + } + + return false +} + +// SetGroupId gets a reference to the given string and assigns it to the GroupId field. +func (o *Group) SetGroupId(v string) { + o.GroupId = &v +} + +// GetName returns the Name field value +func (o *Group) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Group) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Group) SetName(v string) { + o.Name = v +} + +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise. +func (o *Group) GetLastUpdated() time.Time { + if o == nil || IsNil(o.LastUpdated) { + var ret time.Time + return ret + } + return *o.LastUpdated +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Group) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil || IsNil(o.LastUpdated) { + return nil, false + } + return o.LastUpdated, true +} + +// HasLastUpdated returns a boolean if a field has been set. +func (o *Group) HasLastUpdated() bool { + if o != nil && !IsNil(o.LastUpdated) { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given time.Time and assigns it to the LastUpdated field. +func (o *Group) SetLastUpdated(v time.Time) { + o.LastUpdated = &v +} + +// GetUsers returns the Users field value +func (o *Group) GetUsers() []User { + if o == nil { + var ret []User + return ret + } + + return o.Users +} + +// GetUsersOk returns a tuple with the Users field value +// and a boolean to check if the value has been set. +func (o *Group) GetUsersOk() ([]User, bool) { + if o == nil { + return nil, false + } + return o.Users, true +} + +// SetUsers sets field value +func (o *Group) SetUsers(v []User) { + o.Users = v +} + +// GetAdmins returns the Admins field value +func (o *Group) GetAdmins() []User { + if o == nil { + var ret []User + return ret + } + + return o.Admins +} + +// GetAdminsOk returns a tuple with the Admins field value +// and a boolean to check if the value has been set. +func (o *Group) GetAdminsOk() ([]User, bool) { + if o == nil { + return nil, false + } + return o.Admins, true +} + +// SetAdmins sets field value +func (o *Group) SetAdmins(v []User) { + o.Admins = v +} + +// GetLinks returns the Links field value if set, zero value otherwise. +func (o *Group) GetLinks() AccountLinks { + if o == nil || IsNil(o.Links) { + var ret AccountLinks + return ret + } + return *o.Links +} + +// GetLinksOk returns a tuple with the Links field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Group) GetLinksOk() (*AccountLinks, bool) { + if o == nil || IsNil(o.Links) { + return nil, false + } + return o.Links, true +} + +// HasLinks returns a boolean if a field has been set. +func (o *Group) HasLinks() bool { + if o != nil && !IsNil(o.Links) { + return true + } + + return false +} + +// SetLinks gets a reference to the given AccountLinks and assigns it to the Links field. +func (o *Group) SetLinks(v AccountLinks) { + o.Links = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Group) GetTags() map[string]string { + if o == nil { + var ret map[string]string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Group) GetTagsOk() (*map[string]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return &o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *Group) HasTags() bool { + if o != nil && IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given map[string]string and assigns it to the Tags field. +func (o *Group) SetTags(v map[string]string) { + o.Tags = v +} + +func (o Group) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Group) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.GroupId) { + toSerialize["groupId"] = o.GroupId + } + toSerialize["name"] = o.Name + if !IsNil(o.LastUpdated) { + toSerialize["lastUpdated"] = o.LastUpdated + } + toSerialize["users"] = o.Users + toSerialize["admins"] = o.Admins + if !IsNil(o.Links) { + toSerialize["links"] = o.Links + } + if o.Tags != nil { + toSerialize["tags"] = o.Tags + } + return toSerialize, nil +} + +func (o *Group) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "users", + "admins", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGroup := _Group{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGroup) + + if err != nil { + return err + } + + *o = Group(varGroup) + + return err +} + +type NullableGroup struct { + value *Group + isSet bool +} + +func (v NullableGroup) Get() *Group { + return v.value +} + +func (v *NullableGroup) Set(val *Group) { + v.value = val + v.isSet = true +} + +func (v NullableGroup) IsSet() bool { + return v.isSet +} + +func (v *NullableGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGroup(val *Group) *NullableGroup { + return &NullableGroup{value: val, isSet: true} +} + +func (v NullableGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_group_collection.go b/src/models/model_group_collection.go new file mode 100644 index 0000000..699de6a --- /dev/null +++ b/src/models/model_group_collection.go @@ -0,0 +1,224 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the GroupCollection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GroupCollection{} + +// GroupCollection A collection of groups +type GroupCollection struct { + // A list of groups + Groups []Group `json:"groups"` + Pagination *Pagination `json:"pagination,omitempty"` + Links CollectionLinks `json:"links"` +} + +type _GroupCollection GroupCollection + +// NewGroupCollection instantiates a new GroupCollection object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGroupCollection(groups []Group, links CollectionLinks) *GroupCollection { + this := GroupCollection{} + this.Groups = groups + this.Links = links + return &this +} + +// NewGroupCollectionWithDefaults instantiates a new GroupCollection object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGroupCollectionWithDefaults() *GroupCollection { + this := GroupCollection{} + return &this +} + +// GetGroups returns the Groups field value +func (o *GroupCollection) GetGroups() []Group { + if o == nil { + var ret []Group + return ret + } + + return o.Groups +} + +// GetGroupsOk returns a tuple with the Groups field value +// and a boolean to check if the value has been set. +func (o *GroupCollection) GetGroupsOk() ([]Group, bool) { + if o == nil { + return nil, false + } + return o.Groups, true +} + +// SetGroups sets field value +func (o *GroupCollection) SetGroups(v []Group) { + o.Groups = v +} + +// GetPagination returns the Pagination field value if set, zero value otherwise. +func (o *GroupCollection) GetPagination() Pagination { + if o == nil || IsNil(o.Pagination) { + var ret Pagination + return ret + } + return *o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GroupCollection) GetPaginationOk() (*Pagination, bool) { + if o == nil || IsNil(o.Pagination) { + return nil, false + } + return o.Pagination, true +} + +// HasPagination returns a boolean if a field has been set. +func (o *GroupCollection) HasPagination() bool { + if o != nil && !IsNil(o.Pagination) { + return true + } + + return false +} + +// SetPagination gets a reference to the given Pagination and assigns it to the Pagination field. +func (o *GroupCollection) SetPagination(v Pagination) { + o.Pagination = &v +} + +// GetLinks returns the Links field value +func (o *GroupCollection) GetLinks() CollectionLinks { + if o == nil { + var ret CollectionLinks + return ret + } + + return o.Links +} + +// GetLinksOk returns a tuple with the Links field value +// and a boolean to check if the value has been set. +func (o *GroupCollection) GetLinksOk() (*CollectionLinks, bool) { + if o == nil { + return nil, false + } + return &o.Links, true +} + +// SetLinks sets field value +func (o *GroupCollection) SetLinks(v CollectionLinks) { + o.Links = v +} + +func (o GroupCollection) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GroupCollection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["groups"] = o.Groups + if !IsNil(o.Pagination) { + toSerialize["pagination"] = o.Pagination + } + toSerialize["links"] = o.Links + return toSerialize, nil +} + +func (o *GroupCollection) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "groups", + "links", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGroupCollection := _GroupCollection{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGroupCollection) + + if err != nil { + return err + } + + *o = GroupCollection(varGroupCollection) + + return err +} + +type NullableGroupCollection struct { + value *GroupCollection + isSet bool +} + +func (v NullableGroupCollection) Get() *GroupCollection { + return v.value +} + +func (v *NullableGroupCollection) Set(val *GroupCollection) { + v.value = val + v.isSet = true +} + +func (v NullableGroupCollection) IsSet() bool { + return v.isSet +} + +func (v *NullableGroupCollection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGroupCollection(val *GroupCollection) *NullableGroupCollection { + return &NullableGroupCollection{value: val, isSet: true} +} + +func (v NullableGroupCollection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGroupCollection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_identity.go b/src/models/model_identity.go new file mode 100644 index 0000000..432f902 --- /dev/null +++ b/src/models/model_identity.go @@ -0,0 +1,240 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the Identity type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Identity{} + +// Identity The identifying information which uniquely links a JWT OIDC token to an identity provider +type Identity struct { + // The issuer of the JWT token. This can be any OIDC compliant provider. + Issuer string `json:"issuer"` + // The audience of the JWT token. This can be either an audience for your entire app, or one particular audience for it. If there is more than one audience, multiple identities can be created. + Audience string `json:"audience"` + // By default, the **sub** claim of the JWT is used to identify the user from this provider. To use an alternate claim or a compound userId resolution, specify an expression. The resolved userId must be the same one that is later used in Authress access records. + UserIdExpression NullableString `json:"userIdExpression,omitempty"` +} + +type _Identity Identity + +// NewIdentity instantiates a new Identity object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIdentity(issuer string, audience string) *Identity { + this := Identity{} + this.Issuer = issuer + this.Audience = audience + var userIdExpression string = "{sub}" + this.UserIdExpression = *NewNullableString(&userIdExpression) + return &this +} + +// NewIdentityWithDefaults instantiates a new Identity object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIdentityWithDefaults() *Identity { + this := Identity{} + var userIdExpression string = "{sub}" + this.UserIdExpression = *NewNullableString(&userIdExpression) + return &this +} + +// GetIssuer returns the Issuer field value +func (o *Identity) GetIssuer() string { + if o == nil { + var ret string + return ret + } + + return o.Issuer +} + +// GetIssuerOk returns a tuple with the Issuer field value +// and a boolean to check if the value has been set. +func (o *Identity) GetIssuerOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Issuer, true +} + +// SetIssuer sets field value +func (o *Identity) SetIssuer(v string) { + o.Issuer = v +} + +// GetAudience returns the Audience field value +func (o *Identity) GetAudience() string { + if o == nil { + var ret string + return ret + } + + return o.Audience +} + +// GetAudienceOk returns a tuple with the Audience field value +// and a boolean to check if the value has been set. +func (o *Identity) GetAudienceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Audience, true +} + +// SetAudience sets field value +func (o *Identity) SetAudience(v string) { + o.Audience = v +} + +// GetUserIdExpression returns the UserIdExpression field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Identity) GetUserIdExpression() string { + if o == nil || IsNil(o.UserIdExpression.Get()) { + var ret string + return ret + } + return *o.UserIdExpression.Get() +} + +// GetUserIdExpressionOk returns a tuple with the UserIdExpression field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Identity) GetUserIdExpressionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.UserIdExpression.Get(), o.UserIdExpression.IsSet() +} + +// HasUserIdExpression returns a boolean if a field has been set. +func (o *Identity) HasUserIdExpression() bool { + if o != nil && o.UserIdExpression.IsSet() { + return true + } + + return false +} + +// SetUserIdExpression gets a reference to the given NullableString and assigns it to the UserIdExpression field. +func (o *Identity) SetUserIdExpression(v string) { + o.UserIdExpression.Set(&v) +} +// SetUserIdExpressionNil sets the value for UserIdExpression to be an explicit nil +func (o *Identity) SetUserIdExpressionNil() { + o.UserIdExpression.Set(nil) +} + +// UnsetUserIdExpression ensures that no value is present for UserIdExpression, not even an explicit nil +func (o *Identity) UnsetUserIdExpression() { + o.UserIdExpression.Unset() +} + +func (o Identity) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Identity) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["issuer"] = o.Issuer + toSerialize["audience"] = o.Audience + if o.UserIdExpression.IsSet() { + toSerialize["userIdExpression"] = o.UserIdExpression.Get() + } + return toSerialize, nil +} + +func (o *Identity) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "issuer", + "audience", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varIdentity := _Identity{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varIdentity) + + if err != nil { + return err + } + + *o = Identity(varIdentity) + + return err +} + +type NullableIdentity struct { + value *Identity + isSet bool +} + +func (v NullableIdentity) Get() *Identity { + return v.value +} + +func (v *NullableIdentity) Set(val *Identity) { + v.value = val + v.isSet = true +} + +func (v NullableIdentity) IsSet() bool { + return v.isSet +} + +func (v *NullableIdentity) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIdentity(val *Identity) *NullableIdentity { + return &NullableIdentity{value: val, isSet: true} +} + +func (v NullableIdentity) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIdentity) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_identity_collection.go b/src/models/model_identity_collection.go new file mode 100644 index 0000000..a07c031 --- /dev/null +++ b/src/models/model_identity_collection.go @@ -0,0 +1,159 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the IdentityCollection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IdentityCollection{} + +// IdentityCollection struct for IdentityCollection +type IdentityCollection struct { + Identities []Identity `json:"identities"` +} + +type _IdentityCollection IdentityCollection + +// NewIdentityCollection instantiates a new IdentityCollection object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIdentityCollection(identities []Identity) *IdentityCollection { + this := IdentityCollection{} + this.Identities = identities + return &this +} + +// NewIdentityCollectionWithDefaults instantiates a new IdentityCollection object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIdentityCollectionWithDefaults() *IdentityCollection { + this := IdentityCollection{} + return &this +} + +// GetIdentities returns the Identities field value +func (o *IdentityCollection) GetIdentities() []Identity { + if o == nil { + var ret []Identity + return ret + } + + return o.Identities +} + +// GetIdentitiesOk returns a tuple with the Identities field value +// and a boolean to check if the value has been set. +func (o *IdentityCollection) GetIdentitiesOk() ([]Identity, bool) { + if o == nil { + return nil, false + } + return o.Identities, true +} + +// SetIdentities sets field value +func (o *IdentityCollection) SetIdentities(v []Identity) { + o.Identities = v +} + +func (o IdentityCollection) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IdentityCollection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["identities"] = o.Identities + return toSerialize, nil +} + +func (o *IdentityCollection) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "identities", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varIdentityCollection := _IdentityCollection{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varIdentityCollection) + + if err != nil { + return err + } + + *o = IdentityCollection(varIdentityCollection) + + return err +} + +type NullableIdentityCollection struct { + value *IdentityCollection + isSet bool +} + +func (v NullableIdentityCollection) Get() *IdentityCollection { + return v.value +} + +func (v *NullableIdentityCollection) Set(val *IdentityCollection) { + v.value = val + v.isSet = true +} + +func (v NullableIdentityCollection) IsSet() bool { + return v.isSet +} + +func (v *NullableIdentityCollection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIdentityCollection(val *IdentityCollection) *NullableIdentityCollection { + return &NullableIdentityCollection{value: val, isSet: true} +} + +func (v NullableIdentityCollection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIdentityCollection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_identity_request.go b/src/models/model_identity_request.go new file mode 100644 index 0000000..dd5c8d8 --- /dev/null +++ b/src/models/model_identity_request.go @@ -0,0 +1,283 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" +) + +// checks if the IdentityRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IdentityRequest{} + +// IdentityRequest Request to link an identity provider's audience and your app's audience with Authress. +type IdentityRequest struct { + // A valid JWT OIDC compliant token which will still pass authentication requests to the identity provider. Must contain a unique audience and issuer. + Jwt NullableString `json:"jwt,omitempty"` + // The issuer of the OAuth OIDC provider's JWTs. This value should match the `iss` claim in the provided tokens exactly. + Issuer NullableString `json:"issuer,omitempty"` + // If the `jwt` token contains more than one valid audience, then the single audience that should associated with Authress. If more than one audience is preferred, repeat this call with each one. + PreferredAudience NullableString `json:"preferredAudience,omitempty"` + // By default, the **sub** claim of the JWT is used to identify the user from this provider. To use an alternate claim or a compound userId resolution, specify an expression. The resolved userId must be the same one that is later used in Authress access records. + UserIdExpression NullableString `json:"userIdExpression,omitempty"` +} + +// NewIdentityRequest instantiates a new IdentityRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIdentityRequest() *IdentityRequest { + this := IdentityRequest{} + return &this +} + +// NewIdentityRequestWithDefaults instantiates a new IdentityRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIdentityRequestWithDefaults() *IdentityRequest { + this := IdentityRequest{} + var preferredAudience string = "*" + this.PreferredAudience = *NewNullableString(&preferredAudience) + var userIdExpression string = "{sub}" + this.UserIdExpression = *NewNullableString(&userIdExpression) + return &this +} + +// GetJwt returns the Jwt field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IdentityRequest) GetJwt() string { + if o == nil || IsNil(o.Jwt.Get()) { + var ret string + return ret + } + return *o.Jwt.Get() +} + +// GetJwtOk returns a tuple with the Jwt field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IdentityRequest) GetJwtOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Jwt.Get(), o.Jwt.IsSet() +} + +// HasJwt returns a boolean if a field has been set. +func (o *IdentityRequest) HasJwt() bool { + if o != nil && o.Jwt.IsSet() { + return true + } + + return false +} + +// SetJwt gets a reference to the given NullableString and assigns it to the Jwt field. +func (o *IdentityRequest) SetJwt(v string) { + o.Jwt.Set(&v) +} +// SetJwtNil sets the value for Jwt to be an explicit nil +func (o *IdentityRequest) SetJwtNil() { + o.Jwt.Set(nil) +} + +// UnsetJwt ensures that no value is present for Jwt, not even an explicit nil +func (o *IdentityRequest) UnsetJwt() { + o.Jwt.Unset() +} + +// GetIssuer returns the Issuer field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IdentityRequest) GetIssuer() string { + if o == nil || IsNil(o.Issuer.Get()) { + var ret string + return ret + } + return *o.Issuer.Get() +} + +// GetIssuerOk returns a tuple with the Issuer field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IdentityRequest) GetIssuerOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Issuer.Get(), o.Issuer.IsSet() +} + +// HasIssuer returns a boolean if a field has been set. +func (o *IdentityRequest) HasIssuer() bool { + if o != nil && o.Issuer.IsSet() { + return true + } + + return false +} + +// SetIssuer gets a reference to the given NullableString and assigns it to the Issuer field. +func (o *IdentityRequest) SetIssuer(v string) { + o.Issuer.Set(&v) +} +// SetIssuerNil sets the value for Issuer to be an explicit nil +func (o *IdentityRequest) SetIssuerNil() { + o.Issuer.Set(nil) +} + +// UnsetIssuer ensures that no value is present for Issuer, not even an explicit nil +func (o *IdentityRequest) UnsetIssuer() { + o.Issuer.Unset() +} + +// GetPreferredAudience returns the PreferredAudience field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IdentityRequest) GetPreferredAudience() string { + if o == nil || IsNil(o.PreferredAudience.Get()) { + var ret string + return ret + } + return *o.PreferredAudience.Get() +} + +// GetPreferredAudienceOk returns a tuple with the PreferredAudience field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IdentityRequest) GetPreferredAudienceOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.PreferredAudience.Get(), o.PreferredAudience.IsSet() +} + +// HasPreferredAudience returns a boolean if a field has been set. +func (o *IdentityRequest) HasPreferredAudience() bool { + if o != nil && o.PreferredAudience.IsSet() { + return true + } + + return false +} + +// SetPreferredAudience gets a reference to the given NullableString and assigns it to the PreferredAudience field. +func (o *IdentityRequest) SetPreferredAudience(v string) { + o.PreferredAudience.Set(&v) +} +// SetPreferredAudienceNil sets the value for PreferredAudience to be an explicit nil +func (o *IdentityRequest) SetPreferredAudienceNil() { + o.PreferredAudience.Set(nil) +} + +// UnsetPreferredAudience ensures that no value is present for PreferredAudience, not even an explicit nil +func (o *IdentityRequest) UnsetPreferredAudience() { + o.PreferredAudience.Unset() +} + +// GetUserIdExpression returns the UserIdExpression field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IdentityRequest) GetUserIdExpression() string { + if o == nil || IsNil(o.UserIdExpression.Get()) { + var ret string + return ret + } + return *o.UserIdExpression.Get() +} + +// GetUserIdExpressionOk returns a tuple with the UserIdExpression field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IdentityRequest) GetUserIdExpressionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.UserIdExpression.Get(), o.UserIdExpression.IsSet() +} + +// HasUserIdExpression returns a boolean if a field has been set. +func (o *IdentityRequest) HasUserIdExpression() bool { + if o != nil && o.UserIdExpression.IsSet() { + return true + } + + return false +} + +// SetUserIdExpression gets a reference to the given NullableString and assigns it to the UserIdExpression field. +func (o *IdentityRequest) SetUserIdExpression(v string) { + o.UserIdExpression.Set(&v) +} +// SetUserIdExpressionNil sets the value for UserIdExpression to be an explicit nil +func (o *IdentityRequest) SetUserIdExpressionNil() { + o.UserIdExpression.Set(nil) +} + +// UnsetUserIdExpression ensures that no value is present for UserIdExpression, not even an explicit nil +func (o *IdentityRequest) UnsetUserIdExpression() { + o.UserIdExpression.Unset() +} + +func (o IdentityRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IdentityRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Jwt.IsSet() { + toSerialize["jwt"] = o.Jwt.Get() + } + if o.Issuer.IsSet() { + toSerialize["issuer"] = o.Issuer.Get() + } + if o.PreferredAudience.IsSet() { + toSerialize["preferredAudience"] = o.PreferredAudience.Get() + } + if o.UserIdExpression.IsSet() { + toSerialize["userIdExpression"] = o.UserIdExpression.Get() + } + return toSerialize, nil +} + +type NullableIdentityRequest struct { + value *IdentityRequest + isSet bool +} + +func (v NullableIdentityRequest) Get() *IdentityRequest { + return v.value +} + +func (v *NullableIdentityRequest) Set(val *IdentityRequest) { + v.value = val + v.isSet = true +} + +func (v NullableIdentityRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableIdentityRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIdentityRequest(val *IdentityRequest) *NullableIdentityRequest { + return &NullableIdentityRequest{value: val, isSet: true} +} + +func (v NullableIdentityRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIdentityRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_invite.go b/src/models/model_invite.go new file mode 100644 index 0000000..86aa05f --- /dev/null +++ b/src/models/model_invite.go @@ -0,0 +1,261 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the Invite type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Invite{} + +// Invite The user invite used to invite users to your application or to Authress as an admin. +type Invite struct { + // The unique identifier for the invite. Use this ID to accept the invite. This parameter is ignored during invite creation. + InviteId string `json:"inviteId"` + TenantId *TenantId `json:"tenantId,omitempty"` + // A list of statements which match roles to resources. The invited user will all statements apply to them when the invite is accepted. + Statements []Statement `json:"statements"` + Links *AccountLinks `json:"links,omitempty"` +} + +type _Invite Invite + +// NewInvite instantiates a new Invite object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInvite(inviteId string, statements []Statement) *Invite { + this := Invite{} + this.InviteId = inviteId + this.Statements = statements + return &this +} + +// NewInviteWithDefaults instantiates a new Invite object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInviteWithDefaults() *Invite { + this := Invite{} + return &this +} + +// GetInviteId returns the InviteId field value +func (o *Invite) GetInviteId() string { + if o == nil { + var ret string + return ret + } + + return o.InviteId +} + +// GetInviteIdOk returns a tuple with the InviteId field value +// and a boolean to check if the value has been set. +func (o *Invite) GetInviteIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.InviteId, true +} + +// SetInviteId sets field value +func (o *Invite) SetInviteId(v string) { + o.InviteId = v +} + +// GetTenantId returns the TenantId field value if set, zero value otherwise. +func (o *Invite) GetTenantId() TenantId { + if o == nil || IsNil(o.TenantId) { + var ret TenantId + return ret + } + return *o.TenantId +} + +// GetTenantIdOk returns a tuple with the TenantId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Invite) GetTenantIdOk() (*TenantId, bool) { + if o == nil || IsNil(o.TenantId) { + return nil, false + } + return o.TenantId, true +} + +// HasTenantId returns a boolean if a field has been set. +func (o *Invite) HasTenantId() bool { + if o != nil && !IsNil(o.TenantId) { + return true + } + + return false +} + +// SetTenantId gets a reference to the given TenantId and assigns it to the TenantId field. +func (o *Invite) SetTenantId(v TenantId) { + o.TenantId = &v +} + +// GetStatements returns the Statements field value +func (o *Invite) GetStatements() []Statement { + if o == nil { + var ret []Statement + return ret + } + + return o.Statements +} + +// GetStatementsOk returns a tuple with the Statements field value +// and a boolean to check if the value has been set. +func (o *Invite) GetStatementsOk() ([]Statement, bool) { + if o == nil { + return nil, false + } + return o.Statements, true +} + +// SetStatements sets field value +func (o *Invite) SetStatements(v []Statement) { + o.Statements = v +} + +// GetLinks returns the Links field value if set, zero value otherwise. +func (o *Invite) GetLinks() AccountLinks { + if o == nil || IsNil(o.Links) { + var ret AccountLinks + return ret + } + return *o.Links +} + +// GetLinksOk returns a tuple with the Links field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Invite) GetLinksOk() (*AccountLinks, bool) { + if o == nil || IsNil(o.Links) { + return nil, false + } + return o.Links, true +} + +// HasLinks returns a boolean if a field has been set. +func (o *Invite) HasLinks() bool { + if o != nil && !IsNil(o.Links) { + return true + } + + return false +} + +// SetLinks gets a reference to the given AccountLinks and assigns it to the Links field. +func (o *Invite) SetLinks(v AccountLinks) { + o.Links = &v +} + +func (o Invite) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Invite) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["inviteId"] = o.InviteId + if !IsNil(o.TenantId) { + toSerialize["tenantId"] = o.TenantId + } + toSerialize["statements"] = o.Statements + if !IsNil(o.Links) { + toSerialize["links"] = o.Links + } + return toSerialize, nil +} + +func (o *Invite) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "inviteId", + "statements", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInvite := _Invite{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varInvite) + + if err != nil { + return err + } + + *o = Invite(varInvite) + + return err +} + +type NullableInvite struct { + value *Invite + isSet bool +} + +func (v NullableInvite) Get() *Invite { + return v.value +} + +func (v *NullableInvite) Set(val *Invite) { + v.value = val + v.isSet = true +} + +func (v NullableInvite) IsSet() bool { + return v.isSet +} + +func (v *NullableInvite) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvite(val *Invite) *NullableInvite { + return &NullableInvite{value: val, isSet: true} +} + +func (v NullableInvite) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvite) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_link.go b/src/models/model_link.go new file mode 100644 index 0000000..e435261 --- /dev/null +++ b/src/models/model_link.go @@ -0,0 +1,197 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the Link type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Link{} + +// Link A url linking object that complies to application/links+json RFC. Either is an IANA approved link relation or has a custom rel specified. +type Link struct { + // The absolute url pointing to the reference resource. + Href string `json:"href"` + // Optional property indicating the type of link if it is not a default IANA approved global link relation. + Rel *string `json:"rel,omitempty"` +} + +type _Link Link + +// NewLink instantiates a new Link object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLink(href string) *Link { + this := Link{} + this.Href = href + return &this +} + +// NewLinkWithDefaults instantiates a new Link object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLinkWithDefaults() *Link { + this := Link{} + return &this +} + +// GetHref returns the Href field value +func (o *Link) GetHref() string { + if o == nil { + var ret string + return ret + } + + return o.Href +} + +// GetHrefOk returns a tuple with the Href field value +// and a boolean to check if the value has been set. +func (o *Link) GetHrefOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Href, true +} + +// SetHref sets field value +func (o *Link) SetHref(v string) { + o.Href = v +} + +// GetRel returns the Rel field value if set, zero value otherwise. +func (o *Link) GetRel() string { + if o == nil || IsNil(o.Rel) { + var ret string + return ret + } + return *o.Rel +} + +// GetRelOk returns a tuple with the Rel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Link) GetRelOk() (*string, bool) { + if o == nil || IsNil(o.Rel) { + return nil, false + } + return o.Rel, true +} + +// HasRel returns a boolean if a field has been set. +func (o *Link) HasRel() bool { + if o != nil && !IsNil(o.Rel) { + return true + } + + return false +} + +// SetRel gets a reference to the given string and assigns it to the Rel field. +func (o *Link) SetRel(v string) { + o.Rel = &v +} + +func (o Link) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Link) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["href"] = o.Href + if !IsNil(o.Rel) { + toSerialize["rel"] = o.Rel + } + return toSerialize, nil +} + +func (o *Link) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "href", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varLink := _Link{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varLink) + + if err != nil { + return err + } + + *o = Link(varLink) + + return err +} + +type NullableLink struct { + value *Link + isSet bool +} + +func (v NullableLink) Get() *Link { + return v.value +} + +func (v *NullableLink) Set(val *Link) { + v.value = val + v.isSet = true +} + +func (v NullableLink) IsSet() bool { + return v.isSet +} + +func (v *NullableLink) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLink(val *Link) *NullableLink { + return &NullableLink{value: val, isSet: true} +} + +func (v NullableLink) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLink) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_linked_group.go b/src/models/model_linked_group.go new file mode 100644 index 0000000..d3af3f2 --- /dev/null +++ b/src/models/model_linked_group.go @@ -0,0 +1,159 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the LinkedGroup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LinkedGroup{} + +// LinkedGroup The referenced group +type LinkedGroup struct { + GroupId GroupId `json:"groupId"` +} + +type _LinkedGroup LinkedGroup + +// NewLinkedGroup instantiates a new LinkedGroup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLinkedGroup(groupId GroupId) *LinkedGroup { + this := LinkedGroup{} + this.GroupId = groupId + return &this +} + +// NewLinkedGroupWithDefaults instantiates a new LinkedGroup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLinkedGroupWithDefaults() *LinkedGroup { + this := LinkedGroup{} + return &this +} + +// GetGroupId returns the GroupId field value +func (o *LinkedGroup) GetGroupId() GroupId { + if o == nil { + var ret GroupId + return ret + } + + return o.GroupId +} + +// GetGroupIdOk returns a tuple with the GroupId field value +// and a boolean to check if the value has been set. +func (o *LinkedGroup) GetGroupIdOk() (*GroupId, bool) { + if o == nil { + return nil, false + } + return &o.GroupId, true +} + +// SetGroupId sets field value +func (o *LinkedGroup) SetGroupId(v GroupId) { + o.GroupId = v +} + +func (o LinkedGroup) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LinkedGroup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["groupId"] = o.GroupId + return toSerialize, nil +} + +func (o *LinkedGroup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "groupId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varLinkedGroup := _LinkedGroup{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varLinkedGroup) + + if err != nil { + return err + } + + *o = LinkedGroup(varLinkedGroup) + + return err +} + +type NullableLinkedGroup struct { + value *LinkedGroup + isSet bool +} + +func (v NullableLinkedGroup) Get() *LinkedGroup { + return v.value +} + +func (v *NullableLinkedGroup) Set(val *LinkedGroup) { + v.value = val + v.isSet = true +} + +func (v NullableLinkedGroup) IsSet() bool { + return v.isSet +} + +func (v *NullableLinkedGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLinkedGroup(val *LinkedGroup) *NullableLinkedGroup { + return &NullableLinkedGroup{value: val, isSet: true} +} + +func (v NullableLinkedGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLinkedGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_links.go b/src/models/model_links.go new file mode 100644 index 0000000..9dcf8c0 --- /dev/null +++ b/src/models/model_links.go @@ -0,0 +1,161 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the Links type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Links{} + +// Links struct for Links +type Links struct { + Self NullableLink `json:"self"` +} + +type _Links Links + +// NewLinks instantiates a new Links object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLinks(self NullableLink) *Links { + this := Links{} + this.Self = self + return &this +} + +// NewLinksWithDefaults instantiates a new Links object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLinksWithDefaults() *Links { + this := Links{} + return &this +} + +// GetSelf returns the Self field value +// If the value is explicit nil, the zero value for Link will be returned +func (o *Links) GetSelf() Link { + if o == nil || o.Self.Get() == nil { + var ret Link + return ret + } + + return *o.Self.Get() +} + +// GetSelfOk returns a tuple with the Self field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Links) GetSelfOk() (*Link, bool) { + if o == nil { + return nil, false + } + return o.Self.Get(), o.Self.IsSet() +} + +// SetSelf sets field value +func (o *Links) SetSelf(v Link) { + o.Self.Set(&v) +} + +func (o Links) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Links) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["self"] = o.Self.Get() + return toSerialize, nil +} + +func (o *Links) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "self", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varLinks := _Links{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varLinks) + + if err != nil { + return err + } + + *o = Links(varLinks) + + return err +} + +type NullableLinks struct { + value *Links + isSet bool +} + +func (v NullableLinks) Get() *Links { + return v.value +} + +func (v *NullableLinks) Set(val *Links) { + v.value = val + v.isSet = true +} + +func (v NullableLinks) IsSet() bool { + return v.isSet +} + +func (v *NullableLinks) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLinks(val *Links) *NullableLinks { + return &NullableLinks{value: val, isSet: true} +} + +func (v NullableLinks) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLinks) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_o_auth_authorize_response.go b/src/models/model_o_auth_authorize_response.go new file mode 100644 index 0000000..256c7c2 --- /dev/null +++ b/src/models/model_o_auth_authorize_response.go @@ -0,0 +1,160 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the OAuthAuthorizeResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OAuthAuthorizeResponse{} + +// OAuthAuthorizeResponse struct for OAuthAuthorizeResponse +type OAuthAuthorizeResponse struct { + // The authorization code to be used with the /tokens endpoint to retrieve an access_token. + Code string `json:"code"` +} + +type _OAuthAuthorizeResponse OAuthAuthorizeResponse + +// NewOAuthAuthorizeResponse instantiates a new OAuthAuthorizeResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOAuthAuthorizeResponse(code string) *OAuthAuthorizeResponse { + this := OAuthAuthorizeResponse{} + this.Code = code + return &this +} + +// NewOAuthAuthorizeResponseWithDefaults instantiates a new OAuthAuthorizeResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOAuthAuthorizeResponseWithDefaults() *OAuthAuthorizeResponse { + this := OAuthAuthorizeResponse{} + return &this +} + +// GetCode returns the Code field value +func (o *OAuthAuthorizeResponse) GetCode() string { + if o == nil { + var ret string + return ret + } + + return o.Code +} + +// GetCodeOk returns a tuple with the Code field value +// and a boolean to check if the value has been set. +func (o *OAuthAuthorizeResponse) GetCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Code, true +} + +// SetCode sets field value +func (o *OAuthAuthorizeResponse) SetCode(v string) { + o.Code = v +} + +func (o OAuthAuthorizeResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OAuthAuthorizeResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["code"] = o.Code + return toSerialize, nil +} + +func (o *OAuthAuthorizeResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "code", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varOAuthAuthorizeResponse := _OAuthAuthorizeResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varOAuthAuthorizeResponse) + + if err != nil { + return err + } + + *o = OAuthAuthorizeResponse(varOAuthAuthorizeResponse) + + return err +} + +type NullableOAuthAuthorizeResponse struct { + value *OAuthAuthorizeResponse + isSet bool +} + +func (v NullableOAuthAuthorizeResponse) Get() *OAuthAuthorizeResponse { + return v.value +} + +func (v *NullableOAuthAuthorizeResponse) Set(val *OAuthAuthorizeResponse) { + v.value = val + v.isSet = true +} + +func (v NullableOAuthAuthorizeResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableOAuthAuthorizeResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOAuthAuthorizeResponse(val *OAuthAuthorizeResponse) *NullableOAuthAuthorizeResponse { + return &NullableOAuthAuthorizeResponse{value: val, isSet: true} +} + +func (v NullableOAuthAuthorizeResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOAuthAuthorizeResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_o_auth_token_request.go b/src/models/model_o_auth_token_request.go new file mode 100644 index 0000000..6d52675 --- /dev/null +++ b/src/models/model_o_auth_token_request.go @@ -0,0 +1,422 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the OAuthTokenRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OAuthTokenRequest{} + +// OAuthTokenRequest The OAuth 2.1 token request that follows [RFC 6749](https://www.rfc-editor.org/rfc/rfc6749). The properties in the request must be snake_case to follow the standard. +type OAuthTokenRequest struct { + // The client identifier to constrain the token to. + ClientId string `json:"client_id"` + // The secret associated with the client that authorizes the generation of token it's behalf. (Either the `client_secret` or the `code_verifier` is required) + ClientSecret NullableString `json:"client_secret,omitempty"` + // The code verifier is the the value used in the generation of the OAuth authorization request `code_challenge` property. (Either the `client_secret` or the `code_verifier` is required) + CodeVerifier *string `json:"code_verifier,omitempty"` + // A suggestion to the token generation which type of credentials are being provided. + GrantType *string `json:"grant_type,omitempty"` + // When using the user password grant_type, specify the username. Authress recommends this should always be an email address. + Username NullableString `json:"username,omitempty"` + // When using the user password grant_type, specify the user's password. + Password NullableString `json:"password,omitempty"` + // Enables additional configuration of the grant_type. In the case of user password grant_type, set this to **signup**, to enable the creation of users. Set this to **update**, force update the password associated with the user. + Type NullableString `json:"type,omitempty"` +} + +type _OAuthTokenRequest OAuthTokenRequest + +// NewOAuthTokenRequest instantiates a new OAuthTokenRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOAuthTokenRequest(clientId string) *OAuthTokenRequest { + this := OAuthTokenRequest{} + this.ClientId = clientId + return &this +} + +// NewOAuthTokenRequestWithDefaults instantiates a new OAuthTokenRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOAuthTokenRequestWithDefaults() *OAuthTokenRequest { + this := OAuthTokenRequest{} + return &this +} + +// GetClientId returns the ClientId field value +func (o *OAuthTokenRequest) GetClientId() string { + if o == nil { + var ret string + return ret + } + + return o.ClientId +} + +// GetClientIdOk returns a tuple with the ClientId field value +// and a boolean to check if the value has been set. +func (o *OAuthTokenRequest) GetClientIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientId, true +} + +// SetClientId sets field value +func (o *OAuthTokenRequest) SetClientId(v string) { + o.ClientId = v +} + +// GetClientSecret returns the ClientSecret field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OAuthTokenRequest) GetClientSecret() string { + if o == nil || IsNil(o.ClientSecret.Get()) { + var ret string + return ret + } + return *o.ClientSecret.Get() +} + +// GetClientSecretOk returns a tuple with the ClientSecret field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OAuthTokenRequest) GetClientSecretOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ClientSecret.Get(), o.ClientSecret.IsSet() +} + +// HasClientSecret returns a boolean if a field has been set. +func (o *OAuthTokenRequest) HasClientSecret() bool { + if o != nil && o.ClientSecret.IsSet() { + return true + } + + return false +} + +// SetClientSecret gets a reference to the given NullableString and assigns it to the ClientSecret field. +func (o *OAuthTokenRequest) SetClientSecret(v string) { + o.ClientSecret.Set(&v) +} +// SetClientSecretNil sets the value for ClientSecret to be an explicit nil +func (o *OAuthTokenRequest) SetClientSecretNil() { + o.ClientSecret.Set(nil) +} + +// UnsetClientSecret ensures that no value is present for ClientSecret, not even an explicit nil +func (o *OAuthTokenRequest) UnsetClientSecret() { + o.ClientSecret.Unset() +} + +// GetCodeVerifier returns the CodeVerifier field value if set, zero value otherwise. +func (o *OAuthTokenRequest) GetCodeVerifier() string { + if o == nil || IsNil(o.CodeVerifier) { + var ret string + return ret + } + return *o.CodeVerifier +} + +// GetCodeVerifierOk returns a tuple with the CodeVerifier field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuthTokenRequest) GetCodeVerifierOk() (*string, bool) { + if o == nil || IsNil(o.CodeVerifier) { + return nil, false + } + return o.CodeVerifier, true +} + +// HasCodeVerifier returns a boolean if a field has been set. +func (o *OAuthTokenRequest) HasCodeVerifier() bool { + if o != nil && !IsNil(o.CodeVerifier) { + return true + } + + return false +} + +// SetCodeVerifier gets a reference to the given string and assigns it to the CodeVerifier field. +func (o *OAuthTokenRequest) SetCodeVerifier(v string) { + o.CodeVerifier = &v +} + +// GetGrantType returns the GrantType field value if set, zero value otherwise. +func (o *OAuthTokenRequest) GetGrantType() string { + if o == nil || IsNil(o.GrantType) { + var ret string + return ret + } + return *o.GrantType +} + +// GetGrantTypeOk returns a tuple with the GrantType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuthTokenRequest) GetGrantTypeOk() (*string, bool) { + if o == nil || IsNil(o.GrantType) { + return nil, false + } + return o.GrantType, true +} + +// HasGrantType returns a boolean if a field has been set. +func (o *OAuthTokenRequest) HasGrantType() bool { + if o != nil && !IsNil(o.GrantType) { + return true + } + + return false +} + +// SetGrantType gets a reference to the given string and assigns it to the GrantType field. +func (o *OAuthTokenRequest) SetGrantType(v string) { + o.GrantType = &v +} + +// GetUsername returns the Username field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OAuthTokenRequest) GetUsername() string { + if o == nil || IsNil(o.Username.Get()) { + var ret string + return ret + } + return *o.Username.Get() +} + +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OAuthTokenRequest) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Username.Get(), o.Username.IsSet() +} + +// HasUsername returns a boolean if a field has been set. +func (o *OAuthTokenRequest) HasUsername() bool { + if o != nil && o.Username.IsSet() { + return true + } + + return false +} + +// SetUsername gets a reference to the given NullableString and assigns it to the Username field. +func (o *OAuthTokenRequest) SetUsername(v string) { + o.Username.Set(&v) +} +// SetUsernameNil sets the value for Username to be an explicit nil +func (o *OAuthTokenRequest) SetUsernameNil() { + o.Username.Set(nil) +} + +// UnsetUsername ensures that no value is present for Username, not even an explicit nil +func (o *OAuthTokenRequest) UnsetUsername() { + o.Username.Unset() +} + +// GetPassword returns the Password field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OAuthTokenRequest) GetPassword() string { + if o == nil || IsNil(o.Password.Get()) { + var ret string + return ret + } + return *o.Password.Get() +} + +// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OAuthTokenRequest) GetPasswordOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Password.Get(), o.Password.IsSet() +} + +// HasPassword returns a boolean if a field has been set. +func (o *OAuthTokenRequest) HasPassword() bool { + if o != nil && o.Password.IsSet() { + return true + } + + return false +} + +// SetPassword gets a reference to the given NullableString and assigns it to the Password field. +func (o *OAuthTokenRequest) SetPassword(v string) { + o.Password.Set(&v) +} +// SetPasswordNil sets the value for Password to be an explicit nil +func (o *OAuthTokenRequest) SetPasswordNil() { + o.Password.Set(nil) +} + +// UnsetPassword ensures that no value is present for Password, not even an explicit nil +func (o *OAuthTokenRequest) UnsetPassword() { + o.Password.Unset() +} + +// GetType returns the Type field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OAuthTokenRequest) GetType() string { + if o == nil || IsNil(o.Type.Get()) { + var ret string + return ret + } + return *o.Type.Get() +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OAuthTokenRequest) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Type.Get(), o.Type.IsSet() +} + +// HasType returns a boolean if a field has been set. +func (o *OAuthTokenRequest) HasType() bool { + if o != nil && o.Type.IsSet() { + return true + } + + return false +} + +// SetType gets a reference to the given NullableString and assigns it to the Type field. +func (o *OAuthTokenRequest) SetType(v string) { + o.Type.Set(&v) +} +// SetTypeNil sets the value for Type to be an explicit nil +func (o *OAuthTokenRequest) SetTypeNil() { + o.Type.Set(nil) +} + +// UnsetType ensures that no value is present for Type, not even an explicit nil +func (o *OAuthTokenRequest) UnsetType() { + o.Type.Unset() +} + +func (o OAuthTokenRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OAuthTokenRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["client_id"] = o.ClientId + if o.ClientSecret.IsSet() { + toSerialize["client_secret"] = o.ClientSecret.Get() + } + if !IsNil(o.CodeVerifier) { + toSerialize["code_verifier"] = o.CodeVerifier + } + if !IsNil(o.GrantType) { + toSerialize["grant_type"] = o.GrantType + } + if o.Username.IsSet() { + toSerialize["username"] = o.Username.Get() + } + if o.Password.IsSet() { + toSerialize["password"] = o.Password.Get() + } + if o.Type.IsSet() { + toSerialize["type"] = o.Type.Get() + } + return toSerialize, nil +} + +func (o *OAuthTokenRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "client_id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varOAuthTokenRequest := _OAuthTokenRequest{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varOAuthTokenRequest) + + if err != nil { + return err + } + + *o = OAuthTokenRequest(varOAuthTokenRequest) + + return err +} + +type NullableOAuthTokenRequest struct { + value *OAuthTokenRequest + isSet bool +} + +func (v NullableOAuthTokenRequest) Get() *OAuthTokenRequest { + return v.value +} + +func (v *NullableOAuthTokenRequest) Set(val *OAuthTokenRequest) { + v.value = val + v.isSet = true +} + +func (v NullableOAuthTokenRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableOAuthTokenRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOAuthTokenRequest(val *OAuthTokenRequest) *NullableOAuthTokenRequest { + return &NullableOAuthTokenRequest{value: val, isSet: true} +} + +func (v NullableOAuthTokenRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOAuthTokenRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_o_auth_token_response.go b/src/models/model_o_auth_token_response.go new file mode 100644 index 0000000..a1c4902 --- /dev/null +++ b/src/models/model_o_auth_token_response.go @@ -0,0 +1,160 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the OAuthTokenResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OAuthTokenResponse{} + +// OAuthTokenResponse struct for OAuthTokenResponse +type OAuthTokenResponse struct { + // An expiring access token that can be used to access either Authress or any platform service. + AccessToken string `json:"access_token"` +} + +type _OAuthTokenResponse OAuthTokenResponse + +// NewOAuthTokenResponse instantiates a new OAuthTokenResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOAuthTokenResponse(accessToken string) *OAuthTokenResponse { + this := OAuthTokenResponse{} + this.AccessToken = accessToken + return &this +} + +// NewOAuthTokenResponseWithDefaults instantiates a new OAuthTokenResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOAuthTokenResponseWithDefaults() *OAuthTokenResponse { + this := OAuthTokenResponse{} + return &this +} + +// GetAccessToken returns the AccessToken field value +func (o *OAuthTokenResponse) GetAccessToken() string { + if o == nil { + var ret string + return ret + } + + return o.AccessToken +} + +// GetAccessTokenOk returns a tuple with the AccessToken field value +// and a boolean to check if the value has been set. +func (o *OAuthTokenResponse) GetAccessTokenOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccessToken, true +} + +// SetAccessToken sets field value +func (o *OAuthTokenResponse) SetAccessToken(v string) { + o.AccessToken = v +} + +func (o OAuthTokenResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OAuthTokenResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["access_token"] = o.AccessToken + return toSerialize, nil +} + +func (o *OAuthTokenResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "access_token", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varOAuthTokenResponse := _OAuthTokenResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varOAuthTokenResponse) + + if err != nil { + return err + } + + *o = OAuthTokenResponse(varOAuthTokenResponse) + + return err +} + +type NullableOAuthTokenResponse struct { + value *OAuthTokenResponse + isSet bool +} + +func (v NullableOAuthTokenResponse) Get() *OAuthTokenResponse { + return v.value +} + +func (v *NullableOAuthTokenResponse) Set(val *OAuthTokenResponse) { + v.value = val + v.isSet = true +} + +func (v NullableOAuthTokenResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableOAuthTokenResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOAuthTokenResponse(val *OAuthTokenResponse) *NullableOAuthTokenResponse { + return &NullableOAuthTokenResponse{value: val, isSet: true} +} + +func (v NullableOAuthTokenResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOAuthTokenResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_pagination.go b/src/models/model_pagination.go new file mode 100644 index 0000000..cb4c81e --- /dev/null +++ b/src/models/model_pagination.go @@ -0,0 +1,137 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" +) + +// checks if the Pagination type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Pagination{} + +// Pagination Details containing how to pagination through the collection. Consists of an optional *next* property that may contain a cursor. Pagination is mutable and the list can change between requests. +type Pagination struct { + Next NullablePaginationNext `json:"next,omitempty"` +} + +// NewPagination instantiates a new Pagination object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPagination() *Pagination { + this := Pagination{} + return &this +} + +// NewPaginationWithDefaults instantiates a new Pagination object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginationWithDefaults() *Pagination { + this := Pagination{} + return &this +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Pagination) GetNext() PaginationNext { + if o == nil || IsNil(o.Next.Get()) { + var ret PaginationNext + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Pagination) GetNextOk() (*PaginationNext, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *Pagination) HasNext() bool { + if o != nil && o.Next.IsSet() { + return true + } + + return false +} + +// SetNext gets a reference to the given NullablePaginationNext and assigns it to the Next field. +func (o *Pagination) SetNext(v PaginationNext) { + o.Next.Set(&v) +} +// SetNextNil sets the value for Next to be an explicit nil +func (o *Pagination) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil +func (o *Pagination) UnsetNext() { + o.Next.Unset() +} + +func (o Pagination) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Pagination) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + return toSerialize, nil +} + +type NullablePagination struct { + value *Pagination + isSet bool +} + +func (v NullablePagination) Get() *Pagination { + return v.value +} + +func (v *NullablePagination) Set(val *Pagination) { + v.value = val + v.isSet = true +} + +func (v NullablePagination) IsSet() bool { + return v.isSet +} + +func (v *NullablePagination) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePagination(val *Pagination) *NullablePagination { + return &NullablePagination{value: val, isSet: true} +} + +func (v NullablePagination) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePagination) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_pagination_next.go b/src/models/model_pagination_next.go new file mode 100644 index 0000000..64f0c00 --- /dev/null +++ b/src/models/model_pagination_next.go @@ -0,0 +1,159 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the PaginationNext type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginationNext{} + +// PaginationNext A reference to the next page in the collection, pass the cursor as a query parameter in the subsequent request to get the next page. +type PaginationNext struct { + Cursor string `json:"cursor"` +} + +type _PaginationNext PaginationNext + +// NewPaginationNext instantiates a new PaginationNext object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginationNext(cursor string) *PaginationNext { + this := PaginationNext{} + this.Cursor = cursor + return &this +} + +// NewPaginationNextWithDefaults instantiates a new PaginationNext object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginationNextWithDefaults() *PaginationNext { + this := PaginationNext{} + return &this +} + +// GetCursor returns the Cursor field value +func (o *PaginationNext) GetCursor() string { + if o == nil { + var ret string + return ret + } + + return o.Cursor +} + +// GetCursorOk returns a tuple with the Cursor field value +// and a boolean to check if the value has been set. +func (o *PaginationNext) GetCursorOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Cursor, true +} + +// SetCursor sets field value +func (o *PaginationNext) SetCursor(v string) { + o.Cursor = v +} + +func (o PaginationNext) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginationNext) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["cursor"] = o.Cursor + return toSerialize, nil +} + +func (o *PaginationNext) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "cursor", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginationNext := _PaginationNext{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varPaginationNext) + + if err != nil { + return err + } + + *o = PaginationNext(varPaginationNext) + + return err +} + +type NullablePaginationNext struct { + value *PaginationNext + isSet bool +} + +func (v NullablePaginationNext) Get() *PaginationNext { + return v.value +} + +func (v *NullablePaginationNext) Set(val *PaginationNext) { + v.value = val + v.isSet = true +} + +func (v NullablePaginationNext) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginationNext) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginationNext(val *PaginationNext) *NullablePaginationNext { + return &NullablePaginationNext{value: val, isSet: true} +} + +func (v NullablePaginationNext) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginationNext) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_permission_collection.go b/src/models/model_permission_collection.go new file mode 100644 index 0000000..7d9b3a1 --- /dev/null +++ b/src/models/model_permission_collection.go @@ -0,0 +1,224 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the PermissionCollection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PermissionCollection{} + +// PermissionCollection A collect of permissions that the user has to a resource. +type PermissionCollection struct { + Account *PermissionCollectionAccount `json:"account,omitempty"` + UserId UserId `json:"userId"` + // A list of the permissions + Permissions []PermissionObject `json:"permissions"` +} + +type _PermissionCollection PermissionCollection + +// NewPermissionCollection instantiates a new PermissionCollection object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPermissionCollection(userId UserId, permissions []PermissionObject) *PermissionCollection { + this := PermissionCollection{} + this.UserId = userId + this.Permissions = permissions + return &this +} + +// NewPermissionCollectionWithDefaults instantiates a new PermissionCollection object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPermissionCollectionWithDefaults() *PermissionCollection { + this := PermissionCollection{} + return &this +} + +// GetAccount returns the Account field value if set, zero value otherwise. +func (o *PermissionCollection) GetAccount() PermissionCollectionAccount { + if o == nil || IsNil(o.Account) { + var ret PermissionCollectionAccount + return ret + } + return *o.Account +} + +// GetAccountOk returns a tuple with the Account field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PermissionCollection) GetAccountOk() (*PermissionCollectionAccount, bool) { + if o == nil || IsNil(o.Account) { + return nil, false + } + return o.Account, true +} + +// HasAccount returns a boolean if a field has been set. +func (o *PermissionCollection) HasAccount() bool { + if o != nil && !IsNil(o.Account) { + return true + } + + return false +} + +// SetAccount gets a reference to the given PermissionCollectionAccount and assigns it to the Account field. +func (o *PermissionCollection) SetAccount(v PermissionCollectionAccount) { + o.Account = &v +} + +// GetUserId returns the UserId field value +func (o *PermissionCollection) GetUserId() UserId { + if o == nil { + var ret UserId + return ret + } + + return o.UserId +} + +// GetUserIdOk returns a tuple with the UserId field value +// and a boolean to check if the value has been set. +func (o *PermissionCollection) GetUserIdOk() (*UserId, bool) { + if o == nil { + return nil, false + } + return &o.UserId, true +} + +// SetUserId sets field value +func (o *PermissionCollection) SetUserId(v UserId) { + o.UserId = v +} + +// GetPermissions returns the Permissions field value +func (o *PermissionCollection) GetPermissions() []PermissionObject { + if o == nil { + var ret []PermissionObject + return ret + } + + return o.Permissions +} + +// GetPermissionsOk returns a tuple with the Permissions field value +// and a boolean to check if the value has been set. +func (o *PermissionCollection) GetPermissionsOk() ([]PermissionObject, bool) { + if o == nil { + return nil, false + } + return o.Permissions, true +} + +// SetPermissions sets field value +func (o *PermissionCollection) SetPermissions(v []PermissionObject) { + o.Permissions = v +} + +func (o PermissionCollection) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PermissionCollection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Account) { + toSerialize["account"] = o.Account + } + toSerialize["userId"] = o.UserId + toSerialize["permissions"] = o.Permissions + return toSerialize, nil +} + +func (o *PermissionCollection) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "userId", + "permissions", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPermissionCollection := _PermissionCollection{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varPermissionCollection) + + if err != nil { + return err + } + + *o = PermissionCollection(varPermissionCollection) + + return err +} + +type NullablePermissionCollection struct { + value *PermissionCollection + isSet bool +} + +func (v NullablePermissionCollection) Get() *PermissionCollection { + return v.value +} + +func (v *NullablePermissionCollection) Set(val *PermissionCollection) { + v.value = val + v.isSet = true +} + +func (v NullablePermissionCollection) IsSet() bool { + return v.isSet +} + +func (v *NullablePermissionCollection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePermissionCollection(val *PermissionCollection) *NullablePermissionCollection { + return &NullablePermissionCollection{value: val, isSet: true} +} + +func (v NullablePermissionCollection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePermissionCollection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_permission_collection_account.go b/src/models/model_permission_collection_account.go new file mode 100644 index 0000000..eb6c5b6 --- /dev/null +++ b/src/models/model_permission_collection_account.go @@ -0,0 +1,127 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" +) + +// checks if the PermissionCollectionAccount type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PermissionCollectionAccount{} + +// PermissionCollectionAccount struct for PermissionCollectionAccount +type PermissionCollectionAccount struct { + AccountId *string `json:"accountId,omitempty"` +} + +// NewPermissionCollectionAccount instantiates a new PermissionCollectionAccount object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPermissionCollectionAccount() *PermissionCollectionAccount { + this := PermissionCollectionAccount{} + return &this +} + +// NewPermissionCollectionAccountWithDefaults instantiates a new PermissionCollectionAccount object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPermissionCollectionAccountWithDefaults() *PermissionCollectionAccount { + this := PermissionCollectionAccount{} + return &this +} + +// GetAccountId returns the AccountId field value if set, zero value otherwise. +func (o *PermissionCollectionAccount) GetAccountId() string { + if o == nil || IsNil(o.AccountId) { + var ret string + return ret + } + return *o.AccountId +} + +// GetAccountIdOk returns a tuple with the AccountId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PermissionCollectionAccount) GetAccountIdOk() (*string, bool) { + if o == nil || IsNil(o.AccountId) { + return nil, false + } + return o.AccountId, true +} + +// HasAccountId returns a boolean if a field has been set. +func (o *PermissionCollectionAccount) HasAccountId() bool { + if o != nil && !IsNil(o.AccountId) { + return true + } + + return false +} + +// SetAccountId gets a reference to the given string and assigns it to the AccountId field. +func (o *PermissionCollectionAccount) SetAccountId(v string) { + o.AccountId = &v +} + +func (o PermissionCollectionAccount) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PermissionCollectionAccount) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AccountId) { + toSerialize["accountId"] = o.AccountId + } + return toSerialize, nil +} + +type NullablePermissionCollectionAccount struct { + value *PermissionCollectionAccount + isSet bool +} + +func (v NullablePermissionCollectionAccount) Get() *PermissionCollectionAccount { + return v.value +} + +func (v *NullablePermissionCollectionAccount) Set(val *PermissionCollectionAccount) { + v.value = val + v.isSet = true +} + +func (v NullablePermissionCollectionAccount) IsSet() bool { + return v.isSet +} + +func (v *NullablePermissionCollectionAccount) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePermissionCollectionAccount(val *PermissionCollectionAccount) *NullablePermissionCollectionAccount { + return &NullablePermissionCollectionAccount{value: val, isSet: true} +} + +func (v NullablePermissionCollectionAccount) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePermissionCollectionAccount) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_permission_object.go b/src/models/model_permission_object.go new file mode 100644 index 0000000..02ffdec --- /dev/null +++ b/src/models/model_permission_object.go @@ -0,0 +1,247 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the PermissionObject type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PermissionObject{} + +// PermissionObject The collective action and associate grants on a permission +type PermissionObject struct { + // The action the permission grants, can be scoped using `:` and parent actions imply sub-resource permissions, action:* or action implies action:sub-action. This property is case-insensitive, it will always be cast to lowercase before comparing actions to user permissions. + Action string `json:"action"` + // Does this permission grant the user the ability to execute the action? + Allow bool `json:"allow"` + // Allows the user to give the permission to others without being able to execute the action. + Grant bool `json:"grant"` + // Allows delegating or granting the permission to others without being able to execute the action. + Delegate bool `json:"delegate"` +} + +type _PermissionObject PermissionObject + +// NewPermissionObject instantiates a new PermissionObject object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPermissionObject(action string, allow bool, grant bool, delegate bool) *PermissionObject { + this := PermissionObject{} + this.Action = action + this.Allow = allow + this.Grant = grant + this.Delegate = delegate + return &this +} + +// NewPermissionObjectWithDefaults instantiates a new PermissionObject object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPermissionObjectWithDefaults() *PermissionObject { + this := PermissionObject{} + return &this +} + +// GetAction returns the Action field value +func (o *PermissionObject) GetAction() string { + if o == nil { + var ret string + return ret + } + + return o.Action +} + +// GetActionOk returns a tuple with the Action field value +// and a boolean to check if the value has been set. +func (o *PermissionObject) GetActionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Action, true +} + +// SetAction sets field value +func (o *PermissionObject) SetAction(v string) { + o.Action = v +} + +// GetAllow returns the Allow field value +func (o *PermissionObject) GetAllow() bool { + if o == nil { + var ret bool + return ret + } + + return o.Allow +} + +// GetAllowOk returns a tuple with the Allow field value +// and a boolean to check if the value has been set. +func (o *PermissionObject) GetAllowOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Allow, true +} + +// SetAllow sets field value +func (o *PermissionObject) SetAllow(v bool) { + o.Allow = v +} + +// GetGrant returns the Grant field value +func (o *PermissionObject) GetGrant() bool { + if o == nil { + var ret bool + return ret + } + + return o.Grant +} + +// GetGrantOk returns a tuple with the Grant field value +// and a boolean to check if the value has been set. +func (o *PermissionObject) GetGrantOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Grant, true +} + +// SetGrant sets field value +func (o *PermissionObject) SetGrant(v bool) { + o.Grant = v +} + +// GetDelegate returns the Delegate field value +func (o *PermissionObject) GetDelegate() bool { + if o == nil { + var ret bool + return ret + } + + return o.Delegate +} + +// GetDelegateOk returns a tuple with the Delegate field value +// and a boolean to check if the value has been set. +func (o *PermissionObject) GetDelegateOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Delegate, true +} + +// SetDelegate sets field value +func (o *PermissionObject) SetDelegate(v bool) { + o.Delegate = v +} + +func (o PermissionObject) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PermissionObject) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["action"] = o.Action + toSerialize["allow"] = o.Allow + toSerialize["grant"] = o.Grant + toSerialize["delegate"] = o.Delegate + return toSerialize, nil +} + +func (o *PermissionObject) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "action", + "allow", + "grant", + "delegate", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPermissionObject := _PermissionObject{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varPermissionObject) + + if err != nil { + return err + } + + *o = PermissionObject(varPermissionObject) + + return err +} + +type NullablePermissionObject struct { + value *PermissionObject + isSet bool +} + +func (v NullablePermissionObject) Get() *PermissionObject { + return v.value +} + +func (v *NullablePermissionObject) Set(val *PermissionObject) { + v.value = val + v.isSet = true +} + +func (v NullablePermissionObject) IsSet() bool { + return v.isSet +} + +func (v *NullablePermissionObject) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePermissionObject(val *PermissionObject) *NullablePermissionObject { + return &NullablePermissionObject{value: val, isSet: true} +} + +func (v NullablePermissionObject) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePermissionObject) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_permissioned_resource.go b/src/models/model_permissioned_resource.go new file mode 100644 index 0000000..685570c --- /dev/null +++ b/src/models/model_permissioned_resource.go @@ -0,0 +1,159 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the PermissionedResource type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PermissionedResource{} + +// PermissionedResource struct for PermissionedResource +type PermissionedResource struct { + Permissions []ResourcePermission `json:"permissions"` +} + +type _PermissionedResource PermissionedResource + +// NewPermissionedResource instantiates a new PermissionedResource object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPermissionedResource(permissions []ResourcePermission) *PermissionedResource { + this := PermissionedResource{} + this.Permissions = permissions + return &this +} + +// NewPermissionedResourceWithDefaults instantiates a new PermissionedResource object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPermissionedResourceWithDefaults() *PermissionedResource { + this := PermissionedResource{} + return &this +} + +// GetPermissions returns the Permissions field value +func (o *PermissionedResource) GetPermissions() []ResourcePermission { + if o == nil { + var ret []ResourcePermission + return ret + } + + return o.Permissions +} + +// GetPermissionsOk returns a tuple with the Permissions field value +// and a boolean to check if the value has been set. +func (o *PermissionedResource) GetPermissionsOk() ([]ResourcePermission, bool) { + if o == nil { + return nil, false + } + return o.Permissions, true +} + +// SetPermissions sets field value +func (o *PermissionedResource) SetPermissions(v []ResourcePermission) { + o.Permissions = v +} + +func (o PermissionedResource) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PermissionedResource) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["permissions"] = o.Permissions + return toSerialize, nil +} + +func (o *PermissionedResource) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "permissions", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPermissionedResource := _PermissionedResource{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varPermissionedResource) + + if err != nil { + return err + } + + *o = PermissionedResource(varPermissionedResource) + + return err +} + +type NullablePermissionedResource struct { + value *PermissionedResource + isSet bool +} + +func (v NullablePermissionedResource) Get() *PermissionedResource { + return v.value +} + +func (v *NullablePermissionedResource) Set(val *PermissionedResource) { + v.value = val + v.isSet = true +} + +func (v NullablePermissionedResource) IsSet() bool { + return v.isSet +} + +func (v *NullablePermissionedResource) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePermissionedResource(val *PermissionedResource) *NullablePermissionedResource { + return &NullablePermissionedResource{value: val, isSet: true} +} + +func (v NullablePermissionedResource) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePermissionedResource) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_permissioned_resource_collection.go b/src/models/model_permissioned_resource_collection.go new file mode 100644 index 0000000..2f32730 --- /dev/null +++ b/src/models/model_permissioned_resource_collection.go @@ -0,0 +1,223 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the PermissionedResourceCollection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PermissionedResourceCollection{} + +// PermissionedResourceCollection A collection of resource permissions that have been defined. +type PermissionedResourceCollection struct { + Resources []PermissionedResource `json:"resources"` + Pagination *Pagination `json:"pagination,omitempty"` + Links CollectionLinks `json:"links"` +} + +type _PermissionedResourceCollection PermissionedResourceCollection + +// NewPermissionedResourceCollection instantiates a new PermissionedResourceCollection object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPermissionedResourceCollection(resources []PermissionedResource, links CollectionLinks) *PermissionedResourceCollection { + this := PermissionedResourceCollection{} + this.Resources = resources + this.Links = links + return &this +} + +// NewPermissionedResourceCollectionWithDefaults instantiates a new PermissionedResourceCollection object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPermissionedResourceCollectionWithDefaults() *PermissionedResourceCollection { + this := PermissionedResourceCollection{} + return &this +} + +// GetResources returns the Resources field value +func (o *PermissionedResourceCollection) GetResources() []PermissionedResource { + if o == nil { + var ret []PermissionedResource + return ret + } + + return o.Resources +} + +// GetResourcesOk returns a tuple with the Resources field value +// and a boolean to check if the value has been set. +func (o *PermissionedResourceCollection) GetResourcesOk() ([]PermissionedResource, bool) { + if o == nil { + return nil, false + } + return o.Resources, true +} + +// SetResources sets field value +func (o *PermissionedResourceCollection) SetResources(v []PermissionedResource) { + o.Resources = v +} + +// GetPagination returns the Pagination field value if set, zero value otherwise. +func (o *PermissionedResourceCollection) GetPagination() Pagination { + if o == nil || IsNil(o.Pagination) { + var ret Pagination + return ret + } + return *o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PermissionedResourceCollection) GetPaginationOk() (*Pagination, bool) { + if o == nil || IsNil(o.Pagination) { + return nil, false + } + return o.Pagination, true +} + +// HasPagination returns a boolean if a field has been set. +func (o *PermissionedResourceCollection) HasPagination() bool { + if o != nil && !IsNil(o.Pagination) { + return true + } + + return false +} + +// SetPagination gets a reference to the given Pagination and assigns it to the Pagination field. +func (o *PermissionedResourceCollection) SetPagination(v Pagination) { + o.Pagination = &v +} + +// GetLinks returns the Links field value +func (o *PermissionedResourceCollection) GetLinks() CollectionLinks { + if o == nil { + var ret CollectionLinks + return ret + } + + return o.Links +} + +// GetLinksOk returns a tuple with the Links field value +// and a boolean to check if the value has been set. +func (o *PermissionedResourceCollection) GetLinksOk() (*CollectionLinks, bool) { + if o == nil { + return nil, false + } + return &o.Links, true +} + +// SetLinks sets field value +func (o *PermissionedResourceCollection) SetLinks(v CollectionLinks) { + o.Links = v +} + +func (o PermissionedResourceCollection) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PermissionedResourceCollection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["resources"] = o.Resources + if !IsNil(o.Pagination) { + toSerialize["pagination"] = o.Pagination + } + toSerialize["links"] = o.Links + return toSerialize, nil +} + +func (o *PermissionedResourceCollection) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "resources", + "links", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPermissionedResourceCollection := _PermissionedResourceCollection{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varPermissionedResourceCollection) + + if err != nil { + return err + } + + *o = PermissionedResourceCollection(varPermissionedResourceCollection) + + return err +} + +type NullablePermissionedResourceCollection struct { + value *PermissionedResourceCollection + isSet bool +} + +func (v NullablePermissionedResourceCollection) Get() *PermissionedResourceCollection { + return v.value +} + +func (v *NullablePermissionedResourceCollection) Set(val *PermissionedResourceCollection) { + v.value = val + v.isSet = true +} + +func (v NullablePermissionedResourceCollection) IsSet() bool { + return v.isSet +} + +func (v *NullablePermissionedResourceCollection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePermissionedResourceCollection(val *PermissionedResourceCollection) *NullablePermissionedResourceCollection { + return &NullablePermissionedResourceCollection{value: val, isSet: true} +} + +func (v NullablePermissionedResourceCollection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePermissionedResourceCollection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_resource.go b/src/models/model_resource.go new file mode 100644 index 0000000..5097156 --- /dev/null +++ b/src/models/model_resource.go @@ -0,0 +1,160 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the Resource type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Resource{} + +// Resource struct for Resource +type Resource struct { + // A resource path which can be top level, fully qualified, or end with a *. Parent resources imply permissions to sub-resources. + ResourceUri string `json:"resourceUri"` +} + +type _Resource Resource + +// NewResource instantiates a new Resource object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewResource(resourceUri string) *Resource { + this := Resource{} + this.ResourceUri = resourceUri + return &this +} + +// NewResourceWithDefaults instantiates a new Resource object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewResourceWithDefaults() *Resource { + this := Resource{} + return &this +} + +// GetResourceUri returns the ResourceUri field value +func (o *Resource) GetResourceUri() string { + if o == nil { + var ret string + return ret + } + + return o.ResourceUri +} + +// GetResourceUriOk returns a tuple with the ResourceUri field value +// and a boolean to check if the value has been set. +func (o *Resource) GetResourceUriOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ResourceUri, true +} + +// SetResourceUri sets field value +func (o *Resource) SetResourceUri(v string) { + o.ResourceUri = v +} + +func (o Resource) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Resource) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["resourceUri"] = o.ResourceUri + return toSerialize, nil +} + +func (o *Resource) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "resourceUri", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varResource := _Resource{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varResource) + + if err != nil { + return err + } + + *o = Resource(varResource) + + return err +} + +type NullableResource struct { + value *Resource + isSet bool +} + +func (v NullableResource) Get() *Resource { + return v.value +} + +func (v *NullableResource) Set(val *Resource) { + v.value = val + v.isSet = true +} + +func (v NullableResource) IsSet() bool { + return v.isSet +} + +func (v *NullableResource) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableResource(val *Resource) *NullableResource { + return &NullableResource{value: val, isSet: true} +} + +func (v NullableResource) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableResource) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_resource_permission.go b/src/models/model_resource_permission.go new file mode 100644 index 0000000..168bc23 --- /dev/null +++ b/src/models/model_resource_permission.go @@ -0,0 +1,187 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ResourcePermission type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ResourcePermission{} + +// ResourcePermission struct for ResourcePermission +type ResourcePermission struct { + Action string `json:"action"` + Allow bool `json:"allow"` +} + +type _ResourcePermission ResourcePermission + +// NewResourcePermission instantiates a new ResourcePermission object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewResourcePermission(action string, allow bool) *ResourcePermission { + this := ResourcePermission{} + this.Action = action + this.Allow = allow + return &this +} + +// NewResourcePermissionWithDefaults instantiates a new ResourcePermission object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewResourcePermissionWithDefaults() *ResourcePermission { + this := ResourcePermission{} + return &this +} + +// GetAction returns the Action field value +func (o *ResourcePermission) GetAction() string { + if o == nil { + var ret string + return ret + } + + return o.Action +} + +// GetActionOk returns a tuple with the Action field value +// and a boolean to check if the value has been set. +func (o *ResourcePermission) GetActionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Action, true +} + +// SetAction sets field value +func (o *ResourcePermission) SetAction(v string) { + o.Action = v +} + +// GetAllow returns the Allow field value +func (o *ResourcePermission) GetAllow() bool { + if o == nil { + var ret bool + return ret + } + + return o.Allow +} + +// GetAllowOk returns a tuple with the Allow field value +// and a boolean to check if the value has been set. +func (o *ResourcePermission) GetAllowOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Allow, true +} + +// SetAllow sets field value +func (o *ResourcePermission) SetAllow(v bool) { + o.Allow = v +} + +func (o ResourcePermission) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ResourcePermission) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["action"] = o.Action + toSerialize["allow"] = o.Allow + return toSerialize, nil +} + +func (o *ResourcePermission) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "action", + "allow", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varResourcePermission := _ResourcePermission{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varResourcePermission) + + if err != nil { + return err + } + + *o = ResourcePermission(varResourcePermission) + + return err +} + +type NullableResourcePermission struct { + value *ResourcePermission + isSet bool +} + +func (v NullableResourcePermission) Get() *ResourcePermission { + return v.value +} + +func (v *NullableResourcePermission) Set(val *ResourcePermission) { + v.value = val + v.isSet = true +} + +func (v NullableResourcePermission) IsSet() bool { + return v.isSet +} + +func (v *NullableResourcePermission) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableResourcePermission(val *ResourcePermission) *NullableResourcePermission { + return &NullableResourcePermission{value: val, isSet: true} +} + +func (v NullableResourcePermission) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableResourcePermission) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_resource_users_collection.go b/src/models/model_resource_users_collection.go new file mode 100644 index 0000000..1835e73 --- /dev/null +++ b/src/models/model_resource_users_collection.go @@ -0,0 +1,224 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ResourceUsersCollection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ResourceUsersCollection{} + +// ResourceUsersCollection A collection of users with explicit permission to a resource. +type ResourceUsersCollection struct { + // A list of users + Users []UserRoleCollection `json:"users"` + Pagination *Pagination `json:"pagination,omitempty"` + Links CollectionLinks `json:"links"` +} + +type _ResourceUsersCollection ResourceUsersCollection + +// NewResourceUsersCollection instantiates a new ResourceUsersCollection object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewResourceUsersCollection(users []UserRoleCollection, links CollectionLinks) *ResourceUsersCollection { + this := ResourceUsersCollection{} + this.Users = users + this.Links = links + return &this +} + +// NewResourceUsersCollectionWithDefaults instantiates a new ResourceUsersCollection object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewResourceUsersCollectionWithDefaults() *ResourceUsersCollection { + this := ResourceUsersCollection{} + return &this +} + +// GetUsers returns the Users field value +func (o *ResourceUsersCollection) GetUsers() []UserRoleCollection { + if o == nil { + var ret []UserRoleCollection + return ret + } + + return o.Users +} + +// GetUsersOk returns a tuple with the Users field value +// and a boolean to check if the value has been set. +func (o *ResourceUsersCollection) GetUsersOk() ([]UserRoleCollection, bool) { + if o == nil { + return nil, false + } + return o.Users, true +} + +// SetUsers sets field value +func (o *ResourceUsersCollection) SetUsers(v []UserRoleCollection) { + o.Users = v +} + +// GetPagination returns the Pagination field value if set, zero value otherwise. +func (o *ResourceUsersCollection) GetPagination() Pagination { + if o == nil || IsNil(o.Pagination) { + var ret Pagination + return ret + } + return *o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourceUsersCollection) GetPaginationOk() (*Pagination, bool) { + if o == nil || IsNil(o.Pagination) { + return nil, false + } + return o.Pagination, true +} + +// HasPagination returns a boolean if a field has been set. +func (o *ResourceUsersCollection) HasPagination() bool { + if o != nil && !IsNil(o.Pagination) { + return true + } + + return false +} + +// SetPagination gets a reference to the given Pagination and assigns it to the Pagination field. +func (o *ResourceUsersCollection) SetPagination(v Pagination) { + o.Pagination = &v +} + +// GetLinks returns the Links field value +func (o *ResourceUsersCollection) GetLinks() CollectionLinks { + if o == nil { + var ret CollectionLinks + return ret + } + + return o.Links +} + +// GetLinksOk returns a tuple with the Links field value +// and a boolean to check if the value has been set. +func (o *ResourceUsersCollection) GetLinksOk() (*CollectionLinks, bool) { + if o == nil { + return nil, false + } + return &o.Links, true +} + +// SetLinks sets field value +func (o *ResourceUsersCollection) SetLinks(v CollectionLinks) { + o.Links = v +} + +func (o ResourceUsersCollection) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ResourceUsersCollection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["users"] = o.Users + if !IsNil(o.Pagination) { + toSerialize["pagination"] = o.Pagination + } + toSerialize["links"] = o.Links + return toSerialize, nil +} + +func (o *ResourceUsersCollection) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "users", + "links", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varResourceUsersCollection := _ResourceUsersCollection{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varResourceUsersCollection) + + if err != nil { + return err + } + + *o = ResourceUsersCollection(varResourceUsersCollection) + + return err +} + +type NullableResourceUsersCollection struct { + value *ResourceUsersCollection + isSet bool +} + +func (v NullableResourceUsersCollection) Get() *ResourceUsersCollection { + return v.value +} + +func (v *NullableResourceUsersCollection) Set(val *ResourceUsersCollection) { + v.value = val + v.isSet = true +} + +func (v NullableResourceUsersCollection) IsSet() bool { + return v.isSet +} + +func (v *NullableResourceUsersCollection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableResourceUsersCollection(val *ResourceUsersCollection) *NullableResourceUsersCollection { + return &NullableResourceUsersCollection{value: val, isSet: true} +} + +func (v NullableResourceUsersCollection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableResourceUsersCollection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_role.go b/src/models/model_role.go new file mode 100644 index 0000000..e255580 --- /dev/null +++ b/src/models/model_role.go @@ -0,0 +1,273 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the Role type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Role{} + +// Role The role which contains a list of permissions. +type Role struct { + // Unique identifier for the role, can be specified on creation, and used by records to map to permissions. + RoleId *string `json:"roleId,omitempty"` + // A helpful name for this role + Name string `json:"name"` + // A description for when to the user as well as additional information. + Description NullableString `json:"description,omitempty"` + // A list of the permissions + Permissions []PermissionObject `json:"permissions"` +} + +type _Role Role + +// NewRole instantiates a new Role object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRole(name string, permissions []PermissionObject) *Role { + this := Role{} + this.Name = name + this.Permissions = permissions + return &this +} + +// NewRoleWithDefaults instantiates a new Role object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRoleWithDefaults() *Role { + this := Role{} + return &this +} + +// GetRoleId returns the RoleId field value if set, zero value otherwise. +func (o *Role) GetRoleId() string { + if o == nil || IsNil(o.RoleId) { + var ret string + return ret + } + return *o.RoleId +} + +// GetRoleIdOk returns a tuple with the RoleId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Role) GetRoleIdOk() (*string, bool) { + if o == nil || IsNil(o.RoleId) { + return nil, false + } + return o.RoleId, true +} + +// HasRoleId returns a boolean if a field has been set. +func (o *Role) HasRoleId() bool { + if o != nil && !IsNil(o.RoleId) { + return true + } + + return false +} + +// SetRoleId gets a reference to the given string and assigns it to the RoleId field. +func (o *Role) SetRoleId(v string) { + o.RoleId = &v +} + +// GetName returns the Name field value +func (o *Role) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Role) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Role) SetName(v string) { + o.Name = v +} + +// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Role) GetDescription() string { + if o == nil || IsNil(o.Description.Get()) { + var ret string + return ret + } + return *o.Description.Get() +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Role) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Description.Get(), o.Description.IsSet() +} + +// HasDescription returns a boolean if a field has been set. +func (o *Role) HasDescription() bool { + if o != nil && o.Description.IsSet() { + return true + } + + return false +} + +// SetDescription gets a reference to the given NullableString and assigns it to the Description field. +func (o *Role) SetDescription(v string) { + o.Description.Set(&v) +} +// SetDescriptionNil sets the value for Description to be an explicit nil +func (o *Role) SetDescriptionNil() { + o.Description.Set(nil) +} + +// UnsetDescription ensures that no value is present for Description, not even an explicit nil +func (o *Role) UnsetDescription() { + o.Description.Unset() +} + +// GetPermissions returns the Permissions field value +func (o *Role) GetPermissions() []PermissionObject { + if o == nil { + var ret []PermissionObject + return ret + } + + return o.Permissions +} + +// GetPermissionsOk returns a tuple with the Permissions field value +// and a boolean to check if the value has been set. +func (o *Role) GetPermissionsOk() ([]PermissionObject, bool) { + if o == nil { + return nil, false + } + return o.Permissions, true +} + +// SetPermissions sets field value +func (o *Role) SetPermissions(v []PermissionObject) { + o.Permissions = v +} + +func (o Role) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Role) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.RoleId) { + toSerialize["roleId"] = o.RoleId + } + toSerialize["name"] = o.Name + if o.Description.IsSet() { + toSerialize["description"] = o.Description.Get() + } + toSerialize["permissions"] = o.Permissions + return toSerialize, nil +} + +func (o *Role) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "permissions", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRole := _Role{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRole) + + if err != nil { + return err + } + + *o = Role(varRole) + + return err +} + +type NullableRole struct { + value *Role + isSet bool +} + +func (v NullableRole) Get() *Role { + return v.value +} + +func (v *NullableRole) Set(val *Role) { + v.value = val + v.isSet = true +} + +func (v NullableRole) IsSet() bool { + return v.isSet +} + +func (v *NullableRole) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRole(val *Role) *NullableRole { + return &NullableRole{value: val, isSet: true} +} + +func (v NullableRole) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRole) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_role_collection.go b/src/models/model_role_collection.go new file mode 100644 index 0000000..412016e --- /dev/null +++ b/src/models/model_role_collection.go @@ -0,0 +1,224 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the RoleCollection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RoleCollection{} + +// RoleCollection A collection of roles +type RoleCollection struct { + // A list of roles + Roles []Role `json:"roles"` + Pagination *Pagination `json:"pagination,omitempty"` + Links CollectionLinks `json:"links"` +} + +type _RoleCollection RoleCollection + +// NewRoleCollection instantiates a new RoleCollection object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRoleCollection(roles []Role, links CollectionLinks) *RoleCollection { + this := RoleCollection{} + this.Roles = roles + this.Links = links + return &this +} + +// NewRoleCollectionWithDefaults instantiates a new RoleCollection object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRoleCollectionWithDefaults() *RoleCollection { + this := RoleCollection{} + return &this +} + +// GetRoles returns the Roles field value +func (o *RoleCollection) GetRoles() []Role { + if o == nil { + var ret []Role + return ret + } + + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value +// and a boolean to check if the value has been set. +func (o *RoleCollection) GetRolesOk() ([]Role, bool) { + if o == nil { + return nil, false + } + return o.Roles, true +} + +// SetRoles sets field value +func (o *RoleCollection) SetRoles(v []Role) { + o.Roles = v +} + +// GetPagination returns the Pagination field value if set, zero value otherwise. +func (o *RoleCollection) GetPagination() Pagination { + if o == nil || IsNil(o.Pagination) { + var ret Pagination + return ret + } + return *o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RoleCollection) GetPaginationOk() (*Pagination, bool) { + if o == nil || IsNil(o.Pagination) { + return nil, false + } + return o.Pagination, true +} + +// HasPagination returns a boolean if a field has been set. +func (o *RoleCollection) HasPagination() bool { + if o != nil && !IsNil(o.Pagination) { + return true + } + + return false +} + +// SetPagination gets a reference to the given Pagination and assigns it to the Pagination field. +func (o *RoleCollection) SetPagination(v Pagination) { + o.Pagination = &v +} + +// GetLinks returns the Links field value +func (o *RoleCollection) GetLinks() CollectionLinks { + if o == nil { + var ret CollectionLinks + return ret + } + + return o.Links +} + +// GetLinksOk returns a tuple with the Links field value +// and a boolean to check if the value has been set. +func (o *RoleCollection) GetLinksOk() (*CollectionLinks, bool) { + if o == nil { + return nil, false + } + return &o.Links, true +} + +// SetLinks sets field value +func (o *RoleCollection) SetLinks(v CollectionLinks) { + o.Links = v +} + +func (o RoleCollection) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RoleCollection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["roles"] = o.Roles + if !IsNil(o.Pagination) { + toSerialize["pagination"] = o.Pagination + } + toSerialize["links"] = o.Links + return toSerialize, nil +} + +func (o *RoleCollection) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "roles", + "links", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRoleCollection := _RoleCollection{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRoleCollection) + + if err != nil { + return err + } + + *o = RoleCollection(varRoleCollection) + + return err +} + +type NullableRoleCollection struct { + value *RoleCollection + isSet bool +} + +func (v NullableRoleCollection) Get() *RoleCollection { + return v.value +} + +func (v *NullableRoleCollection) Set(val *RoleCollection) { + v.value = val + v.isSet = true +} + +func (v NullableRoleCollection) IsSet() bool { + return v.isSet +} + +func (v *NullableRoleCollection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRoleCollection(val *RoleCollection) *NullableRoleCollection { + return &NullableRoleCollection{value: val, isSet: true} +} + +func (v NullableRoleCollection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRoleCollection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_statement.go b/src/models/model_statement.go new file mode 100644 index 0000000..3be1970 --- /dev/null +++ b/src/models/model_statement.go @@ -0,0 +1,261 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the Statement type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Statement{} + +// Statement struct for Statement +type Statement struct { + Roles []string `json:"roles"` + Resources []Resource `json:"resources"` + // The list of users this statement applies to. Users and groups can be set at either the statement level or the record level, but not both. + Users []User `json:"users,omitempty"` + // The list of groups this statement applies to. Users in these groups will be receive access to the resources listed. Users and groups can be set at either the statement level or the record level, but not both. + Groups []LinkedGroup `json:"groups,omitempty"` +} + +type _Statement Statement + +// NewStatement instantiates a new Statement object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewStatement(roles []string, resources []Resource) *Statement { + this := Statement{} + this.Roles = roles + this.Resources = resources + return &this +} + +// NewStatementWithDefaults instantiates a new Statement object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewStatementWithDefaults() *Statement { + this := Statement{} + return &this +} + +// GetRoles returns the Roles field value +func (o *Statement) GetRoles() []string { + if o == nil { + var ret []string + return ret + } + + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value +// and a boolean to check if the value has been set. +func (o *Statement) GetRolesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Roles, true +} + +// SetRoles sets field value +func (o *Statement) SetRoles(v []string) { + o.Roles = v +} + +// GetResources returns the Resources field value +func (o *Statement) GetResources() []Resource { + if o == nil { + var ret []Resource + return ret + } + + return o.Resources +} + +// GetResourcesOk returns a tuple with the Resources field value +// and a boolean to check if the value has been set. +func (o *Statement) GetResourcesOk() ([]Resource, bool) { + if o == nil { + return nil, false + } + return o.Resources, true +} + +// SetResources sets field value +func (o *Statement) SetResources(v []Resource) { + o.Resources = v +} + +// GetUsers returns the Users field value if set, zero value otherwise. +func (o *Statement) GetUsers() []User { + if o == nil || IsNil(o.Users) { + var ret []User + return ret + } + return o.Users +} + +// GetUsersOk returns a tuple with the Users field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Statement) GetUsersOk() ([]User, bool) { + if o == nil || IsNil(o.Users) { + return nil, false + } + return o.Users, true +} + +// HasUsers returns a boolean if a field has been set. +func (o *Statement) HasUsers() bool { + if o != nil && !IsNil(o.Users) { + return true + } + + return false +} + +// SetUsers gets a reference to the given []User and assigns it to the Users field. +func (o *Statement) SetUsers(v []User) { + o.Users = v +} + +// GetGroups returns the Groups field value if set, zero value otherwise. +func (o *Statement) GetGroups() []LinkedGroup { + if o == nil || IsNil(o.Groups) { + var ret []LinkedGroup + return ret + } + return o.Groups +} + +// GetGroupsOk returns a tuple with the Groups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Statement) GetGroupsOk() ([]LinkedGroup, bool) { + if o == nil || IsNil(o.Groups) { + return nil, false + } + return o.Groups, true +} + +// HasGroups returns a boolean if a field has been set. +func (o *Statement) HasGroups() bool { + if o != nil && !IsNil(o.Groups) { + return true + } + + return false +} + +// SetGroups gets a reference to the given []LinkedGroup and assigns it to the Groups field. +func (o *Statement) SetGroups(v []LinkedGroup) { + o.Groups = v +} + +func (o Statement) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Statement) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["roles"] = o.Roles + toSerialize["resources"] = o.Resources + if !IsNil(o.Users) { + toSerialize["users"] = o.Users + } + if !IsNil(o.Groups) { + toSerialize["groups"] = o.Groups + } + return toSerialize, nil +} + +func (o *Statement) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "roles", + "resources", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varStatement := _Statement{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varStatement) + + if err != nil { + return err + } + + *o = Statement(varStatement) + + return err +} + +type NullableStatement struct { + value *Statement + isSet bool +} + +func (v NullableStatement) Get() *Statement { + return v.value +} + +func (v *NullableStatement) Set(val *Statement) { + v.value = val + v.isSet = true +} + +func (v NullableStatement) IsSet() bool { + return v.isSet +} + +func (v *NullableStatement) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStatement(val *Statement) *NullableStatement { + return &NullableStatement{value: val, isSet: true} +} + +func (v NullableStatement) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStatement) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_tenant.go b/src/models/model_tenant.go new file mode 100644 index 0000000..ab72992 --- /dev/null +++ b/src/models/model_tenant.go @@ -0,0 +1,302 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "time" +) + +// checks if the Tenant type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Tenant{} + +// Tenant struct for Tenant +type Tenant struct { + TenantId NullableString `json:"tenantId,omitempty"` + TenantLookupIdentifier NullableString `json:"tenantLookupIdentifier,omitempty"` + Data *TenantData `json:"data,omitempty"` + Connection NullableTenantConnection `json:"connection,omitempty"` + CreatedTime *time.Time `json:"createdTime,omitempty"` +} + +// NewTenant instantiates a new Tenant object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTenant() *Tenant { + this := Tenant{} + return &this +} + +// NewTenantWithDefaults instantiates a new Tenant object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTenantWithDefaults() *Tenant { + this := Tenant{} + return &this +} + +// GetTenantId returns the TenantId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Tenant) GetTenantId() string { + if o == nil || IsNil(o.TenantId.Get()) { + var ret string + return ret + } + return *o.TenantId.Get() +} + +// GetTenantIdOk returns a tuple with the TenantId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Tenant) GetTenantIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.TenantId.Get(), o.TenantId.IsSet() +} + +// HasTenantId returns a boolean if a field has been set. +func (o *Tenant) HasTenantId() bool { + if o != nil && o.TenantId.IsSet() { + return true + } + + return false +} + +// SetTenantId gets a reference to the given NullableString and assigns it to the TenantId field. +func (o *Tenant) SetTenantId(v string) { + o.TenantId.Set(&v) +} +// SetTenantIdNil sets the value for TenantId to be an explicit nil +func (o *Tenant) SetTenantIdNil() { + o.TenantId.Set(nil) +} + +// UnsetTenantId ensures that no value is present for TenantId, not even an explicit nil +func (o *Tenant) UnsetTenantId() { + o.TenantId.Unset() +} + +// GetTenantLookupIdentifier returns the TenantLookupIdentifier field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Tenant) GetTenantLookupIdentifier() string { + if o == nil || IsNil(o.TenantLookupIdentifier.Get()) { + var ret string + return ret + } + return *o.TenantLookupIdentifier.Get() +} + +// GetTenantLookupIdentifierOk returns a tuple with the TenantLookupIdentifier field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Tenant) GetTenantLookupIdentifierOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.TenantLookupIdentifier.Get(), o.TenantLookupIdentifier.IsSet() +} + +// HasTenantLookupIdentifier returns a boolean if a field has been set. +func (o *Tenant) HasTenantLookupIdentifier() bool { + if o != nil && o.TenantLookupIdentifier.IsSet() { + return true + } + + return false +} + +// SetTenantLookupIdentifier gets a reference to the given NullableString and assigns it to the TenantLookupIdentifier field. +func (o *Tenant) SetTenantLookupIdentifier(v string) { + o.TenantLookupIdentifier.Set(&v) +} +// SetTenantLookupIdentifierNil sets the value for TenantLookupIdentifier to be an explicit nil +func (o *Tenant) SetTenantLookupIdentifierNil() { + o.TenantLookupIdentifier.Set(nil) +} + +// UnsetTenantLookupIdentifier ensures that no value is present for TenantLookupIdentifier, not even an explicit nil +func (o *Tenant) UnsetTenantLookupIdentifier() { + o.TenantLookupIdentifier.Unset() +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *Tenant) GetData() TenantData { + if o == nil || IsNil(o.Data) { + var ret TenantData + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Tenant) GetDataOk() (*TenantData, bool) { + if o == nil || IsNil(o.Data) { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *Tenant) HasData() bool { + if o != nil && !IsNil(o.Data) { + return true + } + + return false +} + +// SetData gets a reference to the given TenantData and assigns it to the Data field. +func (o *Tenant) SetData(v TenantData) { + o.Data = &v +} + +// GetConnection returns the Connection field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Tenant) GetConnection() TenantConnection { + if o == nil || IsNil(o.Connection.Get()) { + var ret TenantConnection + return ret + } + return *o.Connection.Get() +} + +// GetConnectionOk returns a tuple with the Connection field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Tenant) GetConnectionOk() (*TenantConnection, bool) { + if o == nil { + return nil, false + } + return o.Connection.Get(), o.Connection.IsSet() +} + +// HasConnection returns a boolean if a field has been set. +func (o *Tenant) HasConnection() bool { + if o != nil && o.Connection.IsSet() { + return true + } + + return false +} + +// SetConnection gets a reference to the given NullableTenantConnection and assigns it to the Connection field. +func (o *Tenant) SetConnection(v TenantConnection) { + o.Connection.Set(&v) +} +// SetConnectionNil sets the value for Connection to be an explicit nil +func (o *Tenant) SetConnectionNil() { + o.Connection.Set(nil) +} + +// UnsetConnection ensures that no value is present for Connection, not even an explicit nil +func (o *Tenant) UnsetConnection() { + o.Connection.Unset() +} + +// GetCreatedTime returns the CreatedTime field value if set, zero value otherwise. +func (o *Tenant) GetCreatedTime() time.Time { + if o == nil || IsNil(o.CreatedTime) { + var ret time.Time + return ret + } + return *o.CreatedTime +} + +// GetCreatedTimeOk returns a tuple with the CreatedTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Tenant) GetCreatedTimeOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedTime) { + return nil, false + } + return o.CreatedTime, true +} + +// HasCreatedTime returns a boolean if a field has been set. +func (o *Tenant) HasCreatedTime() bool { + if o != nil && !IsNil(o.CreatedTime) { + return true + } + + return false +} + +// SetCreatedTime gets a reference to the given time.Time and assigns it to the CreatedTime field. +func (o *Tenant) SetCreatedTime(v time.Time) { + o.CreatedTime = &v +} + +func (o Tenant) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Tenant) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.TenantId.IsSet() { + toSerialize["tenantId"] = o.TenantId.Get() + } + if o.TenantLookupIdentifier.IsSet() { + toSerialize["tenantLookupIdentifier"] = o.TenantLookupIdentifier.Get() + } + if !IsNil(o.Data) { + toSerialize["data"] = o.Data + } + if o.Connection.IsSet() { + toSerialize["connection"] = o.Connection.Get() + } + if !IsNil(o.CreatedTime) { + toSerialize["createdTime"] = o.CreatedTime + } + return toSerialize, nil +} + +type NullableTenant struct { + value *Tenant + isSet bool +} + +func (v NullableTenant) Get() *Tenant { + return v.value +} + +func (v *NullableTenant) Set(val *Tenant) { + v.value = val + v.isSet = true +} + +func (v NullableTenant) IsSet() bool { + return v.isSet +} + +func (v *NullableTenant) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTenant(val *Tenant) *NullableTenant { + return &NullableTenant{value: val, isSet: true} +} + +func (v NullableTenant) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTenant) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_tenant_collection.go b/src/models/model_tenant_collection.go new file mode 100644 index 0000000..d732f5f --- /dev/null +++ b/src/models/model_tenant_collection.go @@ -0,0 +1,195 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the TenantCollection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TenantCollection{} + +// TenantCollection A collection of tenants. +type TenantCollection struct { + Tenants []Tenant `json:"tenants"` + Pagination *Pagination `json:"pagination,omitempty"` +} + +type _TenantCollection TenantCollection + +// NewTenantCollection instantiates a new TenantCollection object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTenantCollection(tenants []Tenant) *TenantCollection { + this := TenantCollection{} + this.Tenants = tenants + return &this +} + +// NewTenantCollectionWithDefaults instantiates a new TenantCollection object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTenantCollectionWithDefaults() *TenantCollection { + this := TenantCollection{} + return &this +} + +// GetTenants returns the Tenants field value +func (o *TenantCollection) GetTenants() []Tenant { + if o == nil { + var ret []Tenant + return ret + } + + return o.Tenants +} + +// GetTenantsOk returns a tuple with the Tenants field value +// and a boolean to check if the value has been set. +func (o *TenantCollection) GetTenantsOk() ([]Tenant, bool) { + if o == nil { + return nil, false + } + return o.Tenants, true +} + +// SetTenants sets field value +func (o *TenantCollection) SetTenants(v []Tenant) { + o.Tenants = v +} + +// GetPagination returns the Pagination field value if set, zero value otherwise. +func (o *TenantCollection) GetPagination() Pagination { + if o == nil || IsNil(o.Pagination) { + var ret Pagination + return ret + } + return *o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TenantCollection) GetPaginationOk() (*Pagination, bool) { + if o == nil || IsNil(o.Pagination) { + return nil, false + } + return o.Pagination, true +} + +// HasPagination returns a boolean if a field has been set. +func (o *TenantCollection) HasPagination() bool { + if o != nil && !IsNil(o.Pagination) { + return true + } + + return false +} + +// SetPagination gets a reference to the given Pagination and assigns it to the Pagination field. +func (o *TenantCollection) SetPagination(v Pagination) { + o.Pagination = &v +} + +func (o TenantCollection) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TenantCollection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["tenants"] = o.Tenants + if !IsNil(o.Pagination) { + toSerialize["pagination"] = o.Pagination + } + return toSerialize, nil +} + +func (o *TenantCollection) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "tenants", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTenantCollection := _TenantCollection{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varTenantCollection) + + if err != nil { + return err + } + + *o = TenantCollection(varTenantCollection) + + return err +} + +type NullableTenantCollection struct { + value *TenantCollection + isSet bool +} + +func (v NullableTenantCollection) Get() *TenantCollection { + return v.value +} + +func (v *NullableTenantCollection) Set(val *TenantCollection) { + v.value = val + v.isSet = true +} + +func (v NullableTenantCollection) IsSet() bool { + return v.isSet +} + +func (v *NullableTenantCollection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTenantCollection(val *TenantCollection) *NullableTenantCollection { + return &NullableTenantCollection{value: val, isSet: true} +} + +func (v NullableTenantCollection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTenantCollection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_tenant_connection.go b/src/models/model_tenant_connection.go new file mode 100644 index 0000000..f687e11 --- /dev/null +++ b/src/models/model_tenant_connection.go @@ -0,0 +1,137 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" +) + +// checks if the TenantConnection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TenantConnection{} + +// TenantConnection struct for TenantConnection +type TenantConnection struct { + ConnectionId NullableString `json:"connectionId,omitempty"` +} + +// NewTenantConnection instantiates a new TenantConnection object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTenantConnection() *TenantConnection { + this := TenantConnection{} + return &this +} + +// NewTenantConnectionWithDefaults instantiates a new TenantConnection object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTenantConnectionWithDefaults() *TenantConnection { + this := TenantConnection{} + return &this +} + +// GetConnectionId returns the ConnectionId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TenantConnection) GetConnectionId() string { + if o == nil || IsNil(o.ConnectionId.Get()) { + var ret string + return ret + } + return *o.ConnectionId.Get() +} + +// GetConnectionIdOk returns a tuple with the ConnectionId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TenantConnection) GetConnectionIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ConnectionId.Get(), o.ConnectionId.IsSet() +} + +// HasConnectionId returns a boolean if a field has been set. +func (o *TenantConnection) HasConnectionId() bool { + if o != nil && o.ConnectionId.IsSet() { + return true + } + + return false +} + +// SetConnectionId gets a reference to the given NullableString and assigns it to the ConnectionId field. +func (o *TenantConnection) SetConnectionId(v string) { + o.ConnectionId.Set(&v) +} +// SetConnectionIdNil sets the value for ConnectionId to be an explicit nil +func (o *TenantConnection) SetConnectionIdNil() { + o.ConnectionId.Set(nil) +} + +// UnsetConnectionId ensures that no value is present for ConnectionId, not even an explicit nil +func (o *TenantConnection) UnsetConnectionId() { + o.ConnectionId.Unset() +} + +func (o TenantConnection) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TenantConnection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.ConnectionId.IsSet() { + toSerialize["connectionId"] = o.ConnectionId.Get() + } + return toSerialize, nil +} + +type NullableTenantConnection struct { + value *TenantConnection + isSet bool +} + +func (v NullableTenantConnection) Get() *TenantConnection { + return v.value +} + +func (v *NullableTenantConnection) Set(val *TenantConnection) { + v.value = val + v.isSet = true +} + +func (v NullableTenantConnection) IsSet() bool { + return v.isSet +} + +func (v *NullableTenantConnection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTenantConnection(val *TenantConnection) *NullableTenantConnection { + return &NullableTenantConnection{value: val, isSet: true} +} + +func (v NullableTenantConnection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTenantConnection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_tenant_data.go b/src/models/model_tenant_data.go new file mode 100644 index 0000000..47ace00 --- /dev/null +++ b/src/models/model_tenant_data.go @@ -0,0 +1,137 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" +) + +// checks if the TenantData type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TenantData{} + +// TenantData struct for TenantData +type TenantData struct { + Name NullableString `json:"name,omitempty"` +} + +// NewTenantData instantiates a new TenantData object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTenantData() *TenantData { + this := TenantData{} + return &this +} + +// NewTenantDataWithDefaults instantiates a new TenantData object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTenantDataWithDefaults() *TenantData { + this := TenantData{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TenantData) GetName() string { + if o == nil || IsNil(o.Name.Get()) { + var ret string + return ret + } + return *o.Name.Get() +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TenantData) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Name.Get(), o.Name.IsSet() +} + +// HasName returns a boolean if a field has been set. +func (o *TenantData) HasName() bool { + if o != nil && o.Name.IsSet() { + return true + } + + return false +} + +// SetName gets a reference to the given NullableString and assigns it to the Name field. +func (o *TenantData) SetName(v string) { + o.Name.Set(&v) +} +// SetNameNil sets the value for Name to be an explicit nil +func (o *TenantData) SetNameNil() { + o.Name.Set(nil) +} + +// UnsetName ensures that no value is present for Name, not even an explicit nil +func (o *TenantData) UnsetName() { + o.Name.Unset() +} + +func (o TenantData) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TenantData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Name.IsSet() { + toSerialize["name"] = o.Name.Get() + } + return toSerialize, nil +} + +type NullableTenantData struct { + value *TenantData + isSet bool +} + +func (v NullableTenantData) Get() *TenantData { + return v.value +} + +func (v *NullableTenantData) Set(val *TenantData) { + v.value = val + v.isSet = true +} + +func (v NullableTenantData) IsSet() bool { + return v.isSet +} + +func (v *NullableTenantData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTenantData(val *TenantData) *NullableTenantData { + return &NullableTenantData{value: val, isSet: true} +} + +func (v NullableTenantData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTenantData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_token_request.go b/src/models/model_token_request.go new file mode 100644 index 0000000..0ea2fe4 --- /dev/null +++ b/src/models/model_token_request.go @@ -0,0 +1,190 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "time" + "bytes" + "fmt" +) + +// checks if the TokenRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TokenRequest{} + +// TokenRequest struct for TokenRequest +type TokenRequest struct { + // A list of statements which match roles to resources. The token will have all statements apply to it. + Statements []Statement `json:"statements"` + // The ISO8601 datetime when the token will expire. Default is 24 hours from now. + Expires time.Time `json:"expires"` +} + +type _TokenRequest TokenRequest + +// NewTokenRequest instantiates a new TokenRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTokenRequest(statements []Statement, expires time.Time) *TokenRequest { + this := TokenRequest{} + this.Statements = statements + this.Expires = expires + return &this +} + +// NewTokenRequestWithDefaults instantiates a new TokenRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTokenRequestWithDefaults() *TokenRequest { + this := TokenRequest{} + return &this +} + +// GetStatements returns the Statements field value +func (o *TokenRequest) GetStatements() []Statement { + if o == nil { + var ret []Statement + return ret + } + + return o.Statements +} + +// GetStatementsOk returns a tuple with the Statements field value +// and a boolean to check if the value has been set. +func (o *TokenRequest) GetStatementsOk() ([]Statement, bool) { + if o == nil { + return nil, false + } + return o.Statements, true +} + +// SetStatements sets field value +func (o *TokenRequest) SetStatements(v []Statement) { + o.Statements = v +} + +// GetExpires returns the Expires field value +func (o *TokenRequest) GetExpires() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Expires +} + +// GetExpiresOk returns a tuple with the Expires field value +// and a boolean to check if the value has been set. +func (o *TokenRequest) GetExpiresOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Expires, true +} + +// SetExpires sets field value +func (o *TokenRequest) SetExpires(v time.Time) { + o.Expires = v +} + +func (o TokenRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TokenRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["statements"] = o.Statements + toSerialize["expires"] = o.Expires + return toSerialize, nil +} + +func (o *TokenRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "statements", + "expires", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTokenRequest := _TokenRequest{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varTokenRequest) + + if err != nil { + return err + } + + *o = TokenRequest(varTokenRequest) + + return err +} + +type NullableTokenRequest struct { + value *TokenRequest + isSet bool +} + +func (v NullableTokenRequest) Get() *TokenRequest { + return v.value +} + +func (v *NullableTokenRequest) Set(val *TokenRequest) { + v.value = val + v.isSet = true +} + +func (v NullableTokenRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableTokenRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTokenRequest(val *TokenRequest) *NullableTokenRequest { + return &NullableTokenRequest{value: val, isSet: true} +} + +func (v NullableTokenRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTokenRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_user.go b/src/models/model_user.go new file mode 100644 index 0000000..83f0221 --- /dev/null +++ b/src/models/model_user.go @@ -0,0 +1,159 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the User type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &User{} + +// User A user object that identifies a user. +type User struct { + UserId string `json:"userId"` +} + +type _User User + +// NewUser instantiates a new User object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUser(userId string) *User { + this := User{} + this.UserId = userId + return &this +} + +// NewUserWithDefaults instantiates a new User object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserWithDefaults() *User { + this := User{} + return &this +} + +// GetUserId returns the UserId field value +func (o *User) GetUserId() string { + if o == nil { + var ret string + return ret + } + + return o.UserId +} + +// GetUserIdOk returns a tuple with the UserId field value +// and a boolean to check if the value has been set. +func (o *User) GetUserIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UserId, true +} + +// SetUserId sets field value +func (o *User) SetUserId(v string) { + o.UserId = v +} + +func (o User) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o User) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["userId"] = o.UserId + return toSerialize, nil +} + +func (o *User) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "userId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUser := _User{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varUser) + + if err != nil { + return err + } + + *o = User(varUser) + + return err +} + +type NullableUser struct { + value *User + isSet bool +} + +func (v NullableUser) Get() *User { + return v.value +} + +func (v *NullableUser) Set(val *User) { + v.value = val + v.isSet = true +} + +func (v NullableUser) IsSet() bool { + return v.isSet +} + +func (v *NullableUser) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUser(val *User) *NullableUser { + return &NullableUser{value: val, isSet: true} +} + +func (v NullableUser) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUser) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_user_connection_credentials.go b/src/models/model_user_connection_credentials.go new file mode 100644 index 0000000..235130b --- /dev/null +++ b/src/models/model_user_connection_credentials.go @@ -0,0 +1,160 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the UserConnectionCredentials type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserConnectionCredentials{} + +// UserConnectionCredentials The user credentials for this connection which can be used to access the connection provider APIs. +type UserConnectionCredentials struct { + // The access token. + AccessToken string `json:"accessToken"` +} + +type _UserConnectionCredentials UserConnectionCredentials + +// NewUserConnectionCredentials instantiates a new UserConnectionCredentials object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserConnectionCredentials(accessToken string) *UserConnectionCredentials { + this := UserConnectionCredentials{} + this.AccessToken = accessToken + return &this +} + +// NewUserConnectionCredentialsWithDefaults instantiates a new UserConnectionCredentials object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserConnectionCredentialsWithDefaults() *UserConnectionCredentials { + this := UserConnectionCredentials{} + return &this +} + +// GetAccessToken returns the AccessToken field value +func (o *UserConnectionCredentials) GetAccessToken() string { + if o == nil { + var ret string + return ret + } + + return o.AccessToken +} + +// GetAccessTokenOk returns a tuple with the AccessToken field value +// and a boolean to check if the value has been set. +func (o *UserConnectionCredentials) GetAccessTokenOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccessToken, true +} + +// SetAccessToken sets field value +func (o *UserConnectionCredentials) SetAccessToken(v string) { + o.AccessToken = v +} + +func (o UserConnectionCredentials) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserConnectionCredentials) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accessToken"] = o.AccessToken + return toSerialize, nil +} + +func (o *UserConnectionCredentials) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "accessToken", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserConnectionCredentials := _UserConnectionCredentials{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varUserConnectionCredentials) + + if err != nil { + return err + } + + *o = UserConnectionCredentials(varUserConnectionCredentials) + + return err +} + +type NullableUserConnectionCredentials struct { + value *UserConnectionCredentials + isSet bool +} + +func (v NullableUserConnectionCredentials) Get() *UserConnectionCredentials { + return v.value +} + +func (v *NullableUserConnectionCredentials) Set(val *UserConnectionCredentials) { + v.value = val + v.isSet = true +} + +func (v NullableUserConnectionCredentials) IsSet() bool { + return v.isSet +} + +func (v *NullableUserConnectionCredentials) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserConnectionCredentials(val *UserConnectionCredentials) *NullableUserConnectionCredentials { + return &NullableUserConnectionCredentials{value: val, isSet: true} +} + +func (v NullableUserConnectionCredentials) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserConnectionCredentials) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_user_identity.go b/src/models/model_user_identity.go new file mode 100644 index 0000000..9a3eae4 --- /dev/null +++ b/src/models/model_user_identity.go @@ -0,0 +1,271 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the UserIdentity type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserIdentity{} + +// UserIdentity The composite user identity stored in Authress sourced by the customer SSO/SAML/OAuth IdP. +type UserIdentity struct { + // The user identifier. + UserId string `json:"userId"` + // The user's formatted display name. + Name *string `json:"name,omitempty"` + // A url that resolves to a picture that can be rendered. + Picture *string `json:"picture,omitempty"` + // The user's verified email address sourced from their SSO IdP. + Email *string `json:"email,omitempty"` +} + +type _UserIdentity UserIdentity + +// NewUserIdentity instantiates a new UserIdentity object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserIdentity(userId string) *UserIdentity { + this := UserIdentity{} + this.UserId = userId + return &this +} + +// NewUserIdentityWithDefaults instantiates a new UserIdentity object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserIdentityWithDefaults() *UserIdentity { + this := UserIdentity{} + return &this +} + +// GetUserId returns the UserId field value +func (o *UserIdentity) GetUserId() string { + if o == nil { + var ret string + return ret + } + + return o.UserId +} + +// GetUserIdOk returns a tuple with the UserId field value +// and a boolean to check if the value has been set. +func (o *UserIdentity) GetUserIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UserId, true +} + +// SetUserId sets field value +func (o *UserIdentity) SetUserId(v string) { + o.UserId = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *UserIdentity) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserIdentity) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *UserIdentity) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *UserIdentity) SetName(v string) { + o.Name = &v +} + +// GetPicture returns the Picture field value if set, zero value otherwise. +func (o *UserIdentity) GetPicture() string { + if o == nil || IsNil(o.Picture) { + var ret string + return ret + } + return *o.Picture +} + +// GetPictureOk returns a tuple with the Picture field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserIdentity) GetPictureOk() (*string, bool) { + if o == nil || IsNil(o.Picture) { + return nil, false + } + return o.Picture, true +} + +// HasPicture returns a boolean if a field has been set. +func (o *UserIdentity) HasPicture() bool { + if o != nil && !IsNil(o.Picture) { + return true + } + + return false +} + +// SetPicture gets a reference to the given string and assigns it to the Picture field. +func (o *UserIdentity) SetPicture(v string) { + o.Picture = &v +} + +// GetEmail returns the Email field value if set, zero value otherwise. +func (o *UserIdentity) GetEmail() string { + if o == nil || IsNil(o.Email) { + var ret string + return ret + } + return *o.Email +} + +// GetEmailOk returns a tuple with the Email field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserIdentity) GetEmailOk() (*string, bool) { + if o == nil || IsNil(o.Email) { + return nil, false + } + return o.Email, true +} + +// HasEmail returns a boolean if a field has been set. +func (o *UserIdentity) HasEmail() bool { + if o != nil && !IsNil(o.Email) { + return true + } + + return false +} + +// SetEmail gets a reference to the given string and assigns it to the Email field. +func (o *UserIdentity) SetEmail(v string) { + o.Email = &v +} + +func (o UserIdentity) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserIdentity) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["userId"] = o.UserId + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Picture) { + toSerialize["picture"] = o.Picture + } + if !IsNil(o.Email) { + toSerialize["email"] = o.Email + } + return toSerialize, nil +} + +func (o *UserIdentity) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "userId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserIdentity := _UserIdentity{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varUserIdentity) + + if err != nil { + return err + } + + *o = UserIdentity(varUserIdentity) + + return err +} + +type NullableUserIdentity struct { + value *UserIdentity + isSet bool +} + +func (v NullableUserIdentity) Get() *UserIdentity { + return v.value +} + +func (v *NullableUserIdentity) Set(val *UserIdentity) { + v.value = val + v.isSet = true +} + +func (v NullableUserIdentity) IsSet() bool { + return v.isSet +} + +func (v *NullableUserIdentity) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserIdentity(val *UserIdentity) *NullableUserIdentity { + return &NullableUserIdentity{value: val, isSet: true} +} + +func (v NullableUserIdentity) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserIdentity) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_user_identity_collection.go b/src/models/model_user_identity_collection.go new file mode 100644 index 0000000..ee6a359 --- /dev/null +++ b/src/models/model_user_identity_collection.go @@ -0,0 +1,224 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the UserIdentityCollection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserIdentityCollection{} + +// UserIdentityCollection A collection of user identities +type UserIdentityCollection struct { + // A list of users + Users []UserIdentity `json:"users"` + Pagination *Pagination `json:"pagination,omitempty"` + Links CollectionLinks `json:"links"` +} + +type _UserIdentityCollection UserIdentityCollection + +// NewUserIdentityCollection instantiates a new UserIdentityCollection object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserIdentityCollection(users []UserIdentity, links CollectionLinks) *UserIdentityCollection { + this := UserIdentityCollection{} + this.Users = users + this.Links = links + return &this +} + +// NewUserIdentityCollectionWithDefaults instantiates a new UserIdentityCollection object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserIdentityCollectionWithDefaults() *UserIdentityCollection { + this := UserIdentityCollection{} + return &this +} + +// GetUsers returns the Users field value +func (o *UserIdentityCollection) GetUsers() []UserIdentity { + if o == nil { + var ret []UserIdentity + return ret + } + + return o.Users +} + +// GetUsersOk returns a tuple with the Users field value +// and a boolean to check if the value has been set. +func (o *UserIdentityCollection) GetUsersOk() ([]UserIdentity, bool) { + if o == nil { + return nil, false + } + return o.Users, true +} + +// SetUsers sets field value +func (o *UserIdentityCollection) SetUsers(v []UserIdentity) { + o.Users = v +} + +// GetPagination returns the Pagination field value if set, zero value otherwise. +func (o *UserIdentityCollection) GetPagination() Pagination { + if o == nil || IsNil(o.Pagination) { + var ret Pagination + return ret + } + return *o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserIdentityCollection) GetPaginationOk() (*Pagination, bool) { + if o == nil || IsNil(o.Pagination) { + return nil, false + } + return o.Pagination, true +} + +// HasPagination returns a boolean if a field has been set. +func (o *UserIdentityCollection) HasPagination() bool { + if o != nil && !IsNil(o.Pagination) { + return true + } + + return false +} + +// SetPagination gets a reference to the given Pagination and assigns it to the Pagination field. +func (o *UserIdentityCollection) SetPagination(v Pagination) { + o.Pagination = &v +} + +// GetLinks returns the Links field value +func (o *UserIdentityCollection) GetLinks() CollectionLinks { + if o == nil { + var ret CollectionLinks + return ret + } + + return o.Links +} + +// GetLinksOk returns a tuple with the Links field value +// and a boolean to check if the value has been set. +func (o *UserIdentityCollection) GetLinksOk() (*CollectionLinks, bool) { + if o == nil { + return nil, false + } + return &o.Links, true +} + +// SetLinks sets field value +func (o *UserIdentityCollection) SetLinks(v CollectionLinks) { + o.Links = v +} + +func (o UserIdentityCollection) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserIdentityCollection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["users"] = o.Users + if !IsNil(o.Pagination) { + toSerialize["pagination"] = o.Pagination + } + toSerialize["links"] = o.Links + return toSerialize, nil +} + +func (o *UserIdentityCollection) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "users", + "links", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserIdentityCollection := _UserIdentityCollection{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varUserIdentityCollection) + + if err != nil { + return err + } + + *o = UserIdentityCollection(varUserIdentityCollection) + + return err +} + +type NullableUserIdentityCollection struct { + value *UserIdentityCollection + isSet bool +} + +func (v NullableUserIdentityCollection) Get() *UserIdentityCollection { + return v.value +} + +func (v *NullableUserIdentityCollection) Set(val *UserIdentityCollection) { + v.value = val + v.isSet = true +} + +func (v NullableUserIdentityCollection) IsSet() bool { + return v.isSet +} + +func (v *NullableUserIdentityCollection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserIdentityCollection(val *UserIdentityCollection) *NullableUserIdentityCollection { + return &NullableUserIdentityCollection{value: val, isSet: true} +} + +func (v NullableUserIdentityCollection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserIdentityCollection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_user_resources_collection.go b/src/models/model_user_resources_collection.go new file mode 100644 index 0000000..eb01c80 --- /dev/null +++ b/src/models/model_user_resources_collection.go @@ -0,0 +1,296 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the UserResourcesCollection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserResourcesCollection{} + +// UserResourcesCollection A collect of permissions that the user has to a resource. +type UserResourcesCollection struct { + Account *PermissionCollectionAccount `json:"account,omitempty"` + UserId UserId `json:"userId"` + // A list of the resources the user has some permission to. + Resources []Resource `json:"resources,omitempty"` + Pagination *Pagination `json:"pagination,omitempty"` + Links CollectionLinks `json:"links"` +} + +type _UserResourcesCollection UserResourcesCollection + +// NewUserResourcesCollection instantiates a new UserResourcesCollection object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserResourcesCollection(userId UserId, links CollectionLinks) *UserResourcesCollection { + this := UserResourcesCollection{} + this.UserId = userId + this.Links = links + return &this +} + +// NewUserResourcesCollectionWithDefaults instantiates a new UserResourcesCollection object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserResourcesCollectionWithDefaults() *UserResourcesCollection { + this := UserResourcesCollection{} + return &this +} + +// GetAccount returns the Account field value if set, zero value otherwise. +func (o *UserResourcesCollection) GetAccount() PermissionCollectionAccount { + if o == nil || IsNil(o.Account) { + var ret PermissionCollectionAccount + return ret + } + return *o.Account +} + +// GetAccountOk returns a tuple with the Account field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserResourcesCollection) GetAccountOk() (*PermissionCollectionAccount, bool) { + if o == nil || IsNil(o.Account) { + return nil, false + } + return o.Account, true +} + +// HasAccount returns a boolean if a field has been set. +func (o *UserResourcesCollection) HasAccount() bool { + if o != nil && !IsNil(o.Account) { + return true + } + + return false +} + +// SetAccount gets a reference to the given PermissionCollectionAccount and assigns it to the Account field. +func (o *UserResourcesCollection) SetAccount(v PermissionCollectionAccount) { + o.Account = &v +} + +// GetUserId returns the UserId field value +func (o *UserResourcesCollection) GetUserId() UserId { + if o == nil { + var ret UserId + return ret + } + + return o.UserId +} + +// GetUserIdOk returns a tuple with the UserId field value +// and a boolean to check if the value has been set. +func (o *UserResourcesCollection) GetUserIdOk() (*UserId, bool) { + if o == nil { + return nil, false + } + return &o.UserId, true +} + +// SetUserId sets field value +func (o *UserResourcesCollection) SetUserId(v UserId) { + o.UserId = v +} + +// GetResources returns the Resources field value if set, zero value otherwise. +func (o *UserResourcesCollection) GetResources() []Resource { + if o == nil || IsNil(o.Resources) { + var ret []Resource + return ret + } + return o.Resources +} + +// GetResourcesOk returns a tuple with the Resources field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserResourcesCollection) GetResourcesOk() ([]Resource, bool) { + if o == nil || IsNil(o.Resources) { + return nil, false + } + return o.Resources, true +} + +// HasResources returns a boolean if a field has been set. +func (o *UserResourcesCollection) HasResources() bool { + if o != nil && !IsNil(o.Resources) { + return true + } + + return false +} + +// SetResources gets a reference to the given []Resource and assigns it to the Resources field. +func (o *UserResourcesCollection) SetResources(v []Resource) { + o.Resources = v +} + +// GetPagination returns the Pagination field value if set, zero value otherwise. +func (o *UserResourcesCollection) GetPagination() Pagination { + if o == nil || IsNil(o.Pagination) { + var ret Pagination + return ret + } + return *o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserResourcesCollection) GetPaginationOk() (*Pagination, bool) { + if o == nil || IsNil(o.Pagination) { + return nil, false + } + return o.Pagination, true +} + +// HasPagination returns a boolean if a field has been set. +func (o *UserResourcesCollection) HasPagination() bool { + if o != nil && !IsNil(o.Pagination) { + return true + } + + return false +} + +// SetPagination gets a reference to the given Pagination and assigns it to the Pagination field. +func (o *UserResourcesCollection) SetPagination(v Pagination) { + o.Pagination = &v +} + +// GetLinks returns the Links field value +func (o *UserResourcesCollection) GetLinks() CollectionLinks { + if o == nil { + var ret CollectionLinks + return ret + } + + return o.Links +} + +// GetLinksOk returns a tuple with the Links field value +// and a boolean to check if the value has been set. +func (o *UserResourcesCollection) GetLinksOk() (*CollectionLinks, bool) { + if o == nil { + return nil, false + } + return &o.Links, true +} + +// SetLinks sets field value +func (o *UserResourcesCollection) SetLinks(v CollectionLinks) { + o.Links = v +} + +func (o UserResourcesCollection) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserResourcesCollection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Account) { + toSerialize["account"] = o.Account + } + toSerialize["userId"] = o.UserId + if !IsNil(o.Resources) { + toSerialize["resources"] = o.Resources + } + if !IsNil(o.Pagination) { + toSerialize["pagination"] = o.Pagination + } + toSerialize["links"] = o.Links + return toSerialize, nil +} + +func (o *UserResourcesCollection) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "userId", + "links", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserResourcesCollection := _UserResourcesCollection{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varUserResourcesCollection) + + if err != nil { + return err + } + + *o = UserResourcesCollection(varUserResourcesCollection) + + return err +} + +type NullableUserResourcesCollection struct { + value *UserResourcesCollection + isSet bool +} + +func (v NullableUserResourcesCollection) Get() *UserResourcesCollection { + return v.value +} + +func (v *NullableUserResourcesCollection) Set(val *UserResourcesCollection) { + v.value = val + v.isSet = true +} + +func (v NullableUserResourcesCollection) IsSet() bool { + return v.isSet +} + +func (v *NullableUserResourcesCollection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserResourcesCollection(val *UserResourcesCollection) *NullableUserResourcesCollection { + return &NullableUserResourcesCollection{value: val, isSet: true} +} + +func (v NullableUserResourcesCollection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserResourcesCollection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_user_role.go b/src/models/model_user_role.go new file mode 100644 index 0000000..f293aec --- /dev/null +++ b/src/models/model_user_role.go @@ -0,0 +1,159 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the UserRole type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserRole{} + +// UserRole A role with associated role data. +type UserRole struct { + RoleId RoleId `json:"roleId"` +} + +type _UserRole UserRole + +// NewUserRole instantiates a new UserRole object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserRole(roleId RoleId) *UserRole { + this := UserRole{} + this.RoleId = roleId + return &this +} + +// NewUserRoleWithDefaults instantiates a new UserRole object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserRoleWithDefaults() *UserRole { + this := UserRole{} + return &this +} + +// GetRoleId returns the RoleId field value +func (o *UserRole) GetRoleId() RoleId { + if o == nil { + var ret RoleId + return ret + } + + return o.RoleId +} + +// GetRoleIdOk returns a tuple with the RoleId field value +// and a boolean to check if the value has been set. +func (o *UserRole) GetRoleIdOk() (*RoleId, bool) { + if o == nil { + return nil, false + } + return &o.RoleId, true +} + +// SetRoleId sets field value +func (o *UserRole) SetRoleId(v RoleId) { + o.RoleId = v +} + +func (o UserRole) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserRole) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["roleId"] = o.RoleId + return toSerialize, nil +} + +func (o *UserRole) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "roleId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserRole := _UserRole{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varUserRole) + + if err != nil { + return err + } + + *o = UserRole(varUserRole) + + return err +} + +type NullableUserRole struct { + value *UserRole + isSet bool +} + +func (v NullableUserRole) Get() *UserRole { + return v.value +} + +func (v *NullableUserRole) Set(val *UserRole) { + v.value = val + v.isSet = true +} + +func (v NullableUserRole) IsSet() bool { + return v.isSet +} + +func (v *NullableUserRole) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserRole(val *UserRole) *NullableUserRole { + return &NullableUserRole{value: val, isSet: true} +} + +func (v NullableUserRole) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserRole) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_user_role_collection.go b/src/models/model_user_role_collection.go new file mode 100644 index 0000000..76dd241 --- /dev/null +++ b/src/models/model_user_role_collection.go @@ -0,0 +1,188 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the UserRoleCollection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserRoleCollection{} + +// UserRoleCollection A collect of roles that the user has to a resource. +type UserRoleCollection struct { + UserId UserId `json:"userId"` + // A list of the roles + Roles []UserRole `json:"roles"` +} + +type _UserRoleCollection UserRoleCollection + +// NewUserRoleCollection instantiates a new UserRoleCollection object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserRoleCollection(userId UserId, roles []UserRole) *UserRoleCollection { + this := UserRoleCollection{} + this.UserId = userId + this.Roles = roles + return &this +} + +// NewUserRoleCollectionWithDefaults instantiates a new UserRoleCollection object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserRoleCollectionWithDefaults() *UserRoleCollection { + this := UserRoleCollection{} + return &this +} + +// GetUserId returns the UserId field value +func (o *UserRoleCollection) GetUserId() UserId { + if o == nil { + var ret UserId + return ret + } + + return o.UserId +} + +// GetUserIdOk returns a tuple with the UserId field value +// and a boolean to check if the value has been set. +func (o *UserRoleCollection) GetUserIdOk() (*UserId, bool) { + if o == nil { + return nil, false + } + return &o.UserId, true +} + +// SetUserId sets field value +func (o *UserRoleCollection) SetUserId(v UserId) { + o.UserId = v +} + +// GetRoles returns the Roles field value +func (o *UserRoleCollection) GetRoles() []UserRole { + if o == nil { + var ret []UserRole + return ret + } + + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value +// and a boolean to check if the value has been set. +func (o *UserRoleCollection) GetRolesOk() ([]UserRole, bool) { + if o == nil { + return nil, false + } + return o.Roles, true +} + +// SetRoles sets field value +func (o *UserRoleCollection) SetRoles(v []UserRole) { + o.Roles = v +} + +func (o UserRoleCollection) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserRoleCollection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["userId"] = o.UserId + toSerialize["roles"] = o.Roles + return toSerialize, nil +} + +func (o *UserRoleCollection) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "userId", + "roles", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserRoleCollection := _UserRoleCollection{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varUserRoleCollection) + + if err != nil { + return err + } + + *o = UserRoleCollection(varUserRoleCollection) + + return err +} + +type NullableUserRoleCollection struct { + value *UserRoleCollection + isSet bool +} + +func (v NullableUserRoleCollection) Get() *UserRoleCollection { + return v.value +} + +func (v *NullableUserRoleCollection) Set(val *UserRoleCollection) { + v.value = val + v.isSet = true +} + +func (v NullableUserRoleCollection) IsSet() bool { + return v.isSet +} + +func (v *NullableUserRoleCollection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserRoleCollection(val *UserRoleCollection) *NullableUserRoleCollection { + return &NullableUserRoleCollection{value: val, isSet: true} +} + +func (v NullableUserRoleCollection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserRoleCollection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/models/model_user_token.go b/src/models/model_user_token.go new file mode 100644 index 0000000..48f8c24 --- /dev/null +++ b/src/models/model_user_token.go @@ -0,0 +1,289 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the UserToken type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserToken{} + +// UserToken A JWT token with represents the user. +type UserToken struct { + Account *PermissionCollectionAccount `json:"account,omitempty"` + UserId UserId `json:"userId"` + // The unique identifier for the token + TokenId string `json:"tokenId"` + // The access token + Token string `json:"token"` + Links *AccountLinks `json:"links,omitempty"` +} + +type _UserToken UserToken + +// NewUserToken instantiates a new UserToken object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserToken(userId UserId, tokenId string, token string) *UserToken { + this := UserToken{} + this.UserId = userId + this.TokenId = tokenId + this.Token = token + return &this +} + +// NewUserTokenWithDefaults instantiates a new UserToken object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserTokenWithDefaults() *UserToken { + this := UserToken{} + return &this +} + +// GetAccount returns the Account field value if set, zero value otherwise. +func (o *UserToken) GetAccount() PermissionCollectionAccount { + if o == nil || IsNil(o.Account) { + var ret PermissionCollectionAccount + return ret + } + return *o.Account +} + +// GetAccountOk returns a tuple with the Account field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserToken) GetAccountOk() (*PermissionCollectionAccount, bool) { + if o == nil || IsNil(o.Account) { + return nil, false + } + return o.Account, true +} + +// HasAccount returns a boolean if a field has been set. +func (o *UserToken) HasAccount() bool { + if o != nil && !IsNil(o.Account) { + return true + } + + return false +} + +// SetAccount gets a reference to the given PermissionCollectionAccount and assigns it to the Account field. +func (o *UserToken) SetAccount(v PermissionCollectionAccount) { + o.Account = &v +} + +// GetUserId returns the UserId field value +func (o *UserToken) GetUserId() UserId { + if o == nil { + var ret UserId + return ret + } + + return o.UserId +} + +// GetUserIdOk returns a tuple with the UserId field value +// and a boolean to check if the value has been set. +func (o *UserToken) GetUserIdOk() (*UserId, bool) { + if o == nil { + return nil, false + } + return &o.UserId, true +} + +// SetUserId sets field value +func (o *UserToken) SetUserId(v UserId) { + o.UserId = v +} + +// GetTokenId returns the TokenId field value +func (o *UserToken) GetTokenId() string { + if o == nil { + var ret string + return ret + } + + return o.TokenId +} + +// GetTokenIdOk returns a tuple with the TokenId field value +// and a boolean to check if the value has been set. +func (o *UserToken) GetTokenIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TokenId, true +} + +// SetTokenId sets field value +func (o *UserToken) SetTokenId(v string) { + o.TokenId = v +} + +// GetToken returns the Token field value +func (o *UserToken) GetToken() string { + if o == nil { + var ret string + return ret + } + + return o.Token +} + +// GetTokenOk returns a tuple with the Token field value +// and a boolean to check if the value has been set. +func (o *UserToken) GetTokenOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Token, true +} + +// SetToken sets field value +func (o *UserToken) SetToken(v string) { + o.Token = v +} + +// GetLinks returns the Links field value if set, zero value otherwise. +func (o *UserToken) GetLinks() AccountLinks { + if o == nil || IsNil(o.Links) { + var ret AccountLinks + return ret + } + return *o.Links +} + +// GetLinksOk returns a tuple with the Links field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserToken) GetLinksOk() (*AccountLinks, bool) { + if o == nil || IsNil(o.Links) { + return nil, false + } + return o.Links, true +} + +// HasLinks returns a boolean if a field has been set. +func (o *UserToken) HasLinks() bool { + if o != nil && !IsNil(o.Links) { + return true + } + + return false +} + +// SetLinks gets a reference to the given AccountLinks and assigns it to the Links field. +func (o *UserToken) SetLinks(v AccountLinks) { + o.Links = &v +} + +func (o UserToken) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserToken) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Account) { + toSerialize["account"] = o.Account + } + toSerialize["userId"] = o.UserId + toSerialize["tokenId"] = o.TokenId + toSerialize["token"] = o.Token + if !IsNil(o.Links) { + toSerialize["links"] = o.Links + } + return toSerialize, nil +} + +func (o *UserToken) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "userId", + "tokenId", + "token", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserToken := _UserToken{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varUserToken) + + if err != nil { + return err + } + + *o = UserToken(varUserToken) + + return err +} + +type NullableUserToken struct { + value *UserToken + isSet bool +} + +func (v NullableUserToken) Get() *UserToken { + return v.value +} + +func (v *NullableUserToken) Set(val *UserToken) { + v.value = val + v.isSet = true +} + +func (v NullableUserToken) IsSet() bool { + return v.isSet +} + +func (v *NullableUserToken) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserToken(val *UserToken) *NullableUserToken { + return &NullableUserToken{value: val, isSet: true} +} + +func (v NullableUserToken) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserToken) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/utilities/response.go b/src/utilities/response.go new file mode 100644 index 0000000..7d7c037 --- /dev/null +++ b/src/utilities/response.go @@ -0,0 +1,48 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/src/utilities/utils.go b/src/utilities/utils.go new file mode 100644 index 0000000..51b789c --- /dev/null +++ b/src/utilities/utils.go @@ -0,0 +1,348 @@ +/* +Authress + +
Welcome to the Authress Authorization API.
The Authress REST API provides the operations and resources necessary to create records, assign permissions, and verify any user in your platform.
For more in-depth scenarios check out the Authress knowledge base.
+ +API version: v1 +Contact: support@authress.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authress + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/src/version.go b/src/version.go new file mode 100644 index 0000000..795a787 --- /dev/null +++ b/src/version.go @@ -0,0 +1,11 @@ +package authress + +type BuildInfo struct { + Version string +} + +func GetBuildInfo() BuildInfo { + return BuildInfo{ + Version: "0.0.0", + } +} \ No newline at end of file diff --git a/test/api_access_records_test.go b/test/api_access_records_test.go new file mode 100644 index 0000000..2b241dc --- /dev/null +++ b/test/api_access_records_test.go @@ -0,0 +1,166 @@ +/* +Authress + +Testing AccessRecordsAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package authress + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "//" +) + +func Test_authress_AccessRecordsAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test AccessRecordsAPIService CreateClaim", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.AccessRecordsAPI.CreateClaim(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test AccessRecordsAPIService CreateRecord", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.AccessRecordsAPI.CreateRecord(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test AccessRecordsAPIService CreateRequest", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.AccessRecordsAPI.CreateRequest(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test AccessRecordsAPIService DeleteRecord", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var recordId string + + httpRes, err := apiClient.AccessRecordsAPI.DeleteRecord(context.Background(), recordId).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test AccessRecordsAPIService DeleteRequest", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var requestId string + + httpRes, err := apiClient.AccessRecordsAPI.DeleteRequest(context.Background(), requestId).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test AccessRecordsAPIService GetRecord", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var recordId string + + resp, httpRes, err := apiClient.AccessRecordsAPI.GetRecord(context.Background(), recordId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test AccessRecordsAPIService GetRecords", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.AccessRecordsAPI.GetRecords(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test AccessRecordsAPIService GetRequest", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var requestId string + + resp, httpRes, err := apiClient.AccessRecordsAPI.GetRequest(context.Background(), requestId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test AccessRecordsAPIService GetRequests", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.AccessRecordsAPI.GetRequests(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test AccessRecordsAPIService RespondToAccessRequest", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var requestId string + + resp, httpRes, err := apiClient.AccessRecordsAPI.RespondToAccessRequest(context.Background(), requestId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test AccessRecordsAPIService UpdateRecord", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var recordId string + + httpRes, err := apiClient.AccessRecordsAPI.UpdateRecord(context.Background(), recordId).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_accounts_test.go b/test/api_accounts_test.go new file mode 100644 index 0000000..1226ee4 --- /dev/null +++ b/test/api_accounts_test.go @@ -0,0 +1,74 @@ +/* +Authress + +Testing AccountsAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package authress + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "//" +) + +func Test_authress_AccountsAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test AccountsAPIService DelegateAuthentication", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.AccountsAPI.DelegateAuthentication(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test AccountsAPIService GetAccount", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var accountId string + + resp, httpRes, err := apiClient.AccountsAPI.GetAccount(context.Background(), accountId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test AccountsAPIService GetAccountIdentities", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.AccountsAPI.GetAccountIdentities(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test AccountsAPIService GetAccounts", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.AccountsAPI.GetAccounts(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_applications_test.go b/test/api_applications_test.go new file mode 100644 index 0000000..abed5ad --- /dev/null +++ b/test/api_applications_test.go @@ -0,0 +1,40 @@ +/* +Authress + +Testing ApplicationsAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package authress + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "//" +) + +func Test_authress_ApplicationsAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test ApplicationsAPIService DelegateUserLogin", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var applicationId string + var userId UserId + + resp, httpRes, err := apiClient.ApplicationsAPI.DelegateUserLogin(context.Background(), applicationId, userId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_connections_test.go b/test/api_connections_test.go new file mode 100644 index 0000000..ad36f20 --- /dev/null +++ b/test/api_connections_test.go @@ -0,0 +1,105 @@ +/* +Authress + +Testing ConnectionsAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package authress + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "//" +) + +func Test_authress_ConnectionsAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test ConnectionsAPIService CreateConnection", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.ConnectionsAPI.CreateConnection(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ConnectionsAPIService DeleteConnection", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var connectionId string + + httpRes, err := apiClient.ConnectionsAPI.DeleteConnection(context.Background(), connectionId).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ConnectionsAPIService GetConnection", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var connectionId string + + resp, httpRes, err := apiClient.ConnectionsAPI.GetConnection(context.Background(), connectionId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ConnectionsAPIService GetConnectionCredentials", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var connectionId string + var userId UserId + + resp, httpRes, err := apiClient.ConnectionsAPI.GetConnectionCredentials(context.Background(), connectionId, userId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ConnectionsAPIService GetConnections", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.ConnectionsAPI.GetConnections(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ConnectionsAPIService UpdateConnection", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var connectionId string + + resp, httpRes, err := apiClient.ConnectionsAPI.UpdateConnection(context.Background(), connectionId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_extensions_test.go b/test/api_extensions_test.go new file mode 100644 index 0000000..51ac65a --- /dev/null +++ b/test/api_extensions_test.go @@ -0,0 +1,114 @@ +/* +Authress + +Testing ExtensionsAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package authress + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "//" +) + +func Test_authress_ExtensionsAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test ExtensionsAPIService CreateExtension", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.ExtensionsAPI.CreateExtension(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ExtensionsAPIService DeleteExtension", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var extensionId string + + httpRes, err := apiClient.ExtensionsAPI.DeleteExtension(context.Background(), extensionId).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ExtensionsAPIService GetExtension", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var extensionId string + + resp, httpRes, err := apiClient.ExtensionsAPI.GetExtension(context.Background(), extensionId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ExtensionsAPIService GetExtensions", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.ExtensionsAPI.GetExtensions(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ExtensionsAPIService Login", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.ExtensionsAPI.Login(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ExtensionsAPIService RequestToken", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.ExtensionsAPI.RequestToken(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ExtensionsAPIService UpdateExtension", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var extensionId string + + resp, httpRes, err := apiClient.ExtensionsAPI.UpdateExtension(context.Background(), extensionId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_groups_test.go b/test/api_groups_test.go new file mode 100644 index 0000000..2e09a9d --- /dev/null +++ b/test/api_groups_test.go @@ -0,0 +1,90 @@ +/* +Authress + +Testing GroupsAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package authress + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "//" +) + +func Test_authress_GroupsAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test GroupsAPIService CreateGroup", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.GroupsAPI.CreateGroup(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test GroupsAPIService DeleteGroup", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var groupId GroupId + + httpRes, err := apiClient.GroupsAPI.DeleteGroup(context.Background(), groupId).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test GroupsAPIService GetGroup", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var groupId GroupId + + resp, httpRes, err := apiClient.GroupsAPI.GetGroup(context.Background(), groupId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test GroupsAPIService GetGroups", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.GroupsAPI.GetGroups(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test GroupsAPIService UpdateGroup", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var groupId GroupId + + resp, httpRes, err := apiClient.GroupsAPI.UpdateGroup(context.Background(), groupId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_invites_test.go b/test/api_invites_test.go new file mode 100644 index 0000000..f69adfe --- /dev/null +++ b/test/api_invites_test.go @@ -0,0 +1,78 @@ +/* +Authress + +Testing InvitesAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package authress + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "//" +) + +func Test_authress_InvitesAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test InvitesAPIService CreateInvite", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.InvitesAPI.CreateInvite(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test InvitesAPIService DeleteInvite", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var inviteId string + + httpRes, err := apiClient.InvitesAPI.DeleteInvite(context.Background(), inviteId).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test InvitesAPIService GetInvite", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var inviteId string + + resp, httpRes, err := apiClient.InvitesAPI.GetInvite(context.Background(), inviteId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test InvitesAPIService RespondToInvite", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var inviteId string + + resp, httpRes, err := apiClient.InvitesAPI.RespondToInvite(context.Background(), inviteId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_resource_permissions_test.go b/test/api_resource_permissions_test.go new file mode 100644 index 0000000..d3855dd --- /dev/null +++ b/test/api_resource_permissions_test.go @@ -0,0 +1,78 @@ +/* +Authress + +Testing ResourcePermissionsAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package authress + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "//" +) + +func Test_authress_ResourcePermissionsAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test ResourcePermissionsAPIService GetPermissionedResource", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var resourceUri string + + resp, httpRes, err := apiClient.ResourcePermissionsAPI.GetPermissionedResource(context.Background(), resourceUri).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ResourcePermissionsAPIService GetPermissionedResources", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.ResourcePermissionsAPI.GetPermissionedResources(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ResourcePermissionsAPIService GetResourceUsers", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var resourceUri string + + resp, httpRes, err := apiClient.ResourcePermissionsAPI.GetResourceUsers(context.Background(), resourceUri).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ResourcePermissionsAPIService UpdatePermissionedResource", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var resourceUri string + + httpRes, err := apiClient.ResourcePermissionsAPI.UpdatePermissionedResource(context.Background(), resourceUri).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_roles_test.go b/test/api_roles_test.go new file mode 100644 index 0000000..7470d7f --- /dev/null +++ b/test/api_roles_test.go @@ -0,0 +1,90 @@ +/* +Authress + +Testing RolesAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package authress + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "//" +) + +func Test_authress_RolesAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test RolesAPIService CreateRole", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.RolesAPI.CreateRole(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test RolesAPIService DeleteRole", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var roleId string + + httpRes, err := apiClient.RolesAPI.DeleteRole(context.Background(), roleId).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test RolesAPIService GetRole", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var roleId string + + resp, httpRes, err := apiClient.RolesAPI.GetRole(context.Background(), roleId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test RolesAPIService GetRoles", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.RolesAPI.GetRoles(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test RolesAPIService UpdateRole", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var roleId string + + resp, httpRes, err := apiClient.RolesAPI.UpdateRole(context.Background(), roleId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_service_clients_test.go b/test/api_service_clients_test.go new file mode 100644 index 0000000..e51441f --- /dev/null +++ b/test/api_service_clients_test.go @@ -0,0 +1,118 @@ +/* +Authress + +Testing ServiceClientsAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package authress + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "//" +) + +func Test_authress_ServiceClientsAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test ServiceClientsAPIService CreateClient", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.ServiceClientsAPI.CreateClient(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ServiceClientsAPIService DeleteAccessKey", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var clientId string + var keyId string + + httpRes, err := apiClient.ServiceClientsAPI.DeleteAccessKey(context.Background(), clientId, keyId).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ServiceClientsAPIService DeleteClient", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var clientId string + + httpRes, err := apiClient.ServiceClientsAPI.DeleteClient(context.Background(), clientId).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ServiceClientsAPIService GetClient", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var clientId string + + resp, httpRes, err := apiClient.ServiceClientsAPI.GetClient(context.Background(), clientId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ServiceClientsAPIService GetClients", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.ServiceClientsAPI.GetClients(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ServiceClientsAPIService RequestAccessKey", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var clientId string + + resp, httpRes, err := apiClient.ServiceClientsAPI.RequestAccessKey(context.Background(), clientId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ServiceClientsAPIService UpdateClient", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var clientId string + + resp, httpRes, err := apiClient.ServiceClientsAPI.UpdateClient(context.Background(), clientId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_tenants_test.go b/test/api_tenants_test.go new file mode 100644 index 0000000..a25daf3 --- /dev/null +++ b/test/api_tenants_test.go @@ -0,0 +1,90 @@ +/* +Authress + +Testing TenantsAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package authress + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "//" +) + +func Test_authress_TenantsAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test TenantsAPIService CreateTenant", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.TenantsAPI.CreateTenant(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test TenantsAPIService DeleteTenant", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var tenantId TenantId + + httpRes, err := apiClient.TenantsAPI.DeleteTenant(context.Background(), tenantId).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test TenantsAPIService GetTenant", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var tenantId TenantId + + resp, httpRes, err := apiClient.TenantsAPI.GetTenant(context.Background(), tenantId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test TenantsAPIService GetTenants", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.TenantsAPI.GetTenants(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test TenantsAPIService UpdateTenant", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var tenantId TenantId + + resp, httpRes, err := apiClient.TenantsAPI.UpdateTenant(context.Background(), tenantId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_user_permissions_test.go b/test/api_user_permissions_test.go new file mode 100644 index 0000000..70d1505 --- /dev/null +++ b/test/api_user_permissions_test.go @@ -0,0 +1,84 @@ +/* +Authress + +Testing UserPermissionsAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package authress + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "//" +) + +func Test_authress_UserPermissionsAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test UserPermissionsAPIService AuthorizeUser", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var userId UserId + var resourceUri string + var permission Action + + httpRes, err := apiClient.UserPermissionsAPI.AuthorizeUser(context.Background(), userId, resourceUri, permission).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test UserPermissionsAPIService GetUserPermissionsForResource", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var userId UserId + var resourceUri string + + resp, httpRes, err := apiClient.UserPermissionsAPI.GetUserPermissionsForResource(context.Background(), userId, resourceUri).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test UserPermissionsAPIService GetUserResources", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var userId UserId + + resp, httpRes, err := apiClient.UserPermissionsAPI.GetUserResources(context.Background(), userId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test UserPermissionsAPIService GetUserRolesForResource", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var userId UserId + var resourceUri string + + resp, httpRes, err := apiClient.UserPermissionsAPI.GetUserRolesForResource(context.Background(), userId, resourceUri).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_users_test.go b/test/api_users_test.go new file mode 100644 index 0000000..d93e44d --- /dev/null +++ b/test/api_users_test.go @@ -0,0 +1,64 @@ +/* +Authress + +Testing UsersAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package authress + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "//" +) + +func Test_authress_UsersAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test UsersAPIService DeleteUser", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var userId UserId + + httpRes, err := apiClient.UsersAPI.DeleteUser(context.Background(), userId).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test UsersAPIService GetUser", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var userId UserId + + resp, httpRes, err := apiClient.UsersAPI.GetUser(context.Background(), userId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test UsersAPIService GetUsers", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.UsersAPI.GetUsers(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +}