# 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**](/inmemorydb-sdk-golang/docs/api/replicasetapi.md#replicasetsdelete)              | **Delete** /replicasets/{replicasetId}               | Delete ReplicaSet       |
| *ReplicaSetApi* | [**ReplicasetsFindById**](/inmemorydb-sdk-golang/docs/api/replicasetapi.md#replicasetsfindbyid)          | **Get** /replicasets/{replicasetId}                  | Retrieve ReplicaSet     |
| *ReplicaSetApi* | [**ReplicasetsGet**](/inmemorydb-sdk-golang/docs/api/replicasetapi.md#replicasetsget)                    | **Get** /replicasets                                 | Retrieve all ReplicaSet |
| *ReplicaSetApi* | [**ReplicasetsPost**](/inmemorydb-sdk-golang/docs/api/replicasetapi.md#replicasetspost)                  | **Post** /replicasets                                | Create ReplicaSet       |
| *ReplicaSetApi* | [**ReplicasetsPut**](/inmemorydb-sdk-golang/docs/api/replicasetapi.md#replicasetsput)                    | **Put** /replicasets/{replicasetId}                  | Ensure ReplicaSet       |
| *RestoreApi*    | [**SnapshotsRestoresFindById**](/inmemorydb-sdk-golang/docs/api/restoreapi.md#snapshotsrestoresfindbyid) | **Get** /snapshots/{snapshotId}/restores/{restoreId} | Retrieve Restore        |
| *RestoreApi*    | [**SnapshotsRestoresGet**](/inmemorydb-sdk-golang/docs/api/restoreapi.md#snapshotsrestoresget)           | **Get** /snapshots/{snapshotId}/restores             | Retrieve all Restore    |
| *RestoreApi*    | [**SnapshotsRestoresPost**](/inmemorydb-sdk-golang/docs/api/restoreapi.md#snapshotsrestorespost)         | **Post** /snapshots/{snapshotId}/restores            | Create Restore          |
| *SnapshotApi*   | [**SnapshotsFindById**](/inmemorydb-sdk-golang/docs/api/snapshotapi.md#snapshotsfindbyid)                | **Get** /snapshots/{snapshotId}                      | Retrieve Snapshot       |
| *SnapshotApi*   | [**SnapshotsGet**](/inmemorydb-sdk-golang/docs/api/snapshotapi.md#snapshotsget)                          | **Get** /snapshots                                   | Retrieve all Snapshot   |

## Documentation For Models

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ionos.com/inmemorydb-sdk-golang/readme.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
