Skip to content

Commit

Permalink
fix: initial code for generated API
Browse files Browse the repository at this point in the history
  • Loading branch information
wtrocki committed Mar 1, 2022
1 parent aba7ea4 commit 47c251c
Show file tree
Hide file tree
Showing 45 changed files with 11,357 additions and 0 deletions.
24 changes: 24 additions & 0 deletions serviceaccounts/apiv1internal/client/.gitignore
Original file line number Diff line number Diff line change
@@ -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
43 changes: 43 additions & 0 deletions serviceaccounts/apiv1internal/client/.openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
.gitignore
README.md
api/openapi.yaml
api_service_accounts.go
api_serviceaccounts.go
client.go
configuration.go
docs/Error.md
docs/InlineResponse400.md
docs/InlineResponse400Cause.md
docs/InlineResponse400CauseStackTrace.md
docs/InlineResponse400CauseSuppressed.md
docs/InlineResponse400Response.md
docs/InlineResponse400ResponseCookies.md
docs/InlineResponse400ResponseEntityTag.md
docs/InlineResponse400ResponseLanguage.md
docs/InlineResponse400ResponseLinks.md
docs/InlineResponse400ResponseMediaType.md
docs/InlineResponse400ResponseStatusInfo.md
docs/InlineResponse401.md
docs/ServiceAccountCreateRequestData.md
docs/ServiceAccountData.md
docs/ServiceAccountRequestData.md
docs/ServiceAccountsApi.md
docs/ServiceaccountsApi.md
model_error.go
model_inline_response_400.go
model_inline_response_400_cause.go
model_inline_response_400_cause_stack_trace.go
model_inline_response_400_cause_suppressed.go
model_inline_response_400_response.go
model_inline_response_400_response_cookies.go
model_inline_response_400_response_entity_tag.go
model_inline_response_400_response_language.go
model_inline_response_400_response_links.go
model_inline_response_400_response_media_type.go
model_inline_response_400_response_status_info.go
model_inline_response_401.go
model_service_account_create_request_data.go
model_service_account_data.go
model_service_account_request_data.go
response.go
utils.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5.2.0
144 changes: 144 additions & 0 deletions serviceaccounts/apiv1internal/client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
# Go API client for serviceaccountsclient

This is the API documentation for Service Accounts

## Overview
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client.

- API version: 1.0
- Package version: 1.0.0
- Build package: org.openapitools.codegen.languages.GoClientCodegen

## Installation

Install the following dependencies:

```shell
go get github.com/stretchr/testify/assert
go get golang.org/x/oauth2
go get golang.org/x/net/context
```

Put the package under your project folder and add the following in import:

```golang
import sw "./serviceaccountsclient"
```

To use a proxy, set the environment variable `HTTP_PROXY`:

```golang
os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")
```

## Configuration of Server URL

Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification.

### Select Server Configuration

For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`.

```golang
ctx := context.WithValue(context.Background(), sw.ContextServerIndex, 1)
```

### Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`.

```golang
ctx := context.WithValue(context.Background(), sw.ContextServerVariables, map[string]string{
"basePath": "v2",
})
```

Note, enum values are always validated and all unused variables are silently ignored.

### URLs Configuration per Operation

Each operation can use different server URL defined using `OperationServers` map in the `Configuration`.
An operation is uniquely identifield by `"{classname}Service.{nickname}"` string.
Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps.

```
ctx := context.WithValue(context.Background(), sw.ContextOperationServerIndices, map[string]int{
"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), sw.ContextOperationServerVariables, map[string]map[string]string{
"{classname}Service.{nickname}": {
"port": "8443",
},
})
```

## Documentation for API Endpoints

All URIs are relative to *http://localhost*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*ServiceAccountsApi* | [**CreateServiceAccount**](docs/ServiceAccountsApi.md#createserviceaccount) | **Post** /apis/service_accounts/v1 | Create service account
*ServiceAccountsApi* | [**DeleteServiceAccount**](docs/ServiceAccountsApi.md#deleteserviceaccount) | **Delete** /apis/service_accounts/v1/{id} | Delete service account by id
*ServiceAccountsApi* | [**GetServiceAccounts**](docs/ServiceAccountsApi.md#getserviceaccounts) | **Get** /apis/service_accounts/v1 | List all service accounts
*ServiceAccountsApi* | [**UpdateServiceAccount**](docs/ServiceAccountsApi.md#updateserviceaccount) | **Patch** /apis/service_accounts/v1/{id} | Update service account
*ServiceaccountsApi* | [**GetServiceAccount**](docs/ServiceaccountsApi.md#getserviceaccount) | **Get** /apis/service_accounts/v1/{id} | Get service account by id
*ServiceaccountsApi* | [**ResetServiceAccountSecret**](docs/ServiceaccountsApi.md#resetserviceaccountsecret) | **Post** /apis/service_accounts/v1/{id}/resetSecret | Reset service account secret by id


## Documentation For Models

- [Error](docs/Error.md)
- [InlineResponse400](docs/InlineResponse400.md)
- [InlineResponse400Cause](docs/InlineResponse400Cause.md)
- [InlineResponse400CauseStackTrace](docs/InlineResponse400CauseStackTrace.md)
- [InlineResponse400CauseSuppressed](docs/InlineResponse400CauseSuppressed.md)
- [InlineResponse400Response](docs/InlineResponse400Response.md)
- [InlineResponse400ResponseCookies](docs/InlineResponse400ResponseCookies.md)
- [InlineResponse400ResponseEntityTag](docs/InlineResponse400ResponseEntityTag.md)
- [InlineResponse400ResponseLanguage](docs/InlineResponse400ResponseLanguage.md)
- [InlineResponse400ResponseLinks](docs/InlineResponse400ResponseLinks.md)
- [InlineResponse400ResponseMediaType](docs/InlineResponse400ResponseMediaType.md)
- [InlineResponse400ResponseStatusInfo](docs/InlineResponse400ResponseStatusInfo.md)
- [InlineResponse401](docs/InlineResponse401.md)
- [ServiceAccountCreateRequestData](docs/ServiceAccountCreateRequestData.md)
- [ServiceAccountData](docs/ServiceAccountData.md)
- [ServiceAccountRequestData](docs/ServiceAccountRequestData.md)


## Documentation For Authorization



### bearerAuth

- **Type**: HTTP Bearer token authentication

Example

```golang
auth := context.WithValue(context.Background(), sw.ContextAccessToken, "BEARERTOKENSTRING")
r, err := client.Service.Operation(auth, args)
```


## Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains
a number of utility functions to easily obtain pointers to values of basic types.
Each of these functions takes a value of the given basic type and returns a pointer to it:

* `PtrBool`
* `PtrInt`
* `PtrInt32`
* `PtrInt64`
* `PtrFloat`
* `PtrFloat32`
* `PtrFloat64`
* `PtrString`
* `PtrTime`

## Author



Loading

0 comments on commit 47c251c

Please sign in to comment.