> For the complete documentation index, see [llms.txt](https://docs.ionos.com/inmemorydb-sdk-golang/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ionos.com/inmemorydb-sdk-golang/readme.md).

# Go API client for ionoscloud

API description for the IONOS In-Memory DB

## Overview

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.

* API version: 1.0.0
* Package version: v1.0.0
* Build package: org.openapitools.codegen.languages.GoClientCodegen For more information, please visit <https://docs.ionos.com/support/general-information/contact-information>

## Installation

Install the following dependencies:

```shell
go get github.com/stretchr/testify/assert
go get golang.org/x/net/context
```

Put the package under your project folder and add the following in import:

```golang
import ionoscloud "github.com/ionos-cloud/sdk-go-dbaas-in-memory-db"
```

To use a proxy, set the environment variable `HTTP_PROXY`:

```golang
os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")
```

## Configuration of Server URL

Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification.

### Select Server Configuration

For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`.

```golang
ctx := context.WithValue(context.Background(), ionoscloud.ContextServerIndex, 1)
```

### Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`.

```golang
ctx := context.WithValue(context.Background(), ionoscloud.ContextServerVariables, map[string]string{
	"basePath": "v2",
})
```

Note, enum values are always validated and all unused variables are silently ignored.

## Documentation for API Endpoints

All URIs are relative to *<https://in-memory-db.de-fra.ionos.com>*

| Class           | Method                                                                                                                         | HTTP request                                         | Description             |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------- | ----------------------- |
| *ReplicaSetApi* | [**ReplicasetsDelete**](https://docs.ionos.com/inmemorydb-sdk-golang/docs/api/replicasetapi.md#replicasetsdelete)              | **Delete** /replicasets/{replicasetId}               | Delete ReplicaSet       |
| *ReplicaSetApi* | [**ReplicasetsFindById**](https://docs.ionos.com/inmemorydb-sdk-golang/docs/api/replicasetapi.md#replicasetsfindbyid)          | **Get** /replicasets/{replicasetId}                  | Retrieve ReplicaSet     |
| *ReplicaSetApi* | [**ReplicasetsGet**](https://docs.ionos.com/inmemorydb-sdk-golang/docs/api/replicasetapi.md#replicasetsget)                    | **Get** /replicasets                                 | Retrieve all ReplicaSet |
| *ReplicaSetApi* | [**ReplicasetsPost**](https://docs.ionos.com/inmemorydb-sdk-golang/docs/api/replicasetapi.md#replicasetspost)                  | **Post** /replicasets                                | Create ReplicaSet       |
| *ReplicaSetApi* | [**ReplicasetsPut**](https://docs.ionos.com/inmemorydb-sdk-golang/docs/api/replicasetapi.md#replicasetsput)                    | **Put** /replicasets/{replicasetId}                  | Ensure ReplicaSet       |
| *RestoreApi*    | [**SnapshotsRestoresFindById**](https://docs.ionos.com/inmemorydb-sdk-golang/docs/api/restoreapi.md#snapshotsrestoresfindbyid) | **Get** /snapshots/{snapshotId}/restores/{restoreId} | Retrieve Restore        |
| *RestoreApi*    | [**SnapshotsRestoresGet**](https://docs.ionos.com/inmemorydb-sdk-golang/docs/api/restoreapi.md#snapshotsrestoresget)           | **Get** /snapshots/{snapshotId}/restores             | Retrieve all Restore    |
| *RestoreApi*    | [**SnapshotsRestoresPost**](https://docs.ionos.com/inmemorydb-sdk-golang/docs/api/restoreapi.md#snapshotsrestorespost)         | **Post** /snapshots/{snapshotId}/restores            | Create Restore          |
| *SnapshotApi*   | [**SnapshotsFindById**](https://docs.ionos.com/inmemorydb-sdk-golang/docs/api/snapshotapi.md#snapshotsfindbyid)                | **Get** /snapshots/{snapshotId}                      | Retrieve Snapshot       |
| *SnapshotApi*   | [**SnapshotsGet**](https://docs.ionos.com/inmemorydb-sdk-golang/docs/api/snapshotapi.md#snapshotsget)                          | **Get** /snapshots                                   | Retrieve all Snapshot   |

## Documentation For Models

* [Connection](https://docs.ionos.com/inmemorydb-sdk-golang/docs/models/connection.md)
* [DayOfTheWeek](https://docs.ionos.com/inmemorydb-sdk-golang/docs/models/dayoftheweek.md)
* [Error](https://docs.ionos.com/inmemorydb-sdk-golang/docs/models/error.md)
* [ErrorMessages](https://docs.ionos.com/inmemorydb-sdk-golang/docs/models/errormessages.md)
* [EvictionPolicy](https://docs.ionos.com/inmemorydb-sdk-golang/docs/models/evictionpolicy.md)
* [HashedPassword](https://docs.ionos.com/inmemorydb-sdk-golang/docs/models/hashedpassword.md)
* [Links](https://docs.ionos.com/inmemorydb-sdk-golang/docs/models/links.md)
* [MaintenanceWindow](https://docs.ionos.com/inmemorydb-sdk-golang/docs/models/maintenancewindow.md)
* [Metadata](https://docs.ionos.com/inmemorydb-sdk-golang/docs/models/metadata.md)
* [Pagination](https://docs.ionos.com/inmemorydb-sdk-golang/docs/models/pagination.md)
* [PersistenceMode](https://docs.ionos.com/inmemorydb-sdk-golang/docs/models/persistencemode.md)
* [ReplicaSet](https://docs.ionos.com/inmemorydb-sdk-golang/docs/models/replicaset.md)
* [ReplicaSetCreate](https://docs.ionos.com/inmemorydb-sdk-golang/docs/models/replicasetcreate.md)
* [ReplicaSetEnsure](https://docs.ionos.com/inmemorydb-sdk-golang/docs/models/replicasetensure.md)
* [ReplicaSetMetadata](https://docs.ionos.com/inmemorydb-sdk-golang/docs/models/replicasetmetadata.md)
* [ReplicaSetMetadataAllOf](https://docs.ionos.com/inmemorydb-sdk-golang/docs/models/replicasetmetadataallof.md)
* [ReplicaSetRead](https://docs.ionos.com/inmemorydb-sdk-golang/docs/models/replicasetread.md)
* [ReplicaSetReadList](https://docs.ionos.com/inmemorydb-sdk-golang/docs/models/replicasetreadlist.md)
* [ReplicaSetReadListAllOf](https://docs.ionos.com/inmemorydb-sdk-golang/docs/models/replicasetreadlistallof.md)
* [ResourceState](https://docs.ionos.com/inmemorydb-sdk-golang/docs/models/resourcestate.md)
* [Resources](https://docs.ionos.com/inmemorydb-sdk-golang/docs/models/resources.md)
* [Restore](https://docs.ionos.com/inmemorydb-sdk-golang/docs/models/restore.md)
* [RestoreCreate](https://docs.ionos.com/inmemorydb-sdk-golang/docs/models/restorecreate.md)
* [RestoreMetadata](https://docs.ionos.com/inmemorydb-sdk-golang/docs/models/restoremetadata.md)
* [RestoreMetadataAllOf](https://docs.ionos.com/inmemorydb-sdk-golang/docs/models/restoremetadataallof.md)
* [RestoreRead](https://docs.ionos.com/inmemorydb-sdk-golang/docs/models/restoreread.md)
* [RestoreReadList](https://docs.ionos.com/inmemorydb-sdk-golang/docs/models/restorereadlist.md)
* [RestoreReadListAllOf](https://docs.ionos.com/inmemorydb-sdk-golang/docs/models/restorereadlistallof.md)
* [SnapshotCreate](https://docs.ionos.com/inmemorydb-sdk-golang/docs/models/snapshotcreate.md)
* [SnapshotEnsure](https://docs.ionos.com/inmemorydb-sdk-golang/docs/models/snapshotensure.md)
* [SnapshotMetadata](https://docs.ionos.com/inmemorydb-sdk-golang/docs/models/snapshotmetadata.md)
* [SnapshotMetadataAllOf](https://docs.ionos.com/inmemorydb-sdk-golang/docs/models/snapshotmetadataallof.md)
* [SnapshotRead](https://docs.ionos.com/inmemorydb-sdk-golang/docs/models/snapshotread.md)
* [SnapshotReadList](https://docs.ionos.com/inmemorydb-sdk-golang/docs/models/snapshotreadlist.md)
* [SnapshotReadListAllOf](https://docs.ionos.com/inmemorydb-sdk-golang/docs/models/snapshotreadlistallof.md)
* [User](https://docs.ionos.com/inmemorydb-sdk-golang/docs/models/user.md)
* [UserPassword](https://docs.ionos.com/inmemorydb-sdk-golang/docs/models/userpassword.md)

## Documentation For Authorization

Authentication schemes defined for the API:

### tokenAuth

* **Type**: HTTP Bearer token authentication

Example

```golang
auth := context.WithValue(context.Background(), sw.ContextAccessToken, "BEARER_TOKEN_STRING")
r, err := client.Service.Operation(auth, args)
```

## Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:

* `PtrBool`
* `PtrInt`
* `PtrInt32`
* `PtrInt64`
* `PtrFloat`
* `PtrFloat32`
* `PtrFloat64`
* `PtrString`
* `PtrTime`

## Author

<support@cloud.ionos.com>
