Code Monkey home page Code Monkey logo

appstoreconnect-openapi-go's Introduction

AppStoreConnect-OpenApi-Go

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

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

go get github.com/xr1337/appstoreconnect-openapi-go/generated

Usage

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

Regenerate

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.

License

MIT

appstoreconnect-openapi-go's People

Contributors

xr1337 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

appstoreconnect-openapi-go's Issues

[GO] Regenreated struct element with 'OneOf' prefix

Description:
after 'make' , generated struct element with 'OneOf' prefix

Code git hash:
afc4192

Command line used for generation:
make

Example
appstoreconnect-openapi-go/out/model_bundle_ids_response.go:18

*[]OneOfProfileBundleIdCapabilityApp

// BundleIdsResponse struct for BundleIdsResponse
type BundleIdsResponse struct {
	Data []BundleId `json:"data"`
	Included *[]OneOfProfileBundleIdCapabilityApp `json:"included,omitempty"`
	Links PagedDocumentLinks `json:"links"`
	Meta *PagingInformation `json:"meta,omitempty"`
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.