Class: AsposeEmailCloud::EmailConfigApi

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

Overview

EmailConfigApi operations.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_invoker) ⇒ EmailConfigApi

Initializes a new instance of the EmailConfigApi class.

Parameters:



45
46
47
# File 'lib/aspose-email-cloud/api/email_config_api.rb', line 45

def initialize(api_invoker)
  @api_invoker = api_invoker
end

Instance Attribute Details

#api_invokerObject (readonly)

Returns the value of attribute api_invoker.



31
32
33
# File 'lib/aspose-email-cloud/api/email_config_api.rb', line 31

def api_invoker
  @api_invoker
end

Instance Method Details

#discover(request) ⇒ EmailAccountConfigList

Discover email accounts by email address. Does not validate discovered accounts.

Parameters:

Returns:



52
53
54
55
# File 'lib/aspose-email-cloud/api/email_config_api.rb', line 52

def discover(request)
  http_request = request.to_http_info(@api_invoker.api_client)
  @api_invoker.make_request(http_request, :GET, 'EmailAccountConfigList')
end

#discover_oauth(request) ⇒ EmailAccountConfigList

Discover email accounts by email address. Validates discovered accounts using OAuth 2.0.

Parameters:

Returns:



60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/aspose-email-cloud/api/email_config_api.rb', line 60

def discover_oauth(request)
  # verify the required parameter 'request' is set
  if @api_invoker.api_client.config.client_side_validation && request.nil?
    raise ArgumentError, "Missing the required parameter 'request' when calling EmailConfigApi.discover_oauth"
  end

  local_var_path = '/email/config/discover/oauth'
  post_body = @api_invoker.api_client.object_to_http_body(request)
  auth_names = ['JWT']

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = EmailRequest.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = EmailRequest.select_header_content_type(['application/json'])
  http_request = AsposeEmailCloud::HttpRequest.new(resource_path: local_var_path,
                                                   header_params: header_params,
                                                   body: post_body,
                                                   auth_names: auth_names)

  @api_invoker.make_request(http_request, :PUT, 'EmailAccountConfigList')
end

#discover_password(request) ⇒ EmailAccountConfigList

Discover email accounts by email address. Validates discovered accounts using login and password.

Parameters:

Returns:



87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/aspose-email-cloud/api/email_config_api.rb', line 87

def discover_password(request)
  # verify the required parameter 'request' is set
  if @api_invoker.api_client.config.client_side_validation && request.nil?
    raise ArgumentError, "Missing the required parameter 'request' when calling EmailConfigApi.discover_password"
  end

  local_var_path = '/email/config/discover/password'
  post_body = @api_invoker.api_client.object_to_http_body(request)
  auth_names = ['JWT']

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = EmailRequest.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = EmailRequest.select_header_content_type(['application/json'])
  http_request = AsposeEmailCloud::HttpRequest.new(resource_path: local_var_path,
                                                   header_params: header_params,
                                                   body: post_body,
                                                   auth_names: auth_names)

  @api_invoker.make_request(http_request, :PUT, 'EmailAccountConfigList')
end