Class: AsposeEmailCloud::MoveFileRequestData

Inherits:
EmailRequest show all
Defined in:
lib/aspose-email-cloud/models/requests/move_file_request_data.rb

Overview

Request model for move_file operation.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(src_path, dest_path, src_storage_name = nil, dest_storage_name = nil, version_id = nil) ⇒ MoveFileRequestData

Move file

Parameters:

  • src_path (String)

    Source file path e.g. '/src.ext'

  • dest_path (String)

    Destination file path e.g. '/dest.ext'

  • src_storage_name (String) (defaults to: nil)

    Source storage name

  • dest_storage_name (String) (defaults to: nil)

    Destination storage name

  • version_id (String) (defaults to: nil)

    File version ID to move



57
58
59
60
61
62
63
# File 'lib/aspose-email-cloud/models/requests/move_file_request_data.rb', line 57

def initialize(src_path, dest_path, src_storage_name = nil, dest_storage_name = nil, version_id = nil)
  self.src_path = src_path if src_path
  self.dest_path = dest_path if dest_path
  self.src_storage_name = src_storage_name if src_storage_name
  self.dest_storage_name = dest_storage_name if dest_storage_name
  self.version_id = version_id if version_id
end

Instance Attribute Details

#dest_pathString

Destination file path e.g. '/dest.ext'

Returns:

  • (String)


40
41
42
# File 'lib/aspose-email-cloud/models/requests/move_file_request_data.rb', line 40

def dest_path
  @dest_path
end

#dest_storage_nameString

Destination storage name

Returns:

  • (String)


46
47
48
# File 'lib/aspose-email-cloud/models/requests/move_file_request_data.rb', line 46

def dest_storage_name
  @dest_storage_name
end

#src_pathString

Source file path e.g. '/src.ext'

Returns:

  • (String)


37
38
39
# File 'lib/aspose-email-cloud/models/requests/move_file_request_data.rb', line 37

def src_path
  @src_path
end

#src_storage_nameString

Source storage name

Returns:

  • (String)


43
44
45
# File 'lib/aspose-email-cloud/models/requests/move_file_request_data.rb', line 43

def src_storage_name
  @src_storage_name
end

#version_idString

File version ID to move

Returns:

  • (String)


49
50
51
# File 'lib/aspose-email-cloud/models/requests/move_file_request_data.rb', line 49

def version_id
  @version_id
end

Instance Method Details

#to_http_info(api_client) ⇒ Object



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/aspose-email-cloud/models/requests/move_file_request_data.rb', line 65

def to_http_info(api_client)
  # verify the required parameter 'src_path' is set
  if api_client.config.client_side_validation && self.src_path.nil?
    raise ArgumentError, "Missing the required parameter 'src_path' when calling EmailApi.move_file"
  end

  # verify the required parameter 'dest_path' is set
  if api_client.config.client_side_validation && self.dest_path.nil?
    raise ArgumentError, "Missing the required parameter 'dest_path' when calling EmailApi.move_file"
  end

  # resource path
  local_var_path = '/email/storage/file/move/{srcPath}'.sub('{' + 'srcPath' + '}', self.src_path.to_s)

  # query parameters
  query_params = {}
  query_params[:destPath] = self.dest_path
  query_params[:srcStorageName] = self.src_storage_name unless self.src_storage_name.nil?
  query_params[:destStorageName] = self.dest_storage_name unless self.dest_storage_name.nil?
  query_params[:versionId] = self.version_id unless self.version_id.nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['JWT']

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = form_params.any? ? 'multipart/form-data' : select_header_content_type(['application/json'])

  AsposeEmailCloud::HttpRequest.new(local_var_path,
                                  header_params,
                                  query_params,
                                  form_params,
                                  post_body,
                                  auth_names)
end