Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] Change client validation of permissions revoke type #42

Merged
merged 2 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- name: Check out the code
- name: Check out the code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
Expand All @@ -25,7 +25,7 @@ jobs:
name: Acceptance Tests
runs-on: ubuntu-latest
steps:
- name: Check out the code
- name: Check out the code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
Expand All @@ -39,7 +39,7 @@ jobs:
name: Checks
runs-on: ubuntu-latest
steps:
- name: Check out the code
- name: Check out the code
uses: actions/checkout@v4

- name: Set up Go
Expand All @@ -48,6 +48,11 @@ jobs:
go-version-file: go.mod
check-latest: true

- name: Setup Terraform with specified version on the runner
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why this started breaking, but we get a complaint about missing terraform binary, so I added a step to install it.

uses: hashicorp/setup-terraform@v2
with:
terraform_wrapper: false

- name: Check the docs are up to date
run: make check-docs

Expand Down
2 changes: 2 additions & 0 deletions internal/sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ See https://github.com/OpenAPITools/openapi-generator/issues/741 for more detail

NOTE: To make the client work with our API, I had to manually update `openAPISpec.json` in quite a few places. So, I'd recommend manually copying the fragment of the spec that you need into the file instead of trying to replace the file completely.

One of these is for the imprecise conversion of zod discriminated unions (used internally) to openapi - instead of `oneOf` schemas, `anyOf` is more accurate for nested object types.

## Generate client library code
Just run `go generate` in this folder. All generated code lives in the `api` folder.
Command line parameters for `openapi-generator` invocation are controlled via `generate.go` file.
Expand Down
8 changes: 4 additions & 4 deletions internal/sdk/api/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ docs/PermissionsListObjectsPostRequestSubjectOneOf.md
docs/PermissionsListObjectsPostRequestSubjectOneOf1.md
docs/PermissionsRevokePost200Response.md
docs/PermissionsRevokePost200ResponseDataInner.md
docs/PermissionsRevokePost200ResponseDataInnerOneOf.md
docs/PermissionsRevokePost200ResponseDataInnerOneOf1.md
docs/PermissionsRevokePost200ResponseDataInnerAnyOf.md
docs/PermissionsRevokePost200ResponseDataInnerAnyOf1.md
docs/PermissionsRevokePostRequest.md
docs/PostgresOptions.md
docs/PostgresOptionsDatabaseOptions.md
Expand Down Expand Up @@ -407,8 +407,8 @@ model__permissions_list_objects_post_request_subject_one_of.go
model__permissions_list_objects_post_request_subject_one_of_1.go
model__permissions_revoke_post_200_response.go
model__permissions_revoke_post_200_response_data_inner.go
model__permissions_revoke_post_200_response_data_inner_one_of.go
model__permissions_revoke_post_200_response_data_inner_one_of_1.go
model__permissions_revoke_post_200_response_data_inner_any_of.go
model__permissions_revoke_post_200_response_data_inner_any_of_1.go
model__permissions_revoke_post_request.go
model__resource_configurations__configuration_id__get_200_response.go
model__resource_configurations_get_200_response.go
Expand Down
4 changes: 2 additions & 2 deletions internal/sdk/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,8 @@ Class | Method | HTTP request | Description
- [PermissionsListObjectsPostRequestSubjectOneOf1](docs/PermissionsListObjectsPostRequestSubjectOneOf1.md)
- [PermissionsRevokePost200Response](docs/PermissionsRevokePost200Response.md)
- [PermissionsRevokePost200ResponseDataInner](docs/PermissionsRevokePost200ResponseDataInner.md)
- [PermissionsRevokePost200ResponseDataInnerOneOf](docs/PermissionsRevokePost200ResponseDataInnerOneOf.md)
- [PermissionsRevokePost200ResponseDataInnerOneOf1](docs/PermissionsRevokePost200ResponseDataInnerOneOf1.md)
- [PermissionsRevokePost200ResponseDataInnerAnyOf](docs/PermissionsRevokePost200ResponseDataInnerAnyOf.md)
- [PermissionsRevokePost200ResponseDataInnerAnyOf1](docs/PermissionsRevokePost200ResponseDataInnerAnyOf1.md)
- [PermissionsRevokePostRequest](docs/PermissionsRevokePostRequest.md)
- [PostgresOptions](docs/PostgresOptions.md)
- [PostgresOptionsDatabaseOptions](docs/PostgresOptionsDatabaseOptions.md)
Expand Down
10 changes: 5 additions & 5 deletions internal/sdk/api/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7613,7 +7613,7 @@ components:
- object
- subject
type: object
_permissions_revoke_post_200_response_data_inner_oneOf:
_permissions_revoke_post_200_response_data_inner_anyOf:
example:
access_level: own
id: id
Expand All @@ -7639,7 +7639,7 @@ components:
- id
- type
type: object
_permissions_revoke_post_200_response_data_inner_oneOf_1:
_permissions_revoke_post_200_response_data_inner_anyOf_1:
properties:
type:
enum:
Expand All @@ -7662,9 +7662,9 @@ components:
- type
type: object
_permissions_revoke_post_200_response_data_inner:
oneOf:
- $ref: '#/components/schemas/_permissions_revoke_post_200_response_data_inner_oneOf'
- $ref: '#/components/schemas/_permissions_revoke_post_200_response_data_inner_oneOf_1'
anyOf:
- $ref: '#/components/schemas/_permissions_revoke_post_200_response_data_inner_anyOf'
- $ref: '#/components/schemas/_permissions_revoke_post_200_response_data_inner_anyOf_1'
- $ref: '#/components/schemas/_permissions_listObjects_post_200_response_data_inner_oneOf'
_permissions_revoke_post_200_response:
example:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# PermissionsRevokePost200ResponseDataInnerAnyOf

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Type** | **string** | |
**Id** | **string** | The id of the folder |
**AccessLevel** | **string** | The access level of the folder |

