Class: AsposeEmailCloud::MapiCalendarApi

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

Overview

MapiCalendarApi operations.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_invoker) ⇒ MapiCalendarApi

Initializes a new instance of the MapiCalendarApi class.

Parameters:



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

def api_invoker
  @api_invoker
end

Instance Method Details

#as_calendar_dto(mapi_calendar_dto) ⇒ CalendarDto

Converts MAPI calendar model to CalendarDto model.

Parameters:

Returns:



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

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

  local_var_path = '/email/MapiCalendar/as-calendar-dto'
  post_body = @api_invoker.api_client.object_to_http_body(mapi_calendar_dto)
  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, 'CalendarDto')
end

#as_file(request) ⇒ File

Converts MAPI calendar model to specified format and returns as file.

Parameters:

Returns:

  • (File)


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

def as_file(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 MapiCalendarApi.as_file"
  end

  local_var_path = '/email/MapiCalendar/as-file'
  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(['multipart/form-data'])
  # 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, 'File')
end

#from_file(request) ⇒ MapiCalendarDto

Converts calendar file to a MAPI model representation.

Parameters:

Returns:



106
107
108
109
# File 'lib/aspose-email-cloud/api/mapi_calendar_api.rb', line 106

def from_file(request)
  http_request = request.to_http_info(@api_invoker.api_client)
  @api_invoker.make_request(http_request, :PUT, 'MapiCalendarDto')
end

#get(request) ⇒ MapiCalendarDto

Get MAPI calendar document.

Parameters:

Returns:



114
115
116
117
# File 'lib/aspose-email-cloud/api/mapi_calendar_api.rb', line 114

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

#save(request) ⇒ nil

Save MAPI Calendar to storage.

Parameters:

Returns:

  • (nil)


122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# File 'lib/aspose-email-cloud/api/mapi_calendar_api.rb', line 122

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 MapiCalendarApi.save"
  end

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