https://github.com/xr1337/appstoreconnect-openapi-go
Contains generated Golang client code ( based on OpenAPI 3 specifications ) for Apple AppStore Connect API
https://github.com/xr1337/appstoreconnect-openapi-go
apple appstoreconnect appstoreconnectapi golang openapi
Last synced: 5 months ago
JSON representation
Contains generated Golang client code ( based on OpenAPI 3 specifications ) for Apple AppStore Connect API
- Host: GitHub
- URL: https://github.com/xr1337/appstoreconnect-openapi-go
- Owner: xr1337
- Created: 2020-07-30T05:22:08.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-30T08:29:24.000Z (almost 6 years ago)
- Last Synced: 2024-06-20T01:50:34.220Z (about 2 years ago)
- Topics: apple, appstoreconnect, appstoreconnectapi, golang, openapi
- Language: Go
- Homepage:
- Size: 327 KB
- Stars: 16
- Watchers: 2
- Forks: 11
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AppStoreConnect-OpenApi-Go
This is a generated Go project for Apple's [App Store Connect API](https://developer.apple.com/documentation/appstoreconnectapi).
Apple provided an OpenAPI
[downloable specification](https://developer.apple.com/sample-code/app-store-connect/app-store-connect-openapi-specification.zip) which allows use to generate client api codes.
Client code generation was done with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator)
## Motivation
When I was generating the code for my own use, I experienced some difficulties with OpenAPI Generator.
After fixing all the bugs, I thought it would be helpful to share this generated code with others.
Thus I would appreciate a star if this project is useful to you.
## Installation
Add the generated code to your project
```bash
go get github.com/xr1337/appstoreconnect-openapi-go/generated
```
## Usage
Heres a non-production recommended code to test the API out
```golang
import api "github.com/xr1337/appstoreconnect-openapi-go/generated"
func main() {
cfg := api.NewConfiguration()
auth := context.WithValue(context.Background(), api.ContextAccessToken, signedToken)
client := api.NewAPIClient(cfg)
response, _, _ := client.UsersApi.UsersGetCollection(auth, nil)
for _, user := range response.Data {
fmt.Println(user.Attributes.Username)
}
}
```
Checkout out the [example folder](https://github.com/xr1337/appstoreconnect-openapi-go/tree/master/example) for more examples ( includes reading Apples .p8 file )
Alternatively, OpenAPI generates a README.md file ([View here](https://github.com/xr1337/appstoreconnect-openapi-go/blob/master/generated/README.md)) to see what APIs that you can use
## Regenerate
The Makefile comes with a example docker command to regenerate the project.
Requirements: [docker](https://www.docker.com/get-started)
```bash
make generate
```
The output will generate a new folder called `out`.
You may want to remove the generated go.mod and go.sum files.
## License
[MIT](https://choosealicense.com/licenses/mit/)