## Methods

### NewPermissionsRevokePost200ResponseDataInnerAnyOf

`func NewPermissionsRevokePost200ResponseDataInnerAnyOf(type_ string, id string, accessLevel string, ) *PermissionsRevokePost200ResponseDataInnerAnyOf`

NewPermissionsRevokePost200ResponseDataInnerAnyOf instantiates a new PermissionsRevokePost200ResponseDataInnerAnyOf 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

### NewPermissionsRevokePost200ResponseDataInnerAnyOfWithDefaults

`func NewPermissionsRevokePost200ResponseDataInnerAnyOfWithDefaults() *PermissionsRevokePost200ResponseDataInnerAnyOf`

NewPermissionsRevokePost200ResponseDataInnerAnyOfWithDefaults instantiates a new PermissionsRevokePost200ResponseDataInnerAnyOf 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 *PermissionsRevokePost200ResponseDataInnerAnyOf) GetType() string`

GetType returns the Type field if non-nil, zero value otherwise.

### GetTypeOk

`func (o *PermissionsRevokePost200ResponseDataInnerAnyOf) 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 *PermissionsRevokePost200ResponseDataInnerAnyOf) SetType(v string)`

SetType sets Type field to given value.


### GetId

`func (o *PermissionsRevokePost200ResponseDataInnerAnyOf) GetId() string`

GetId returns the Id field if non-nil, zero value otherwise.

### GetIdOk

`func (o *PermissionsRevokePost200ResponseDataInnerAnyOf) GetIdOk() (*string, bool)`

GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetId

`func (o *PermissionsRevokePost200ResponseDataInnerAnyOf) SetId(v string)`

SetId sets Id field to given value.


### GetAccessLevel

`func (o *PermissionsRevokePost200ResponseDataInnerAnyOf) GetAccessLevel() string`

GetAccessLevel returns the AccessLevel field if non-nil, zero value otherwise.

### GetAccessLevelOk

`func (o *PermissionsRevokePost200ResponseDataInnerAnyOf) GetAccessLevelOk() (*string, bool)`

GetAccessLevelOk returns a tuple with the AccessLevel field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetAccessLevel

`func (o *PermissionsRevokePost200ResponseDataInnerAnyOf) SetAccessLevel(v string)`

SetAccessLevel sets AccessLevel 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)


Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# PermissionsRevokePost200ResponseDataInnerAnyOf1

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Type** | **string** | |
**Id** | **string** | The app ID. |
**AccessLevel** | **string** | The access level of the app |

## Methods

### NewPermissionsRevokePost200ResponseDataInnerAnyOf1

`func NewPermissionsRevokePost200ResponseDataInnerAnyOf1(type_ string, id string, accessLevel string, ) *PermissionsRevokePost200ResponseDataInnerAnyOf1`

NewPermissionsRevokePost200ResponseDataInnerAnyOf1 instantiates a new PermissionsRevokePost200ResponseDataInnerAnyOf1 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

### NewPermissionsRevokePost200ResponseDataInnerAnyOf1WithDefaults

`func NewPermissionsRevokePost200ResponseDataInnerAnyOf1WithDefaults() *PermissionsRevokePost200ResponseDataInnerAnyOf1`

NewPermissionsRevokePost200ResponseDataInnerAnyOf1WithDefaults instantiates a new PermissionsRevokePost200ResponseDataInnerAnyOf1 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 *PermissionsRevokePost200ResponseDataInnerAnyOf1) GetType() string`

GetType returns the Type field if non-nil, zero value otherwise.

### GetTypeOk

`func (o *PermissionsRevokePost200ResponseDataInnerAnyOf1) 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 *PermissionsRevokePost200ResponseDataInnerAnyOf1) SetType(v string)`

SetType sets Type field to given value.


### GetId

`func (o *PermissionsRevokePost200ResponseDataInnerAnyOf1) GetId() string`

GetId returns the Id field if non-nil, zero value otherwise.

### GetIdOk

`func (o *PermissionsRevokePost200ResponseDataInnerAnyOf1) GetIdOk() (*string, bool)`

GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetId

`func (o *PermissionsRevokePost200ResponseDataInnerAnyOf1) SetId(v string)`

SetId sets Id field to given value.


### GetAccessLevel

`func (o *PermissionsRevokePost200ResponseDataInnerAnyOf1) GetAccessLevel() string`

GetAccessLevel returns the AccessLevel field if non-nil, zero value otherwise.

### GetAccessLevelOk

`func (o *PermissionsRevokePost200ResponseDataInnerAnyOf1) GetAccessLevelOk() (*string, bool)`

GetAccessLevelOk returns a tuple with the AccessLevel field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetAccessLevel

`func (o *PermissionsRevokePost200ResponseDataInnerAnyOf1) SetAccessLevel(v string)`

SetAccessLevel sets AccessLevel 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)


Loading
Loading