This is a generated Go project for Apple's App Store Connect API.
Apple provided an OpenAPI downloable specification which allows use to generate client api codes.
Client code generation was done with OpenAPI Generator
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.
Add the generated code to your project
go get github.com/xr1337/appstoreconnect-openapi-go/generated
Heres a non-production recommended code to test the API out
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 for more examples ( includes reading Apples .p8 file )
Alternatively, OpenAPI generates a README.md file (View here) to see what APIs that you can use
The Makefile comes with a example docker command to regenerate the project. Requirements: docker
make generate
The output will generate a new folder called out
.
You may want to remove the generated go.mod and go.sum files.