Class: AsposeEmailCloud::ClientAccountApi

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

Overview

ClientAccountApi operations.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_invoker) ⇒ ClientAccountApi

Initializes a new instance of the ClientAccountApi class.

Parameters:



45
46
47
# File 'lib/aspose-email-cloud/api/client_account_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/client_account_api.rb', line 31

def api_invoker
  @api_invoker
end

Instance Method Details

#get(request) ⇒ EmailClientAccount

Get email client account from storage.

Parameters:

Returns:



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

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

#get_multi(request) ⇒ EmailClientMultiAccount

Get email client multi account file (*.multi.account). Will respond error if file extension is not ".multi.account".

Parameters:

Returns:



60
61
62
63
# File 'lib/aspose-email-cloud/api/client_account_api.rb', line 60

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

#save(request) ⇒ nil

Create/update email client account file (*.account) with credentials

Parameters:

Returns:

  • (nil)


68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/aspose-email-cloud/api/client_account_api.rb', line 68

def save(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 ClientAccountApi.save"
  end

  local_var_path = '/email/client/account'
  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, nil)
  nil
end

#save_multi(request) ⇒ nil

Create email client multi account file (*.multi.account). Will respond error if file extension is not ".multi.account".

Parameters:

Returns:

  • (nil)


96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# File 'lib/aspose-email-cloud/api/client_account_api.rb', line 96

def save_multi(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 ClientAccountApi.save_multi"
  end

  local_var_path = '/email/client/account/multi'
  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, nil)
  nil
end