### Install mittwald API Golang Client Source: https://github.com/mittwald/api-client-go/blob/master/README.md Installs the mittwald API Golang client package using the go get command. This is the standard method for adding Go dependencies. ```bash go get github.com/mittwald/api-client-go ``` -------------------------------- ### List Projects Example Source: https://github.com/mittwald/api-client-go/blob/master/README.md Provides a practical example of using the mittwald API client to list projects. It shows how to construct a request object and iterate over the returned projects. ```go req := projectclientv2.ListProjectsRequest{ CustomerID: pointer.To("2ef23459-beb1-4ac2-9a38-d3a9df62bf93"), Limit: pointer.To(100), } projects, res, err := client.Projects().ListProjects(ctx, req) for _, project := range projects { fmt.Println(project.ShortId) } ``` -------------------------------- ### Initialize mittwald API Client (v2) Source: https://github.com/mittwald/api-client-go/blob/master/README.md Demonstrates how to initialize the mittwald API client for version 2. It shows setting up a background context and authenticating using an access token retrieved from environment variables. ```go ctx := context.Background() token := os.Getenv("MITTWALD_API_TOKEN") client, err := mittwaldv2.New(ctx, mittwaldv2.WithAccessToken(token)) if err != nil { panic(err) } ``` -------------------------------- ### Handle API Errors with errors.As Source: https://github.com/mittwald/api-client-go/blob/master/README.md Illustrates how to check for specific API error types returned by client calls. It uses Go's errors.As to identify validation errors or other common HTTP errors. ```go projects, res, err := client.Projects().ListProjects(ctx, req) if validationError := new(httperr.ErrValidation); errors.As(err, &validationError) { // Handle validation error } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.