> For the complete documentation index, see [llms.txt](https://docs.ionos.com/api-gateway-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/api-gateway-sdk-golang/api/apigatewaysapi.md).

# APIGatewaysApi

All URIs are relative to *<https://apigateway.de-txl.ionos.com>*

| Method                                          | HTTP request                        | Description              |
| ----------------------------------------------- | ----------------------------------- | ------------------------ |
| [**ApigatewaysDelete**](#ApigatewaysDelete)     | **Delete** /gateways/{apigatewayId} | Delete Gateway           |
| [**ApigatewaysFindById**](#ApigatewaysFindById) | **Get** /gateways/{apigatewayId}    | Retrieve Gateway         |
| [**ApigatewaysGet**](#ApigatewaysGet)           | **Get** /gateways                   | Retrieve all Apigateways |
| [**ApigatewaysPost**](#ApigatewaysPost)         | **Post** /gateways                  | Create Gateway           |
| [**ApigatewaysPut**](#ApigatewaysPut)           | **Put** /gateways/{apigatewayId}    | Ensure Gateway           |

## ApigatewaysDelete

```go
var result  = ApigatewaysDelete(ctx, apigatewayId)
                      .Execute()
```

Delete Gateway

### Example

```go
package main

import (
    "context"
    "fmt"
    "os"

    ionoscloud "github.com/ionos-cloud/sdk-go-api-gateway"
)

func main() {
    apigatewayId := "0620c174-dd3c-5eb4-87c8-e2b516553a00" // string | The ID (UUID) of the Gateway.

    configuration := ionoscloud.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL")
    apiClient := ionoscloud.NewAPIClient(configuration)
    resp, err := apiClient.APIGatewaysApi.ApigatewaysDelete(context.Background(), apigatewayId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `APIGatewaysApi.ApigatewaysDelete``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp)
    }
}
```

### Path Parameters

| Name             | Type                | Description                                                                 | Notes |
| ---------------- | ------------------- | --------------------------------------------------------------------------- | ----- |
| **ctx**          | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. |       |
| **apigatewayId** | **string**          | The ID (UUID) of the Gateway.                                               |       |

### Other Parameters

Other parameters are passed through a pointer to an apiApigatewaysDeleteRequest struct via the builder pattern

### Return type

(empty response body)

### HTTP request headers

* **Content-Type**: Not defined
* **Accept**: application/json

### URLs Configuration per Operation

Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. An operation is uniquely identified by `"APIGatewaysApiService.ApigatewaysDelete"` string. Similar rules for overriding default operation server index and variables apply by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps.

```golang
ctx := context.WithValue(context.Background(), {packageName}.ContextOperationServerIndices, map[string]int{
    "APIGatewaysApiService.ApigatewaysDelete": 2,
})
ctx = context.WithValue(context.Background(), {packageName}.ContextOperationServerVariables, map[string]map[string]string{
    "APIGatewaysApiService.ApigatewaysDelete": {
    "port": "8443",
},
})
```

## ApigatewaysFindById

```go
var result GatewayRead = ApigatewaysFindById(ctx, apigatewayId)
                      .Execute()
```

Retrieve Gateway

### Example

```go
package main

import (
    "context"
    "fmt"
    "os"

    ionoscloud "github.com/ionos-cloud/sdk-go-api-gateway"
)

func main() {
    apigatewayId := "0620c174-dd3c-5eb4-87c8-e2b516553a00" // string | The ID (UUID) of the Gateway.

    configuration := ionoscloud.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL")
    apiClient := ionoscloud.NewAPIClient(configuration)
    resource, resp, err := apiClient.APIGatewaysApi.ApigatewaysFindById(context.Background(), apigatewayId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `APIGatewaysApi.ApigatewaysFindById``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp)
    }
    // response from `ApigatewaysFindById`: GatewayRead
    fmt.Fprintf(os.Stdout, "Response from `APIGatewaysApi.ApigatewaysFindById`: %v\n", resource)
}
```

### Path Parameters

| Name             | Type                | Description                                                                 | Notes |
| ---------------- | ------------------- | --------------------------------------------------------------------------- | ----- |
| **ctx**          | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. |       |
| **apigatewayId** | **string**          | The ID (UUID) of the Gateway.                                               |       |

### Other Parameters

Other parameters are passed through a pointer to an apiApigatewaysFindByIdRequest struct via the builder pattern

### Return type

[**GatewayRead**](/api-gateway-sdk-golang/models/gatewayread.md)

### HTTP request headers

* **Content-Type**: Not defined
* **Accept**: application/json

### URLs Configuration per Operation

Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. An operation is uniquely identified by `"APIGatewaysApiService.ApigatewaysFindById"` string. Similar rules for overriding default operation server index and variables apply by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps.

```golang
ctx := context.WithValue(context.Background(), {packageName}.ContextOperationServerIndices, map[string]int{
    "APIGatewaysApiService.ApigatewaysFindById": 2,
})
ctx = context.WithValue(context.Background(), {packageName}.ContextOperationServerVariables, map[string]map[string]string{
    "APIGatewaysApiService.ApigatewaysFindById": {
    "port": "8443",
},
})
```

## ApigatewaysGet

```go
var result GatewayReadList = ApigatewaysGet(ctx)
                      .Offset(offset)
                      .Limit(limit)
                      .OrderBy(orderBy)
                      .Execute()
```

Retrieve all Apigateways

### Example

```go
package main

import (
    "context"
    "fmt"
    "os"

    ionoscloud "github.com/ionos-cloud/sdk-go-api-gateway"
)

func main() {
    offset := int32(0) // int32 | The first element (of the total list of elements) to include in the response. Use together with limit for pagination. (optional) (default to 0)
    limit := int32(100) // int32 | The maximum number of elements to return. Use together with offset for pagination. (optional) (default to 100)
    orderBy := "orderBy_example" // string | The field to order the results by. If not provided, the results will be ordered by the default field. (optional) (default to "-createdDate")

    configuration := ionoscloud.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL")
    apiClient := ionoscloud.NewAPIClient(configuration)
    resource, resp, err := apiClient.APIGatewaysApi.ApigatewaysGet(context.Background()).Offset(offset).Limit(limit).OrderBy(orderBy).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `APIGatewaysApi.ApigatewaysGet``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp)
    }
    // response from `ApigatewaysGet`: GatewayReadList
    fmt.Fprintf(os.Stdout, "Response from `APIGatewaysApi.ApigatewaysGet`: %v\n", resource)
}
```

### Path Parameters

### Other Parameters

Other parameters are passed through a pointer to an apiApigatewaysGetRequest struct via the builder pattern

| Name        | Type       | Description                                                                                                           | Notes                        |
| ----------- | ---------- | --------------------------------------------------------------------------------------------------------------------- | ---------------------------- |
| **offset**  | **int32**  | The first element (of the total list of elements) to include in the response. Use together with limit for pagination. | \[default to 0]              |
| **limit**   | **int32**  | The maximum number of elements to return. Use together with offset for pagination.                                    | \[default to 100]            |
| **orderBy** | **string** | The field to order the results by. If not provided, the results will be ordered by the default field.                 | \[default to "-createdDate"] |

### Return type

[**GatewayReadList**](/api-gateway-sdk-golang/models/gatewayreadlist.md)

### HTTP request headers

* **Content-Type**: Not defined
* **Accept**: application/json

### URLs Configuration per Operation

Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. An operation is uniquely identified by `"APIGatewaysApiService.ApigatewaysGet"` string. Similar rules for overriding default operation server index and variables apply by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps.

```golang
ctx := context.WithValue(context.Background(), {packageName}.ContextOperationServerIndices, map[string]int{
    "APIGatewaysApiService.ApigatewaysGet": 2,
})
ctx = context.WithValue(context.Background(), {packageName}.ContextOperationServerVariables, map[string]map[string]string{
    "APIGatewaysApiService.ApigatewaysGet": {
    "port": "8443",
},
})
```

## ApigatewaysPost

```go
var result GatewayRead = ApigatewaysPost(ctx)
                      .GatewayCreate(gatewayCreate)
                      .Execute()
```

Create Gateway

### Example

```go
package main

import (
    "context"
    "fmt"
    "os"

    ionoscloud "github.com/ionos-cloud/sdk-go-api-gateway"
)

func main() {
    gatewayCreate := *openapiclient.NewGatewayCreate(*openapiclient.NewGateway("APIGateway 1")) // GatewayCreate | Gateway to create.

    configuration := ionoscloud.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL")
    apiClient := ionoscloud.NewAPIClient(configuration)
    resource, resp, err := apiClient.APIGatewaysApi.ApigatewaysPost(context.Background()).GatewayCreate(gatewayCreate).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `APIGatewaysApi.ApigatewaysPost``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp)
    }
    // response from `ApigatewaysPost`: GatewayRead
    fmt.Fprintf(os.Stdout, "Response from `APIGatewaysApi.ApigatewaysPost`: %v\n", resource)
}
```

### Path Parameters

### Other Parameters

Other parameters are passed through a pointer to an apiApigatewaysPostRequest struct via the builder pattern

| Name              | Type                                                                 | Description        | Notes |
| ----------------- | -------------------------------------------------------------------- | ------------------ | ----- |
| **gatewayCreate** | [**GatewayCreate**](/api-gateway-sdk-golang/models/gatewaycreate.md) | Gateway to create. |       |

### Return type

[**GatewayRead**](/api-gateway-sdk-golang/models/gatewayread.md)

### HTTP request headers

* **Content-Type**: application/json
* **Accept**: application/json

### URLs Configuration per Operation

Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. An operation is uniquely identified by `"APIGatewaysApiService.ApigatewaysPost"` string. Similar rules for overriding default operation server index and variables apply by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps.

```golang
ctx := context.WithValue(context.Background(), {packageName}.ContextOperationServerIndices, map[string]int{
    "APIGatewaysApiService.ApigatewaysPost": 2,
})
ctx = context.WithValue(context.Background(), {packageName}.ContextOperationServerVariables, map[string]map[string]string{
    "APIGatewaysApiService.ApigatewaysPost": {
    "port": "8443",
},
})
```

## ApigatewaysPut

```go
var result GatewayRead = ApigatewaysPut(ctx, apigatewayId)
                      .GatewayEnsure(gatewayEnsure)
                      .Execute()
```

Ensure Gateway

### Example

```go
package main

import (
    "context"
    "fmt"
    "os"

    ionoscloud "github.com/ionos-cloud/sdk-go-api-gateway"
)

func main() {
    apigatewayId := "0620c174-dd3c-5eb4-87c8-e2b516553a00" // string | The ID (UUID) of the Gateway.
    gatewayEnsure := *openapiclient.NewGatewayEnsure("0620c174-dd3c-5eb4-87c8-e2b516553a00", *openapiclient.NewGateway("APIGateway 1")) // GatewayEnsure | update Gateway

    configuration := ionoscloud.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL")
    apiClient := ionoscloud.NewAPIClient(configuration)
    resource, resp, err := apiClient.APIGatewaysApi.ApigatewaysPut(context.Background(), apigatewayId).GatewayEnsure(gatewayEnsure).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `APIGatewaysApi.ApigatewaysPut``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp)
    }
    // response from `ApigatewaysPut`: GatewayRead
    fmt.Fprintf(os.Stdout, "Response from `APIGatewaysApi.ApigatewaysPut`: %v\n", resource)
}
```

### Path Parameters

| Name             | Type                | Description                                                                 | Notes |
| ---------------- | ------------------- | --------------------------------------------------------------------------- | ----- |
| **ctx**          | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. |       |
| **apigatewayId** | **string**          | The ID (UUID) of the Gateway.                                               |       |

### Other Parameters

Other parameters are passed through a pointer to an apiApigatewaysPutRequest struct via the builder pattern

| Name              | Type                                                                 | Description    | Notes |
| ----------------- | -------------------------------------------------------------------- | -------------- | ----- |
| **gatewayEnsure** | [**GatewayEnsure**](/api-gateway-sdk-golang/models/gatewayensure.md) | update Gateway |       |

### Return type

[**GatewayRead**](/api-gateway-sdk-golang/models/gatewayread.md)

### HTTP request headers

* **Content-Type**: application/json
* **Accept**: application/json

### URLs Configuration per Operation

Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. An operation is uniquely identified by `"APIGatewaysApiService.ApigatewaysPut"` string. Similar rules for overriding default operation server index and variables apply by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps.

```golang
ctx := context.WithValue(context.Background(), {packageName}.ContextOperationServerIndices, map[string]int{
    "APIGatewaysApiService.ApigatewaysPut": 2,
})
ctx = context.WithValue(context.Background(), {packageName}.ContextOperationServerVariables, map[string]map[string]string{
    "APIGatewaysApiService.ApigatewaysPut": {
    "port": "8443",
},
})
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.ionos.com/api-gateway-sdk-golang/api/apigatewaysapi.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
