class asposeemailcloud::EmailApi

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

email_get_document(name, opts = {}) click to toggle source

Get document

@param name @param [Hash] opts the optional parameters @option opts [String] :storage @option opts [String] :folder @return [File]

# File src/asposeemailcloud/api/email_api.rb, line 30
def email_get_document(name, opts = {})
  data, _status_code, _headers = email_get_document_with_http_info(name, opts)
  return data
end
email_get_document_with_http_info(name, opts = {}) click to toggle source

Get document

@param name @param [Hash] opts the optional parameters @option opts [String] :storage @option opts [String] :folder @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers

# File src/asposeemailcloud/api/email_api.rb, line 42
def email_get_document_with_http_info(name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: EmailApi.email_get_document ..."
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling EmailApi.email_get_document"
  end
  # resource path
  local_var_path = "/email/{name}".sub('{' + 'name' + '}', name.to_s)

  # query parameters
  query_params = {}
  query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
  query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'File')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailApi#email_get_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
email_get_email_attachment(name, attach_name, opts = {}) click to toggle source

Get email attachment

@param name @param attach_name @param [Hash] opts the optional parameters @option opts [String] :storage @option opts [String] :folder @return [File]

# File src/asposeemailcloud/api/email_api.rb, line 92
def email_get_email_attachment(name, attach_name, opts = {})
  data, _status_code, _headers = email_get_email_attachment_with_http_info(name, attach_name, opts)
  return data
end
email_get_email_attachment_with_http_info(name, attach_name, opts = {}) click to toggle source

Get email attachment

@param name @param attach_name @param [Hash] opts the optional parameters @option opts [String] :storage @option opts [String] :folder @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers

# File src/asposeemailcloud/api/email_api.rb, line 105
def email_get_email_attachment_with_http_info(name, attach_name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: EmailApi.email_get_email_attachment ..."
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling EmailApi.email_get_email_attachment"
  end
  # verify the required parameter 'attach_name' is set
  if @api_client.config.client_side_validation && attach_name.nil?
    fail ArgumentError, "Missing the required parameter 'attach_name' when calling EmailApi.email_get_email_attachment"
  end
  # resource path
  local_var_path = "/email/{name}/attachments/{attachName}".sub('{' + 'name' + '}', name.to_s).sub('{' + 'attachName' + '}', attach_name.to_s)

  # query parameters
  query_params = {}
  query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
  query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'File')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailApi#email_get_email_attachment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
email_get_email_property(property_name, name, opts = {}) click to toggle source

Get email property

@param property_name @param name @param [Hash] opts the optional parameters @option opts [String] :storage @option opts [String] :folder @return [File]

# File src/asposeemailcloud/api/email_api.rb, line 159
def email_get_email_property(property_name, name, opts = {})
  data, _status_code, _headers = email_get_email_property_with_http_info(property_name, name, opts)
  return data
end
email_get_email_property_with_http_info(property_name, name, opts = {}) click to toggle source

Get email property

@param property_name @param name @param [Hash] opts the optional parameters @option opts [String] :storage @option opts [String] :folder @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers

# File src/asposeemailcloud/api/email_api.rb, line 172
def email_get_email_property_with_http_info(property_name, name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: EmailApi.email_get_email_property ..."
  end
  # verify the required parameter 'property_name' is set
  if @api_client.config.client_side_validation && property_name.nil?
    fail ArgumentError, "Missing the required parameter 'property_name' when calling EmailApi.email_get_email_property"
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling EmailApi.email_get_email_property"
  end
  # resource path
  local_var_path = "/email/{name}/properties/{propertyName}".sub('{' + 'propertyName' + '}', property_name.to_s).sub('{' + 'name' + '}', name.to_s)

  # query parameters
  query_params = {}
  query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
  query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'File')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailApi#email_get_email_property\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
email_post_add_email_attachment(name, attach_name, opts = {}) click to toggle source

Post add email attachment

@param name @param attach_name @param [Hash] opts the optional parameters @option opts [String] :storage @option opts [String] :folder @return [EmailDocumentResponse]

# File src/asposeemailcloud/api/email_api.rb, line 226
def email_post_add_email_attachment(name, attach_name, opts = {})
  data, _status_code, _headers = email_post_add_email_attachment_with_http_info(name, attach_name, opts)
  return data
