Class: AsposeEmailCloud::ClientFolderApi

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

Overview

ClientFolderApi operations.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_invoker) ⇒ ClientFolderApi

Initializes a new instance of the ClientFolderApi class.

Parameters:



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

def api_invoker
  @api_invoker
end

Instance Method Details

#create(request) ⇒ nil

Create new folder in email account

Parameters:

Returns:

  • (nil)


52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/aspose-email-cloud/api/client_folder_api.rb', line 52

def create(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 ClientFolderApi.create"
  end

  local_var_path = '/email/client/folder'
  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

#delete(request) ⇒ nil

Delete a folder in email account

Parameters:

Returns:

  • (nil)


80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/aspose-email-cloud/api/client_folder_api.rb', line 80

def delete(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 ClientFolderApi.delete"
  end

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

#get_list(request) ⇒ MailServerFolderList

Get folders list in email account

Parameters:

Returns:



108
109
110
111
# File 'lib/aspose-email-cloud/api/client_folder_api.rb', line 108

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