Skip to content

Latest commit

 

History

History
428 lines (270 loc) · 11.8 KB

File metadata and controls

428 lines (270 loc) · 11.8 KB

\SubAccountsAPI

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

Method HTTP request Description
SubaccountsByEmailCreditsPatch Patch /subaccounts/{email}/credits Add, Subtract Email Credits
SubaccountsByEmailDelete Delete /subaccounts/{email} Delete SubAccount
SubaccountsByEmailGet Get /subaccounts/{email} Load SubAccount
SubaccountsByEmailSettingsEmailPut Put /subaccounts/{email}/settings/email Update SubAccount Email Settings
SubaccountsGet Get /subaccounts Load SubAccounts
SubaccountsPost Post /subaccounts Add SubAccount

SubaccountsByEmailCreditsPatch

SubaccountsByEmailCreditsPatch(ctx, email).SubaccountEmailCreditsPayload(subaccountEmailCreditsPayload).Execute()

Add, Subtract Email Credits

Example

package main

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

func main() {
	email := "mail@example.com" // string | Email address of Sub-Account
	subaccountEmailCreditsPayload := *openapiclient.NewSubaccountEmailCreditsPayload(int32(123)) // SubaccountEmailCreditsPayload | Amount of email credits to add or subtract from the current SubAccount email credits pool (positive or negative value)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.SubAccountsAPI.SubaccountsByEmailCreditsPatch(context.Background(), email).SubaccountEmailCreditsPayload(subaccountEmailCreditsPayload).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SubAccountsAPI.SubaccountsByEmailCreditsPatch``: %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.
email string Email address of Sub-Account

Other Parameters

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

Name Type Description Notes

subaccountEmailCreditsPayload | SubaccountEmailCreditsPayload | Amount of email credits to add or subtract from the current SubAccount email credits pool (positive or negative value) |

Return type

(empty response body)

Authorization

apikey

HTTP request headers

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

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

SubaccountsByEmailDelete

SubaccountsByEmailDelete(ctx, email).Execute()

Delete SubAccount

Example

package main

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

func main() {
	email := "mail@example.com" // string | Email address of Sub-Account

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.SubAccountsAPI.SubaccountsByEmailDelete(context.Background(), email).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SubAccountsAPI.SubaccountsByEmailDelete``: %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.
email string Email address of Sub-Account

Other Parameters

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

Name Type Description Notes

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]

SubaccountsByEmailGet

SubAccountInfo SubaccountsByEmailGet(ctx, email).Execute()

Load SubAccount

Example

package main

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

func main() {
	email := "mail@example.com" // string | Email address of Sub-Account

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
email string Email address of Sub-Account

Other Parameters

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

Name Type Description Notes

Return type

SubAccountInfo

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]

SubaccountsByEmailSettingsEmailPut

SubaccountEmailSettings SubaccountsByEmailSettingsEmailPut(ctx, email).SubaccountEmailSettings(subaccountEmailSettings).Execute()

Update SubAccount Email Settings

Example

package main

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

func main() {
	email := "email_example" // string | 
	subaccountEmailSettings := *openapiclient.NewSubaccountEmailSettings() // SubaccountEmailSettings | Updated Email Settings

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
email string

Other Parameters

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

Name Type Description Notes

subaccountEmailSettings | SubaccountEmailSettings | Updated Email Settings |

Return type

SubaccountEmailSettings

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]

SubaccountsGet

[]SubAccountInfo SubaccountsGet(ctx).Limit(limit).Offset(offset).Execute()

Load SubAccounts

Example

package main

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

func main() {
	limit := int32(100) // int32 | Maximum number of returned items. (optional)
	offset := int32(20) // int32 | How many items should be returned ahead. (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.SubAccountsAPI.SubaccountsGet(context.Background()).Limit(limit).Offset(offset).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SubAccountsAPI.SubaccountsGet``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `SubaccountsGet`: []SubAccountInfo
	fmt.Fprintf(os.Stdout, "Response from `SubAccountsAPI.SubaccountsGet`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
limit int32 Maximum number of returned items.
offset int32 How many items should be returned ahead.

Return type

[]SubAccountInfo

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]

SubaccountsPost

SubAccountInfo SubaccountsPost(ctx).SubaccountPayload(subaccountPayload).Execute()

Add SubAccount

Example

package main

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

func main() {
	subaccountPayload := *openapiclient.NewSubaccountPayload("mail@example.com", "********") // SubaccountPayload | 

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

Path Parameters

Other Parameters

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

Name Type Description Notes
subaccountPayload SubaccountPayload

Return type

SubAccountInfo

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]