end
email_post_add_email_attachment_with_http_info(name, attach_name, opts = {}) click to toggle source

Post add email attachment

@param name @param attach_name @param [Hash] opts the optional parameters @option opts [String] :storage @option opts [String] :folder @return [Array<(EmailDocumentResponse, Fixnum, Hash)>] EmailDocumentResponse data, response status code and response headers

# File src/asposeemailcloud/api/email_api.rb, line 239
def email_post_add_email_attachment_with_http_info(name, attach_name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: EmailApi.email_post_add_email_attachment ..."
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling EmailApi.email_post_add_email_attachment"
  end
  # verify the required parameter 'attach_name' is set
  if @api_client.config.client_side_validation && attach_name.nil?
    fail ArgumentError, "Missing the required parameter 'attach_name' when calling EmailApi.email_post_add_email_attachment"
  end
  # resource path
  local_var_path = "/email/{name}/attachments".sub('{' + 'name' + '}', name.to_s)

  # query parameters
  query_params = {}
  query_params[:'attachName'] = attach_name
  query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
  query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?

  # header parameters
  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 = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'EmailDocumentResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailApi#email_post_add_email_attachment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
email_put_create_new_email(name, opts = {}) click to toggle source

Put creatw new email

@param name @param [Hash] opts the optional parameters @option opts [EmailDocument] :email @option opts [String] :storage @option opts [String] :folder @return [EmailDocumentResponse]

# File src/asposeemailcloud/api/email_api.rb, line 294
def email_put_create_new_email(name, opts = {})
  data, _status_code, _headers = email_put_create_new_email_with_http_info(name, opts)
  return data
end
email_put_create_new_email_with_http_info(name, opts = {}) click to toggle source

Put creatw new email

@param name @param [Hash] opts the optional parameters @option opts [EmailDocument] :email @option opts [String] :storage @option opts [String] :folder @return [Array<(EmailDocumentResponse, Fixnum, Hash)>] EmailDocumentResponse data, response status code and response headers

# File src/asposeemailcloud/api/email_api.rb, line 307
def email_put_create_new_email_with_http_info(name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: EmailApi.email_put_create_new_email ..."
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling EmailApi.email_put_create_new_email"
  end
  # resource path
  local_var_path = "/email/{name}".sub('{' + 'name' + '}', name.to_s)

  # query parameters
  query_params = {}
  query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
  query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?

  # header parameters
  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 = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(opts[:'email'])
  auth_names = []
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'EmailDocumentResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailApi#email_put_create_new_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
email_put_set_email_property(name, property_name, opts = {}) click to toggle source

Put set email property

@param name @param property_name @param [Hash] opts the optional parameters @option opts [EmailProperty] :property @option opts [String] :storage @option opts [String] :folder @return [EmailPropertyResponse]

# File src/asposeemailcloud/api/email_api.rb, line 358
def email_put_set_email_property(name, property_name, opts = {})
  data, _status_code, _headers = email_put_set_email_property_with_http_info(name, property_name, opts)
  return data
end
email_put_set_email_property_with_http_info(name, property_name, opts = {}) click to toggle source

Put set email property

@param name @param property_name @param [Hash] opts the optional parameters @option opts [EmailProperty] :property @option opts [String] :storage @option opts [String] :folder @return [Array<(EmailPropertyResponse, Fixnum, Hash)>] EmailPropertyResponse data, response status code and response headers

# File src/asposeemailcloud/api/email_api.rb, line 372
def email_put_set_email_property_with_http_info(name, property_name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: EmailApi.email_put_set_email_property ..."
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling EmailApi.email_put_set_email_property"
  end
  # verify the required parameter 'property_name' is set
  if @api_client.config.client_side_validation && property_name.nil?
    fail ArgumentError, "Missing the required parameter 'property_name' when calling EmailApi.email_put_set_email_property"
  end
  # resource path
  local_var_path = "/email/{name}/properties/{propertyName}".sub('{' + 'name' + '}', name.to_s).sub('{' + 'propertyName' + '}', property_name.to_s)

  # query parameters
  query_params = {}
  query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
  query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?

  # header parameters
  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 = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(opts[:'property'])
  auth_names = []
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'EmailPropertyResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailApi#email_put_set_email_property\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end