Class: Smartsheet::Cells

Inherits:
Object
  • Object
show all
Defined in:
lib/smartsheet/endpoints/sheets/cells.rb

Overview

Cells Endpoints

See Also:

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Cells

Returns a new instance of Cells.



10
11
12
# File 'lib/smartsheet/endpoints/sheets/cells.rb', line 10

def initialize(client)
  @client = client
end

Instance Method Details

#add_image(sheet_id:, row_id:, column_id:, file:, filename:, file_length:, content_type: '', params: {}, header_overrides: {}) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/smartsheet/endpoints/sheets/cells.rb', line 29

def add_image(
    sheet_id:,
    row_id:,
    column_id:,
    file:,
    filename:,
    file_length:,
    content_type: '',
    params: {},
    header_overrides: {}
)
  endpoint_spec = Smartsheet::API::EndpointSpec.new(
      :post,
      ['sheets', :sheet_id, 'rows', :row_id, 'columns', :column_id, 'cellimages'],
      body_type: :file
  )
  request_spec = Smartsheet::API::RequestSpec.new(
      header_overrides: header_overrides,
      params: params,
      file_spec: Smartsheet::API::ObjectFileSpec.new(file, filename, file_length, content_type),
      sheet_id: sheet_id,
      row_id: row_id,
      column_id: column_id
  )
  client.make_request(endpoint_spec, request_spec)
end

#add_image_from_path(sheet_id:, row_id:, column_id:, path:, filename: '', content_type: '', params: {}, header_overrides: {}) ⇒ Object



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/smartsheet/endpoints/sheets/cells.rb', line 56

def add_image_from_path(
    sheet_id:,
    row_id:,
    column_id:,
    path:,
    filename: '',
    content_type: '',
    params: {},
    header_overrides: {}
)
  endpoint_spec = Smartsheet::API::EndpointSpec.new(
      :post,
      ['sheets', :sheet_id, 'rows', :row_id, 'columns', :column_id, 'cellimages'],
      body_type: :file
  )
  request_spec = Smartsheet::API::RequestSpec.new(
      header_overrides: header_overrides,
      params: params,
      file_spec: Smartsheet::API::PathFileSpec.new(path, filename, content_type),
      sheet_id: sheet_id,
      row_id: row_id,
      column_id: column_id
  )
  client.make_request(endpoint_spec, request_spec)
end

#get_history(sheet_id:, row_id:, column_id:, params: {}, header_overrides: {}) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/smartsheet/endpoints/sheets/cells.rb', line 14

def get_history(sheet_id:, row_id:, column_id:, params: {}, header_overrides: {})
  endpoint_spec = Smartsheet::API::EndpointSpec.new(
      :get,
      ['sheets', :sheet_id, 'rows', :row_id, 'columns', :column_id, 'history']
  )
  request_spec = Smartsheet::API::RequestSpec.new(
      header_overrides: header_overrides,
      params: params,
      sheet_id: sheet_id,
      row_id: row_id,
      column_id: column_id
  )
  client.make_request(endpoint_spec, request_spec)
end