Skip to content

Latest commit

 

History

History
710 lines (450 loc) · 19.5 KB

File metadata and controls

710 lines (450 loc) · 19.5 KB

\SecurityAPI

All URIs are relative to https://api.elasticemail.com/v4

Method HTTP request Description
SecurityApikeysByNameDelete Delete /security/apikeys/{name} Delete ApiKey
SecurityApikeysByNameGet Get /security/apikeys/{name} Load ApiKey
SecurityApikeysByNamePut Put /security/apikeys/{name} Update ApiKey
SecurityApikeysGet Get /security/apikeys List ApiKeys
SecurityApikeysPost Post /security/apikeys Add ApiKey
SecuritySmtpByNameDelete Delete /security/smtp/{name} Delete SMTP Credential
SecuritySmtpByNameGet Get /security/smtp/{name} Load SMTP Credential
SecuritySmtpByNamePut Put /security/smtp/{name} Update SMTP Credential
SecuritySmtpGet Get /security/smtp List SMTP Credentials
SecuritySmtpPost Post /security/smtp Add SMTP Credential

SecurityApikeysByNameDelete

SecurityApikeysByNameDelete(ctx, name).Subaccount(subaccount).Execute()

Delete ApiKey

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/elasticemail/elasticemail-go"
)

func main() {
	name := "name_example" // string | Name of the ApiKey
	subaccount := "subaccount_example" // string | Email of the subaccount of which ApiKey should be deleted (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.SecurityAPI.SecurityApikeysByNameDelete(context.Background(), name).Subaccount(subaccount).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SecurityAPI.SecurityApikeysByNameDelete``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
name string Name of the ApiKey

Other Parameters

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

Name Type Description Notes

subaccount | string | Email of the subaccount of which ApiKey should be deleted |

Return type

(empty response body)

Authorization

apikey

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

SecurityApikeysByNameGet

ApiKey SecurityApikeysByNameGet(ctx, name).Subaccount(subaccount).Execute()

Load ApiKey

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/elasticemail/elasticemail-go"
)

