> For the complete documentation index, see [llms.txt](https://docs.ionos.com/cloud/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/cloud/go/go-bundle/sdks/vpn/api/wireguardgatewaysapi.md).

# WireguardGatewaysApi

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

| Method                                                      | HTTP request                              | Description                    |
| ----------------------------------------------------------- | ----------------------------------------- | ------------------------------ |
| [**WireguardgatewaysDelete**](#WireguardgatewaysDelete)     | **Delete** /wireguardgateways/{gatewayId} | Delete WireguardGateway        |
| [**WireguardgatewaysFindById**](#WireguardgatewaysFindById) | **Get** /wireguardgateways/{gatewayId}    | Retrieve WireguardGateway      |
| [**WireguardgatewaysGet**](#WireguardgatewaysGet)           | **Get** /wireguardgateways                | Retrieve all WireguardGateways |
| [**WireguardgatewaysPost**](#WireguardgatewaysPost)         | **Post** /wireguardgateways               | Create WireguardGateway        |
| [**WireguardgatewaysPut**](#WireguardgatewaysPut)           | **Put** /wireguardgateways/{gatewayId}    | Ensure WireguardGateway        |

## WireguardgatewaysDelete

```go
var result  = WireguardgatewaysDelete(ctx, gatewayId)
                      .Execute()
```

Delete WireguardGateway

### Example

```go
package main

import (
    "context"
    "fmt"
    "os"

    vpn "github.com/ionos-cloud/sdk-go-bundle/products/vpn"
    "github.com/ionos-cloud/sdk-go-bundle/shared"
)

func main() {
    gatewayId := "85c79b4b-5b40-570a-b788-58dd46ea71e2" // string | The ID (UUID) of the WireguardGateway.

    configuration := shared.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL")
    apiClient := vpn.NewAPIClient(configuration)
    resp, err := apiClient.WireguardGatewaysApi.WireguardgatewaysDelete(context.Background(), gatewayId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WireguardGatewaysApi.WireguardgatewaysDelete``: %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. |       |
| **gatewayId** | **string**          | The ID (UUID) of the WireguardGateway.                                      |       |

### Other Parameters

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

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |

### Return type

(empty response body)

### HTTP request headers

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

## WireguardgatewaysFindById

```go
var result WireguardGatewayRead = WireguardgatewaysFindById(ctx, gatewayId)
                      .Execute()
```

Retrieve WireguardGateway

### Example

```go
package main

import (
    "context"
    "fmt"
    "os"

    vpn "github.com/ionos-cloud/sdk-go-bundle/products/vpn"
    "github.com/ionos-cloud/sdk-go-bundle/shared"
)

func main() {
    gatewayId := "85c79b4b-5b40-570a-b788-58dd46ea71e2" // string | The ID (UUID) of the WireguardGateway.

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

### Path Parameters

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

### Other Parameters

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

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |

### Return type

[**WireguardGatewayRead**](/cloud/go/go-bundle/sdks/vpn/models/wireguardgatewayread.md)

### HTTP request headers

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

## WireguardgatewaysGet

```go
var result WireguardGatewayReadList = WireguardgatewaysGet(ctx)
                      .Offset(offset)
                      .Limit(limit)
                      .Execute()
```

Retrieve all WireguardGateways

### Example

```go
package main

import (
    "context"
    "fmt"
    "os"

    vpn "github.com/ionos-cloud/sdk-go-bundle/products/vpn"
    "github.com/ionos-cloud/sdk-go-bundle/shared"
)

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)

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

### Path Parameters

### Other Parameters

Other parameters are passed through a pointer to an apiWireguardgatewaysGetRequest 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] |

### Return type

[**WireguardGatewayReadList**](/cloud/go/go-bundle/sdks/vpn/models/wireguardgatewayreadlist.md)

### HTTP request headers

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

## WireguardgatewaysPost

```go
var result WireguardGatewayRead = WireguardgatewaysPost(ctx)
                      .WireguardGatewayCreate(wireguardGatewayCreate)
                      .Execute()
```

Create WireguardGateway

### Example

```go
package main

import (
    "context"
    "fmt"
    "os"

    vpn "github.com/ionos-cloud/sdk-go-bundle/products/vpn"
    "github.com/ionos-cloud/sdk-go-bundle/shared"
)

func main() {
    wireguardGatewayCreate := *openapiclient.NewWireguardGatewayCreate(*openapiclient.NewWireguardGateway("My Company Gateway", "81.173.1.2", []openapiclient.Connection{*openapiclient.NewConnection("5a029f4a-72e5-11ec-90d6-0242ac120003", "2", "192.168.1.100/24")}, "0HpE4BNwGHabeaC4aY/GFxB6fBSc0d49Db0qAzRVSVc=")) // WireguardGatewayCreate | WireguardGateway to create.

    configuration := shared.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL")
    apiClient := vpn.NewAPIClient(configuration)
    resource, resp, err := apiClient.WireguardGatewaysApi.WireguardgatewaysPost(context.Background()).WireguardGatewayCreate(wireguardGatewayCreate).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WireguardGatewaysApi.WireguardgatewaysPost``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp)
    }
    // response from `WireguardgatewaysPost`: WireguardGatewayRead
    fmt.Fprintf(os.Stdout, "Response from `WireguardGatewaysApi.WireguardgatewaysPost`: %v\n", resource)
}
```

### Path Parameters

### Other Parameters

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

| Name                       | Type                                                                                        | Description                 | Notes |
| -------------------------- | ------------------------------------------------------------------------------------------- | --------------------------- | ----- |
| **wireguardGatewayCreate** | [**WireguardGatewayCreate**](/cloud/go/go-bundle/sdks/vpn/models/wireguardgatewaycreate.md) | WireguardGateway to create. |       |

### Return type

[**WireguardGatewayRead**](/cloud/go/go-bundle/sdks/vpn/models/wireguardgatewayread.md)

### HTTP request headers

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

## WireguardgatewaysPut

```go
var result WireguardGatewayRead = WireguardgatewaysPut(ctx, gatewayId)
                      .WireguardGatewayEnsure(wireguardGatewayEnsure)
                      .Execute()
```

Ensure WireguardGateway

### Example

```go
package main

import (
    "context"
    "fmt"
    "os"

    vpn "github.com/ionos-cloud/sdk-go-bundle/products/vpn"
    "github.com/ionos-cloud/sdk-go-bundle/shared"
)

func main() {
    gatewayId := "85c79b4b-5b40-570a-b788-58dd46ea71e2" // string | The ID (UUID) of the WireguardGateway.
    wireguardGatewayEnsure := *openapiclient.NewWireguardGatewayEnsure("85c79b4b-5b40-570a-b788-58dd46ea71e2", *openapiclient.NewWireguardGateway("My Company Gateway", "81.173.1.2", []openapiclient.Connection{*openapiclient.NewConnection("5a029f4a-72e5-11ec-90d6-0242ac120003", "2", "192.168.1.100/24")}, "0HpE4BNwGHabeaC4aY/GFxB6fBSc0d49Db0qAzRVSVc=")) // WireguardGatewayEnsure | update WireguardGateway

    configuration := shared.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL")
    apiClient := vpn.NewAPIClient(configuration)
    resource, resp, err := apiClient.WireguardGatewaysApi.WireguardgatewaysPut(context.Background(), gatewayId).WireguardGatewayEnsure(wireguardGatewayEnsure).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WireguardGatewaysApi.WireguardgatewaysPut``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp)
    }
    // response from `WireguardgatewaysPut`: WireguardGatewayRead
    fmt.Fprintf(os.Stdout, "Response from `WireguardGatewaysApi.WireguardgatewaysPut`: %v\n", resource)
}
```

### Path Parameters

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

### Other Parameters

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

| Name                       | Type                                                                                        | Description             | Notes |
| -------------------------- | ------------------------------------------------------------------------------------------- | ----------------------- | ----- |
| **wireguardGatewayEnsure** | [**WireguardGatewayEnsure**](/cloud/go/go-bundle/sdks/vpn/models/wireguardgatewayensure.md) | update WireguardGateway |       |

### Return type

[**WireguardGatewayRead**](/cloud/go/go-bundle/sdks/vpn/models/wireguardgatewayread.md)

### HTTP request headers

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


---

# 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/cloud/go/go-bundle/sdks/vpn/api/wireguardgatewaysapi.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.
