# CertificateApi

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

| Method                                            | HTTP request                             | Description              |
| ------------------------------------------------- | ---------------------------------------- | ------------------------ |
| [**CertificatesDelete**](#CertificatesDelete)     | **Delete** /certificates/{certificateId} | Delete Certificate       |
| [**CertificatesFindById**](#CertificatesFindById) | **Get** /certificates/{certificateId}    | Retrieve Certificate     |
| [**CertificatesGet**](#CertificatesGet)           | **Get** /certificates                    | Retrieve all Certificate |
| [**CertificatesPatch**](#CertificatesPatch)       | **Patch** /certificates/{certificateId}  | Updates Certificate      |
| [**CertificatesPost**](#CertificatesPost)         | **Post** /certificates                   | Create Certificate       |

## CertificatesDelete

```go
var result  = CertificatesDelete(ctx, certificateId)
                      .Execute()
```

Delete Certificate

### Example

```go
package main

import (
    "context"
    "fmt"
    "os"

    ionoscloud "github.com/ionos-cloud/sdk-go-cert-manager"
)

func main() {
    certificateId := "cbee81a3-9389-57ba-bc50-393adcfca141" // string | The ID (UUID) of the Certificate.

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

### Other Parameters

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

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

### 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 `"CertificateApiService.CertificatesDelete"` 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{
    "CertificateApiService.CertificatesDelete": 2,
})
ctx = context.WithValue(context.Background(), {packageName}.ContextOperationServerVariables, map[string]map[string]string{
    "CertificateApiService.CertificatesDelete": {
    "port": "8443",
},
})
```

## CertificatesFindById

```go
var result CertificateRead = CertificatesFindById(ctx, certificateId)
                      .Execute()
```

Retrieve Certificate

### Example

```go
package main

import (
    "context"
    "fmt"
    "os"

    ionoscloud "github.com/ionos-cloud/sdk-go-cert-manager"
)

func main() {
    certificateId := "cbee81a3-9389-57ba-bc50-393adcfca141" // string | The ID (UUID) of the Certificate.

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

### Path Parameters

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

### Other Parameters

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

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

### Return type

[**CertificateRead**](https://docs.ionos.com/sections-test/go-sdk/certificate-manager-go-sdk/models/certificateread)

### 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 `"CertificateApiService.CertificatesFindById"` 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{
    "CertificateApiService.CertificatesFindById": 2,
})
ctx = context.WithValue(context.Background(), {packageName}.ContextOperationServerVariables, map[string]map[string]string{
    "CertificateApiService.CertificatesFindById": {
    "port": "8443",
},
})
```

## CertificatesGet

```go
var result CertificateReadList = CertificatesGet(ctx)
                      .Offset(offset)
                      .Limit(limit)
                      .FilterCommonName(filterCommonName)
                      .FilterAutoCertificate(filterAutoCertificate)
                      .Execute()
```

Retrieve all Certificate

### Example

```go
package main

import (
    "context"
    "fmt"
    "os"

    ionoscloud "github.com/ionos-cloud/sdk-go-cert-manager"
)

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)
    filterCommonName := "www.example.com" // string | Filter by the common name (DNS).  (optional)
    filterAutoCertificate := "b471cd03-ef51-52c5-91a5-49195b0a04d4" // string | Filter by autoCertificateID.  (optional)

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

### Path Parameters

### Other Parameters

Other parameters are passed through a pointer to an apiCertificatesGetRequest 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] |
| **filterCommonName**      | **string** | Filter by the common name (DNS).                                                                                      |                   |
| **filterAutoCertificate** | **string** | Filter by autoCertificateID.                                                                                          |                   |

### Return type

[**CertificateReadList**](https://docs.ionos.com/sections-test/go-sdk/certificate-manager-go-sdk/models/certificatereadlist)

### 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 `"CertificateApiService.CertificatesGet"` 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{
    "CertificateApiService.CertificatesGet": 2,
})
ctx = context.WithValue(context.Background(), {packageName}.ContextOperationServerVariables, map[string]map[string]string{
    "CertificateApiService.CertificatesGet": {
    "port": "8443",
},
})
```

## CertificatesPatch

```go
var result CertificateRead = CertificatesPatch(ctx, certificateId)
                      .CertificatePatch(certificatePatch)
                      .Execute()
```

Updates Certificate

### Example

```go
package main

import (
    "context"
    "fmt"
    "os"

    ionoscloud "github.com/ionos-cloud/sdk-go-cert-manager"
)

func main() {
    certificateId := "cbee81a3-9389-57ba-bc50-393adcfca141" // string | The ID (UUID) of the Certificate.
    certificatePatch := *openapiclient.NewCertificatePatch(*openapiclient.NewPatchName("My name")) // CertificatePatch | patch Certificate

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

### Path Parameters

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

### Other Parameters

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

| Name                 | Type                                                                                                                   | Description       | Notes |
| -------------------- | ---------------------------------------------------------------------------------------------------------------------- | ----------------- | ----- |
| **certificatePatch** | [**CertificatePatch**](https://docs.ionos.com/sections-test/go-sdk/certificate-manager-go-sdk/models/certificatepatch) | patch Certificate |       |

### Return type

[**CertificateRead**](https://docs.ionos.com/sections-test/go-sdk/certificate-manager-go-sdk/models/certificateread)

### 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 `"CertificateApiService.CertificatesPatch"` 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{
    "CertificateApiService.CertificatesPatch": 2,
})
ctx = context.WithValue(context.Background(), {packageName}.ContextOperationServerVariables, map[string]map[string]string{
    "CertificateApiService.CertificatesPatch": {
    "port": "8443",
},
})
```

## CertificatesPost

```go
var result CertificateRead = CertificatesPost(ctx)
                      .CertificateCreate(certificateCreate)
                      .Execute()
```

Create Certificate

### Example

```go
package main

import (
    "context"
    "fmt"
    "os"

    ionoscloud "github.com/ionos-cloud/sdk-go-cert-manager"
)

func main() {
    certificateCreate := *openapiclient.NewCertificateCreate(*openapiclient.NewCertificate("My Certificate", "-----BEGIN CERTIFICATE-----
MIIE5TCCAs2gAwIBAgIBATANBgkqhkiG9w0BAQsFADA2MQswCQYDVQQGEwJSTzEK
-----END CERTIFICATE-----
", "-----BEGIN CERTIFICATE-----
MIIDoTCCAokCFDrAUWffdxWJVz2Axl9lp/4xiUteMA0GCSqGSIb3DQEBCwUAMIGG
-----END CERTIFICATE-----
", "-----BEGIN RSA PRIVATE KEY-----
MIIJKQIBAAKCAgEAzDehfqWBr+9q0pxwCDDRph7QSPiMbkDGaGKc+Fd2h3doT8Li
-----END RSA PRIVATE KEY-----
")) // CertificateCreate | Certificate to create.

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

### Path Parameters

### Other Parameters

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

| Name                  | Type                                                                                                                     | Description            | Notes |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------ | ---------------------- | ----- |
| **certificateCreate** | [**CertificateCreate**](https://docs.ionos.com/sections-test/go-sdk/certificate-manager-go-sdk/models/certificatecreate) | Certificate to create. |       |

### Return type

[**CertificateRead**](https://docs.ionos.com/sections-test/go-sdk/certificate-manager-go-sdk/models/certificateread)

### 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 `"CertificateApiService.CertificatesPost"` 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{
    "CertificateApiService.CertificatesPost": 2,
})
ctx = context.WithValue(context.Background(), {packageName}.ContextOperationServerVariables, map[string]map[string]string{
    "CertificateApiService.CertificatesPost": {
    "port": "8443",
},
})
```
