Method: AsposeCellsCloud::PostWorksheetPictureRequest#create_http_request

Defined in:
lib/aspose_cells_cloud/requests/post_worksheet_picture_request.rb

#create_http_request(api_client, opts = {}) ⇒ Object



96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# File 'lib/aspose_cells_cloud/requests/post_worksheet_picture_request.rb', line 96

def create_http_request(api_client,opts = {})
  if api_client.config.debugging
    api_client.config.logger.debug "Calling API: CellsApi.post_worksheet_picture ..."
  end
  api_client.request_token_if_needed
  # verify the required parameter 'name' is set

  if api_client.config.client_side_validation && name.nil?
      fail ArgumentError, "Missing the required parameter 'name' when calling CellsApi.post_worksheet_picture "
  end 
  # verify the required parameter 'sheet_name' is set

  if api_client.config.client_side_validation && sheet_name.nil?
      fail ArgumentError, "Missing the required parameter 'sheet_name' when calling CellsApi.post_worksheet_picture "
  end 
  # verify the required parameter 'picture_index' is set

  if api_client.config.client_side_validation && picture_index.nil?
      fail ArgumentError, "Missing the required parameter 'picture_index' when calling CellsApi.post_worksheet_picture "
  end 
  # verify the required parameter 'picture' is set

  if api_client.config.client_side_validation && picture.nil?
      fail ArgumentError, "Missing the required parameter 'picture' when calling CellsApi.post_worksheet_picture "
  end 

  # resource path

  local_var_path = "v3.0/cells/{name}/worksheets/{sheetName}/pictures/{pictureIndex}".sub('{' + 'name' + '}', name.to_s).sub('{' + 'sheetName' + '}', sheet_name.to_s).sub('{' + 'pictureIndex' + '}', picture_index.to_s)
  # query parameters

  query_params = {}
  query_params[:'folder'] = self.folder if !self.folder.nil? 
  query_params[:'storageName'] = self.storage_name if !self.storage_name.nil? 

  # header parameters

  header_params = {}
  # HTTP header 'Accept' (if needed)

  header_params['Accept'] = api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'

  header_params['Content-Type'] = api_client.select_header_content_type(['application/json'])

  # form parameters

  form_params = {}
  post_body = nil 
  post_body = api_client.object_to_http_body(picture) 

  #auth_names = []

  auth_names = ['JWT']
  data, status_code, headers = api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CellsCloudResponse')
  if api_client.config.debugging
    api_client.config.logger.debug "API called: Specification.Name>Api.post_worksheet_picture\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end