github.com/phrase/openapi@v0.0.0-20240514140800-49e8a106740e/openapi-generator/templates/go/README.mustache (about)

     1  # Go API client for {{packageName}}
     2  
     3  Phrase Strings is a translation management platform for software projects. You can collaborate on language file translation with your team or order translations through our platform. The API allows you to import locale files, download locale files, tag keys or interact in other ways with the localization data stored in Phrase Strings for your account.
     4  
     5  ## Installation
     6  
     7  ```shell
     8  go get github.com/phrase/phrase-go/v3 {{! x-release-please-major }}
     9  ```
    10  
    11  ## Getting Started
    12  
    13  ```golang
    14  package main
    15  
    16  import (
    17  	"context"
    18  	"fmt"
    19  
    20  	phrase "github.com/phrase/phrase-go/v3" {{! x-release-please-major }}
    21  )
    22  
    23  func main() {
    24  	auth := context.WithValue(context.Background(), phrase.ContextAPIKey, phrase.APIKey{
    25  		Key:    "YOUR_API_TOKEN",
    26  		Prefix: "token",
    27  	})
    28  
    29  	cfg := phrase.NewConfiguration()
    30  	client := phrase.NewAPIClient(cfg)
    31  
    32  	var projectsListOpts phrase.ProjectsListOpts
    33  
    34  	projects, apiResponse, err := client.ProjectsApi.ProjectsList(auth, &projectsListOpts)
    35  	if err != nil {
    36  		fmt.Println(err)
    37  	} else {
    38  		fmt.Printf("%+v\n", projects)
    39  		fmt.Printf("%+v\n", apiResponse) // &{Response:0xc00011ccf0 NextPage:2 FirstPage:1 LastPage:4 Rate:{Limit:1000 Remaining:998 Reset:2020-04-25 00:35:00 +0200 CEST}}
    40  	}
    41  }
    42  ```
    43  
    44  ## Datacenters
    45  
    46  The API is only accessible via HTTPS and the current version is <code>v2</code>, which results in a base URL like: <code>{{{basePath}}}</code> depending on the datacenter.
    47  
    48  ### EU Datacenter
    49  ```
    50  {{{basePath}}}
    51  ```
    52  
    53  This is the default datacenter.
    54  
    55  ### US Datacenter
    56  ```
    57  https://api.us.app.phrase.com/v2/
    58  ```
    59  
    60  ### Specifying US Datacenter
    61  You can use the US datacenter by setting the following:
    62  ```
    63  client.ChangeBasePath("https://api.us.app.phrase.com/v2/")
    64  ```
    65  
    66  ## Documentation for API Endpoints
    67  
    68  All URIs are relative to *{{basePath}}*
    69  
    70  Class | Method | HTTP request | Description
    71  ------------ | ------------- | ------------- | -------------
    72  {{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}}
    73  {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}
    74  
    75  ## Documentation For Models
    76  
    77  {{#models}}{{#model}} - [{{{classname}}}]({{modelDocPath}}{{{classname}}}.md)
    78  {{/model}}{{/models}}
    79  
    80  ## More Information
    81  This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
    82  
    83  - API version: {{appVersion}}
    84  - Package version: {{packageVersion}}
    85  {{^hideGenerationTimestamp}}
    86  - Build date: {{generatedDate}}
    87  {{/hideGenerationTimestamp}}
    88  - Build package: {{generatorClass}}
    89  {{#infoUrl}}
    90  For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
    91  {{/infoUrl}}
    92  
    93  ## Author
    94  
    95  {{#apiInfo}}{{#apis}}{{^-last}}{{infoEmail}}
    96  {{/-last}}{{/apis}}{{/apiInfo}}
    97  
    98  ## Get help / support
    99  
   100  Please contact [support@phrase.com](mailto:support@phrase.com?subject=[GitHub]%20phrase-go) and we can take more direct action toward finding a solution.