Class: AsposeEmailCloud::EmailRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/aspose-email-cloud/models/email_request.rb

Overview

Base class for requests with basic operations

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.select_header_accept(accepts) ⇒ String

Return Accept header based on an array of accepts provided.

Parameters:

  • accepts (Array)

    array for Accept

Returns:

  • (String)

    the Accept header (e.g. application/json)



36
37
38
39
40
41
42
# File 'lib/aspose-email-cloud/models/email_request.rb', line 36

def self.select_header_accept(accepts)
  return nil if accepts.nil? || accepts.empty?

  # use JSON when present, otherwise use all of the provided
  json_accept = accepts.find { |s| EmailRequest.json_mime?(s) }
  json_accept || accepts.join(',')
end

.select_header_content_type(content_types) ⇒ String

Return Content-Type header based on an array of content types provided.

Parameters:

  • content_types (Array)

    array for Content-Type

Returns:

  • (String)

    the Content-Type header (e.g. application/json)



47
48
49
50
51
52
53
54
# File 'lib/aspose-email-cloud/models/email_request.rb', line 47

def self.select_header_content_type(content_types)
  # use application/json by default
  return 'application/json' if content_types.nil? || content_types.empty?

  # use JSON when present, otherwise use the first one
  json_content_type = content_types.find { |s| EmailRequest.json_mime?(s) }
  json_content_type || content_types.first
end

Instance Method Details

#to_http_info(config) ⇒ Object



31
# File 'lib/aspose-email-cloud/models/email_request.rb', line 31

def to_http_info(config); end