Skip to content

Commit

Permalink
Regenerate OpenAPI Client
Browse files Browse the repository at this point in the history
  • Loading branch information
xylo04 committed Jan 20, 2025
1 parent 583b757 commit 24eca92
Show file tree
Hide file tree
Showing 28 changed files with 2,037 additions and 597 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/assign_pr.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Auto Assign'
name: "Auto Assign"
on:
pull_request:
types: [opened, ready_for_review]
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ _testmain.go
# IDE files
*.iml
.idea/

.travis.yml
git_push.sh
5 changes: 0 additions & 5 deletions .openapi-generator-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,5 @@
# 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.

go.mod
git_push.sh
.gitignore
.travis.yml
client.go
16 changes: 16 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.travis.yml
README.md
api/openapi.yaml
api_default.go
client.go
configuration.go
docs/DefaultAPI.md
docs/Request.md
docs/Response.md
git_push.sh
go.mod
go.sum
model_request.go
model_response.go
response.go
utils.go
2 changes: 1 addition & 1 deletion .openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.3.1
7.10.0
201 changes: 0 additions & 201 deletions LICENSE

This file was deleted.

138 changes: 123 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,127 @@
[![PkgGoDev](https://pkg.go.dev/badge/github.com/k0swe/qrz-logbook)](https://pkg.go.dev/github.com/k0swe/qrz-logbook)
[![Go Report Card](https://goreportcard.com/badge/github.com/k0swe/qrz-logbook)](https://goreportcard.com/report/github.com/k0swe/qrz-logbook)
# Go API client for qrzlog

# Go API client for QRZ.com Logbook
This API provides methods for external programs to interact with the QRZ Logbook
using an HTTP REST interface. The QRZ Logbook is a combination free and paid
subscription service of QRZ. Some advanced features require a valid subscription
while the majority of operations are free to all QRZ members. All users of the
QRZ Logbook, regardless of their subscription status, may access, edit, update,
and view their complete logs online at the QRZ website.

A GoLang client library for QRZ.com's Logbook data service. The service
provides real-time access to information from QRZ.com logbooks. The API is
documented [here](https://www.qrz.com/docs/logbook/QRZLogbookAPI.html).
## Overview

This client library was generated based on the OpenAPI specification in
the `api/openapi.yaml` file. However, the API itself is not well-described by
OpenAPI, so the generated library is supplemented with `wrapper.go`.
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.

A simple application to demonstrate how to integrate the library is located in
`cmd/qrz-logbook/main.go`.

A QRZ.com XML subscription is required to take full advantage of the API. A
description of subscription plans and rates is available on the
[QRZ.com website](http://www.qrz.com/i/subscriptions.html).
- API version: 1.0.0
- Package version: 1.0.0
- Generator version: 7.10.0
- Build package: org.openapitools.codegen.languages.GoClientCodegen

## Installation

Install the following dependencies:

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

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

```go
import qrzlog "github.com/k0swe/qrz-logbook"
```

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

```go
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
`qrzlog.ContextServerIndex` of type `int`.

```go
ctx := context.WithValue(context.Background(), qrzlog.ContextServerIndex, 1)
```

### Templated Server URL

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

```go
ctx := context.WithValue(context.Background(), qrzlog.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 identified by
`"{classname}Service.{nickname}"` string. Similar rules for overriding default
operation server index and variables applies by using
`qrzlog.ContextOperationServerIndices` and
`qrzlog.ContextOperationServerVariables` context maps.

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

## Documentation for API Endpoints

All URIs are relative to *https://logbook.qrz.com/api*

| Class | Method | HTTP request | Description |
| ------------ | ------------------------------------------- | ------------ | -------------------------- |
| _DefaultAPI_ | [**RootPost**](docs/DefaultAPI.md#rootpost) | **Post** / | The do-everything endpoint |

## Documentation For Models

- [Request](docs/Request.md)
- [Response](docs/Response.md)

## Documentation For Authorization

Endpoints do not require authorization.

## 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

[email protected]
2 changes: 2 additions & 0 deletions api/openapi-config.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
packageName: qrzlog
withGoCodegenComment: true
globalProperties:
skipFormModel: false
Loading

0 comments on commit 24eca92

Please sign in to comment.