func main() {
	name := "name_example" // string | Name of the ApiKey
	subaccount := "subaccount_example" // string | Email of the subaccount of which ApiKey should be loaded. The default API key created for the subaccount has a 48-hour expiration period. (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.SecurityAPI.SecurityApikeysByNameGet(context.Background(), name).Subaccount(subaccount).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SecurityAPI.SecurityApikeysByNameGet``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `SecurityApikeysByNameGet`: ApiKey
	fmt.Fprintf(os.Stdout, "Response from `SecurityAPI.SecurityApikeysByNameGet`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
name string Name of the ApiKey

Other Parameters

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

Name Type Description Notes

subaccount | string | Email of the subaccount of which ApiKey should be loaded. The default API key created for the subaccount has a 48-hour expiration period. |

Return type

ApiKey

Authorization

apikey

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

SecurityApikeysByNamePut

ApiKey SecurityApikeysByNamePut(ctx, name).ApiKeyPayload(apiKeyPayload).Execute()

Update ApiKey

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/elasticemail/elasticemail-go"
)

func main() {
	name := "name_example" // string | Name of the ApiKey
	apiKeyPayload := *openapiclient.NewApiKeyPayload("Name_example", []openapiclient.AccessLevel{openapiclient.AccessLevel("None")}) // ApiKeyPayload | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.SecurityAPI.SecurityApikeysByNamePut(context.Background(), name).ApiKeyPayload(apiKeyPayload).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SecurityAPI.SecurityApikeysByNamePut``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `SecurityApikeysByNamePut`: ApiKey
	fmt.Fprintf(os.Stdout, "Response from `SecurityAPI.SecurityApikeysByNamePut`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
name string Name of the ApiKey

Other Parameters

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

Name Type Description Notes

apiKeyPayload | ApiKeyPayload | |

Return type

ApiKey

Authorization

apikey

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

SecurityApikeysGet

[]ApiKey SecurityApikeysGet(ctx).Subaccount(subaccount).Execute()

List ApiKeys

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/elasticemail/elasticemail-go"
)

func main() {
	subaccount := "subaccount_example" // string | Email of the subaccount of which ApiKeys should be loaded. The default API key created for the subaccount has a 48-hour expiration period. (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.SecurityAPI.SecurityApikeysGet(context.Background()).Subaccount(subaccount).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SecurityAPI.SecurityApikeysGet``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `SecurityApikeysGet`: []ApiKey
	fmt.Fprintf(os.Stdout, "Response from `SecurityAPI.SecurityApikeysGet`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
subaccount string Email of the subaccount of which ApiKeys should be loaded. The default API key created for the subaccount has a 48-hour expiration period.

Return type

[]ApiKey

Authorization

apikey

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

SecurityApikeysPost

NewApiKey SecurityApikeysPost(ctx).ApiKeyPayload(apiKeyPayload).Execute()

Add ApiKey

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/elasticemail/elasticemail-go"
)

func main() {
	apiKeyPayload := *openapiclient.NewApiKeyPayload("Name_example", []openapiclient.AccessLevel{openapiclient.AccessLevel("None")}) // ApiKeyPayload | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.SecurityAPI.SecurityApikeysPost(context.Background()).ApiKeyPayload(apiKeyPayload).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SecurityAPI.SecurityApikeysPost``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `SecurityApikeysPost`: NewApiKey
	fmt.Fprintf(os.Stdout, "Response from `SecurityAPI.SecurityApikeysPost`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
apiKeyPayload ApiKeyPayload

Return type

NewApiKey

Authorization

apikey

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

SecuritySmtpByNameDelete

SecuritySmtpByNameDelete(ctx, name).Subaccount(subaccount).Execute()

Delete SMTP Credential

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/elasticemail/elasticemail-go"
)

func main() {
	name := "name_example" // string | Name of the SMTP Credential
	subaccount := "subaccount_example" // string | Email of the subaccount of which credential should be deleted (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.SecurityAPI.SecuritySmtpByNameDelete(context.Background(), name).Subaccount(subaccount).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SecurityAPI.SecuritySmtpByNameDelete``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
name string Name of the SMTP Credential

Other Parameters

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

Name Type Description Notes

subaccount | string | Email of the subaccount of which credential should be deleted |

Return type

(empty response body)

Authorization

apikey

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

SecuritySmtpByNameGet

SmtpCredentials SecuritySmtpByNameGet(ctx, name).Subaccount(subaccount).Execute()

Load SMTP Credential

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/elasticemail/elasticemail-go"
)

func main() {
	name := "name_example" // string | Name of the SMTP Credential
	subaccount := "subaccount_example" // string | Email of the subaccount of which credential should be loaded (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.SecurityAPI.SecuritySmtpByNameGet(context.Background(), name).Subaccount(subaccount).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SecurityAPI.SecuritySmtpByNameGet``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `SecuritySmtpByNameGet`: SmtpCredentials
	fmt.Fprintf(os.Stdout, "Response from `SecurityAPI.SecuritySmtpByNameGet`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
name string Name of the SMTP Credential

Other Parameters

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

Name Type Description Notes

subaccount | string | Email of the subaccount of which credential should be loaded |

Return type

SmtpCredentials

Authorization

apikey

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

SecuritySmtpByNamePut

SmtpCredentials SecuritySmtpByNamePut(ctx, name).SmtpCredentialsPayload(smtpCredentialsPayload).Execute()

Update SMTP Credential

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/elasticemail/elasticemail-go"
)

func main() {
	name := "name_example" // string | Name of the SMTP Credential
	smtpCredentialsPayload := *openapiclient.NewSmtpCredentialsPayload("Name_example") // SmtpCredentialsPayload | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.SecurityAPI.SecuritySmtpByNamePut(context.Background(), name).SmtpCredentialsPayload(smtpCredentialsPayload).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SecurityAPI.SecuritySmtpByNamePut``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `SecuritySmtpByNamePut`: SmtpCredentials
	fmt.Fprintf(os.Stdout, "Response from `SecurityAPI.SecuritySmtpByNamePut`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
name string Name of the SMTP Credential

Other Parameters

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

Name Type Description Notes

smtpCredentialsPayload | SmtpCredentialsPayload | |

Return type

SmtpCredentials

Authorization

apikey

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

SecuritySmtpGet

[]SmtpCredentials SecuritySmtpGet(ctx).Subaccount(subaccount).Execute()

List SMTP Credentials

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/elasticemail/elasticemail-go"
)

func main() {
	subaccount := "subaccount_example" // string | Email of the subaccount of which credentials should be listed (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.SecurityAPI.SecuritySmtpGet(context.Background()).Subaccount(subaccount).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SecurityAPI.SecuritySmtpGet``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `SecuritySmtpGet`: []SmtpCredentials
	fmt.Fprintf(os.Stdout, "Response from `SecurityAPI.SecuritySmtpGet`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
subaccount string Email of the subaccount of which credentials should be listed

Return type

[]SmtpCredentials

Authorization

apikey

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

SecuritySmtpPost

NewSmtpCredentials SecuritySmtpPost(ctx).SmtpCredentialsPayload(smtpCredentialsPayload).Execute()

Add SMTP Credential

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/elasticemail/elasticemail-go"
)

func main() {
	smtpCredentialsPayload := *openapiclient.NewSmtpCredentialsPayload("Name_example") // SmtpCredentialsPayload | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.SecurityAPI.SecuritySmtpPost(context.Background()).SmtpCredentialsPayload(smtpCredentialsPayload).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SecurityAPI.SecuritySmtpPost``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `SecuritySmtpPost`: NewSmtpCredentials
	fmt.Fprintf(os.Stdout, "Response from `SecurityAPI.SecuritySmtpPost`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
smtpCredentialsPayload SmtpCredentialsPayload

Return type

NewSmtpCredentials

Authorization

apikey

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]