|
| 1 | +# Go API client for openapi |
| 2 | + |
| 3 | +The FirstQuadrant API is used to interact with FirstQuadrant programmatically. We also have SDKs available (coming soon). |
| 4 | + |
| 5 | +## Overview |
| 6 | +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. |
| 7 | + |
| 8 | +- API version: 0.0.0 |
| 9 | +- Package version: 1.0.0 |
| 10 | +- Build package: org.openapitools.codegen.languages.GoClientCodegen |
| 11 | + |
| 12 | +## Installation |
| 13 | + |
| 14 | +Install the following dependencies: |
| 15 | + |
| 16 | +```shell |
| 17 | +go get github.com/stretchr/testify/assert |
| 18 | +go get golang.org/x/net/context |
| 19 | +``` |
| 20 | + |
| 21 | +Put the package under your project folder and add the following in import: |
| 22 | + |
| 23 | +```golang |
| 24 | +import openapi "github.com/GIT_USER_ID/GIT_REPO_ID" |
| 25 | +``` |
| 26 | + |
| 27 | +To use a proxy, set the environment variable `HTTP_PROXY`: |
| 28 | + |
| 29 | +```golang |
| 30 | +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") |
| 31 | +``` |
| 32 | + |
| 33 | +## Configuration of Server URL |
| 34 | + |
| 35 | +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. |
| 36 | + |
| 37 | +### Select Server Configuration |
| 38 | + |
| 39 | +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. |
| 40 | + |
| 41 | +```golang |
| 42 | +ctx := context.WithValue(context.Background(), openapi.ContextServerIndex, 1) |
| 43 | +``` |
| 44 | + |
| 45 | +### Templated Server URL |
| 46 | + |
| 47 | +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. |
| 48 | + |
| 49 | +```golang |
| 50 | +ctx := context.WithValue(context.Background(), openapi.ContextServerVariables, map[string]string{ |
| 51 | + "basePath": "v2", |
| 52 | +}) |
| 53 | +``` |
| 54 | + |
| 55 | +Note, enum values are always validated and all unused variables are silently ignored. |
| 56 | + |
| 57 | +### URLs Configuration per Operation |
| 58 | + |
| 59 | +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. |
| 60 | +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. |
| 61 | +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. |
| 62 | + |
| 63 | +```golang |
| 64 | +ctx := context.WithValue(context.Background(), openapi.ContextOperationServerIndices, map[string]int{ |
| 65 | + "{classname}Service.{nickname}": 2, |
| 66 | +}) |
| 67 | +ctx = context.WithValue(context.Background(), openapi.ContextOperationServerVariables, map[string]map[string]string{ |
| 68 | + "{classname}Service.{nickname}": { |
| 69 | + "port": "8443", |
| 70 | + }, |
| 71 | +}) |
| 72 | +``` |
| 73 | + |
| 74 | +## Documentation for API Endpoints |
| 75 | + |
| 76 | +All URIs are relative to *https://api.firstquadrant.ai* |
| 77 | + |
| 78 | +Class | Method | HTTP request | Description |
| 79 | +------------ | ------------- | ------------- | ------------- |
| 80 | +*IncomingWebhooksApi* | [**IncomingWebhooksMarkConversationsAsWonPost**](docs/IncomingWebhooksApi.md#incomingwebhooksmarkconversationsaswonpost) | **Post** /incoming-webhooks/mark-conversations-as-won | Mark conversations as won |
| 81 | +*TeamsApi* | [**TeamsMeGet**](docs/TeamsApi.md#teamsmeget) | **Get** /teams/me | Get team |
| 82 | + |
| 83 | + |
| 84 | +## Documentation For Models |
| 85 | + |
| 86 | + - [MarkConversationAsWonBody](docs/MarkConversationAsWonBody.md) |
| 87 | + - [Success](docs/Success.md) |
| 88 | + - [Team](docs/Team.md) |
| 89 | + |
| 90 | + |
| 91 | +## Documentation For Authorization |
| 92 | + |
| 93 | + |
| 94 | + |
| 95 | +### api_key |
| 96 | + |
| 97 | +- **Type**: API key |
| 98 | +- **API key parameter name**: Authorization |
| 99 | +- **Location**: HTTP header |
| 100 | + |
| 101 | +Note, each API key must be added to a map of `map[string]APIKey` where the key is: Authorization and passed in as the auth context for each request. |
| 102 | + |
| 103 | + |
| 104 | +## Documentation for Utility Methods |
| 105 | + |
| 106 | +Due to the fact that model structure members are all pointers, this package contains |
| 107 | +a number of utility functions to easily obtain pointers to values of basic types. |
| 108 | +Each of these functions takes a value of the given basic type and returns a pointer to it: |
| 109 | + |
| 110 | +* `PtrBool` |
| 111 | +* `PtrInt` |
| 112 | +* `PtrInt32` |
| 113 | +* `PtrInt64` |
| 114 | +* `PtrFloat` |
| 115 | +* `PtrFloat32` |
| 116 | +* `PtrFloat64` |
| 117 | +* `PtrString` |
| 118 | +* `PtrTime` |
| 119 | + |
| 120 | +## Author |
| 121 | + |
| 122 | + |
| 123 | + |
0 commit comments