class ElasticEmail::SubAccountsApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/ElasticEmail/api/sub_accounts_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

subaccounts_by_email_credits_patch(email, subaccount_email_credits_payload, opts = {}) click to toggle source

Add, Subtract Email Credits Update email credits of a subaccount by the given amount. Required Access Level: ModifySubAccounts @param email [String] Email address of Sub-Account @param subaccount_email_credits_payload [SubaccountEmailCreditsPayload] Amount of email credits to add or subtract from the current SubAccount email credits pool (positive or negative value) @param [Hash] opts the optional parameters @return [nil]

# File lib/ElasticEmail/api/sub_accounts_api.rb, line 28
def subaccounts_by_email_credits_patch(email, subaccount_email_credits_payload, opts = {})
  subaccounts_by_email_credits_patch_with_http_info(email, subaccount_email_credits_payload, opts)
  nil
end
subaccounts_by_email_credits_patch_with_http_info(email, subaccount_email_credits_payload, opts = {}) click to toggle source

Add, Subtract Email Credits Update email credits of a subaccount by the given amount. Required Access Level: ModifySubAccounts @param email [String] Email address of Sub-Account @param subaccount_email_credits_payload [SubaccountEmailCreditsPayload] Amount of email credits to add or subtract from the current SubAccount email credits pool (positive or negative value) @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/ElasticEmail/api/sub_accounts_api.rb, line 39
def subaccounts_by_email_credits_patch_with_http_info(email, subaccount_email_credits_payload, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SubAccountsApi.subaccounts_by_email_credits_patch ...'
  end
  # verify the required parameter 'email' is set
  if @api_client.config.client_side_validation && email.nil?
    fail ArgumentError, "Missing the required parameter 'email' when calling SubAccountsApi.subaccounts_by_email_credits_patch"
  end
  # verify the required parameter 'subaccount_email_credits_payload' is set
  if @api_client.config.client_side_validation && subaccount_email_credits_payload.nil?
    fail ArgumentError, "Missing the required parameter 'subaccount_email_credits_payload' when calling SubAccountsApi.subaccounts_by_email_credits_patch"
  end
  # resource path
  local_var_path = '/subaccounts/{email}/credits'.sub('{' + 'email' + '}', CGI.escape(email.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(subaccount_email_credits_payload)

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apikey']

  new_options = opts.merge(
    :operation => :"SubAccountsApi.subaccounts_by_email_credits_patch",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubAccountsApi#subaccounts_by_email_credits_patch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
subaccounts_by_email_delete(email, opts = {}) click to toggle source

Delete SubAccount Deletes specified SubAccount. An email will be sent to confirm this change. Required Access Level: ModifySubAccounts @param email [String] Email address of Sub-Account @param [Hash] opts the optional parameters @return [nil]

# File lib/ElasticEmail/api/sub_accounts_api.rb, line 96
def subaccounts_by_email_delete(email, opts = {})
  subaccounts_by_email_delete_with_http_info(email, opts)
  nil
end
subaccounts_by_email_delete_with_http_info(email, opts = {}) click to toggle source

Delete SubAccount Deletes specified SubAccount. An email will be sent to confirm this change. Required Access Level: ModifySubAccounts @param email [String] Email address of Sub-Account @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/ElasticEmail/api/sub_accounts_api.rb, line 106
def subaccounts_by_email_delete_with_http_info(email, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SubAccountsApi.subaccounts_by_email_delete ...'
  end
  # verify the required parameter 'email' is set
  if @api_client.config.client_side_validation && email.nil?
    fail ArgumentError, "Missing the required parameter 'email' when calling SubAccountsApi.subaccounts_by_email_delete"
  end
  # resource path
  local_var_path = '/subaccounts/{email}'.sub('{' + 'email' + '}', CGI.escape(email.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apikey']

  new_options = opts.merge(
    :operation => :"SubAccountsApi.subaccounts_by_email_delete",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubAccountsApi#subaccounts_by_email_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
subaccounts_by_email_get(email, opts = {}) click to toggle source

Load SubAccount Returns details for the specified SubAccount. Required Access Level: ViewSubAccounts @param email [String] Email address of Sub-Account @param [Hash] opts the optional parameters @return [SubAccountInfo]

# File lib/ElasticEmail/api/sub_accounts_api.rb, line 157
def subaccounts_by_email_get(email, opts = {})
  data, _status_code, _headers = subaccounts_by_email_get_with_http_info(email, opts)
  data
end
subaccounts_by_email_get_with_http_info(email, opts = {}) click to toggle source

Load SubAccount Returns details for the specified SubAccount. Required Access Level: ViewSubAccounts @param email [String] Email address of Sub-Account @param [Hash] opts the optional parameters @return [Array<(SubAccountInfo, Integer, Hash)>] SubAccountInfo data, response status code and response headers

# File lib/ElasticEmail/api/sub_accounts_api.rb, line 167
def subaccounts_by_email_get_with_http_info(email, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SubAccountsApi.subaccounts_by_email_get ...'
  end
  # verify the required parameter 'email' is set
  if @api_client.config.client_side_validation && email.nil?
    fail ArgumentError, "Missing the required parameter 'email' when calling SubAccountsApi.subaccounts_by_email_get"
  end
  # resource path
  local_var_path = '/subaccounts/{email}'.sub('{' + 'email' + '}', CGI.escape(email.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'SubAccountInfo'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apikey']

  new_options = opts.merge(
    :operation => :"SubAccountsApi.subaccounts_by_email_get",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubAccountsApi#subaccounts_by_email_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
subaccounts_by_email_settings_email_put(email, subaccount_email_settings, opts = {}) click to toggle source

Update SubAccount Email Settings Update SubAccount email settings. Required Access Level: ModifySubAccounts @param email [String] @param subaccount_email_settings [SubaccountEmailSettings] Updated Email Settings @param [Hash] opts the optional parameters @return [SubaccountEmailSettings]

# File lib/ElasticEmail/api/sub_accounts_api.rb, line 221
def subaccounts_by_email_settings_email_put(email, subaccount_email_settings, opts = {})
  data, _status_code, _headers = subaccounts_by_email_settings_email_put_with_http_info(email, subaccount_email_settings, opts)
  data
end
subaccounts_by_email_settings_email_put_with_http_info(email, subaccount_email_settings, opts = {}) click to toggle source

Update SubAccount Email Settings Update SubAccount email settings. Required Access Level: ModifySubAccounts @param email [String] @param subaccount_email_settings [SubaccountEmailSettings] Updated Email Settings @param [Hash] opts the optional parameters @return [Array<(SubaccountEmailSettings, Integer, Hash)>] SubaccountEmailSettings data, response status code and response headers

# File lib/ElasticEmail/api/sub_accounts_api.rb, line 232
def subaccounts_by_email_settings_email_put_with_http_info(email, subaccount_email_settings, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SubAccountsApi.subaccounts_by_email_settings_email_put ...'
  end
  # verify the required parameter 'email' is set
  if @api_client.config.client_side_validation && email.nil?
    fail ArgumentError, "Missing the required parameter 'email' when calling SubAccountsApi.subaccounts_by_email_settings_email_put"
  end
  # verify the required parameter 'subaccount_email_settings' is set
  if @api_client.config.client_side_validation && subaccount_email_settings.nil?
    fail ArgumentError, "Missing the required parameter 'subaccount_email_settings' when calling SubAccountsApi.subaccounts_by_email_settings_email_put"
  end
  # resource path
  local_var_path = '/subaccounts/{email}/settings/email'.sub('{' + 'email' + '}', CGI.escape(email.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(subaccount_email_settings)

  # return_type
  return_type = opts[:debug_return_type] || 'SubaccountEmailSettings'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apikey']

  new_options = opts.merge(
    :operation => :"SubAccountsApi.subaccounts_by_email_settings_email_put",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubAccountsApi#subaccounts_by_email_settings_email_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
subaccounts_get(opts = {}) click to toggle source

Load SubAccounts Returns a list of all your SubAccounts. Required Access Level: ViewSubAccounts @param [Hash] opts the optional parameters @option opts [Integer] :limit Maximum number of returned items. @option opts [Integer] :offset How many items should be returned ahead. @return [Array<SubAccountInfo>]

# File lib/ElasticEmail/api/sub_accounts_api.rb, line 292
def subaccounts_get(opts = {})
  data, _status_code, _headers = subaccounts_get_with_http_info(opts)
  data
end
subaccounts_get_with_http_info(opts = {}) click to toggle source

Load SubAccounts Returns a list of all your SubAccounts. Required Access Level: ViewSubAccounts @param [Hash] opts the optional parameters @option opts [Integer] :limit Maximum number of returned items. @option opts [Integer] :offset How many items should be returned ahead. @return [Array<(Array<SubAccountInfo>, Integer, Hash)>] Array<SubAccountInfo> data, response status code and response headers

# File lib/ElasticEmail/api/sub_accounts_api.rb, line 303
def subaccounts_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SubAccountsApi.subaccounts_get ...'
  end
  # resource path
  local_var_path = '/subaccounts'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<SubAccountInfo>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apikey']

  new_options = opts.merge(
    :operation => :"SubAccountsApi.subaccounts_get",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubAccountsApi#subaccounts_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
subaccounts_post(subaccount_payload, opts = {}) click to toggle source

Add SubAccount Add a new SubAccount to your Account. To receive an access token for this SubAccount, make a POST security/apikeys request using the 'subaccount' parameter. Required Access Level: ModifySubAccounts @param subaccount_payload [SubaccountPayload] @param [Hash] opts the optional parameters @return [SubAccountInfo]

# File lib/ElasticEmail/api/sub_accounts_api.rb, line 354
def subaccounts_post(subaccount_payload, opts = {})
  data, _status_code, _headers = subaccounts_post_with_http_info(subaccount_payload, opts)
  data
end
subaccounts_post_with_http_info(subaccount_payload, opts = {}) click to toggle source

Add SubAccount Add a new SubAccount to your Account. To receive an access token for this SubAccount, make a POST security/apikeys request using the &#39;subaccount&#39; parameter. Required Access Level: ModifySubAccounts @param subaccount_payload [SubaccountPayload] @param [Hash] opts the optional parameters @return [Array<(SubAccountInfo, Integer, Hash)>] SubAccountInfo data, response status code and response headers

# File lib/ElasticEmail/api/sub_accounts_api.rb, line 364
def subaccounts_post_with_http_info(subaccount_payload, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SubAccountsApi.subaccounts_post ...'
  end
  # verify the required parameter 'subaccount_payload' is set
  if @api_client.config.client_side_validation && subaccount_payload.nil?
    fail ArgumentError, "Missing the required parameter 'subaccount_payload' when calling SubAccountsApi.subaccounts_post"
  end
  # resource path
  local_var_path = '/subaccounts'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(subaccount_payload)

  # return_type
  return_type = opts[:debug_return_type] || 'SubAccountInfo'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apikey']

  new_options = opts.merge(
    :operation => :"SubAccountsApi.subaccounts_post",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubAccountsApi#subaccounts_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end