Class: Smartsheet::Columns

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

Overview

Columns Endpoints

See Also:

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Columns

Returns a new instance of Columns.



8
9
10
# File 'lib/smartsheet/endpoints/sheets/columns.rb', line 8

def initialize(client)
  @client = client
end

Instance Method Details

#add(sheet_id:, body:, params: {}, header_overrides: {}) ⇒ Object



12
13
14
15
16
17
18
19
20
21
# File 'lib/smartsheet/endpoints/sheets/columns.rb', line 12

def add(sheet_id:, body:, params: {}, header_overrides: {})
  endpoint_spec = Smartsheet::API::EndpointSpec.new(:post, ['sheets', :sheet_id, 'columns'], body_type: :json)
  request_spec = Smartsheet::API::RequestSpec.new(
      header_overrides: header_overrides,
      params: params,
      body: body,
      sheet_id: sheet_id
  )
  client.make_request(endpoint_spec, request_spec)
end

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



23
24
25
26
27
28
29
30
31
32
# File 'lib/smartsheet/endpoints/sheets/columns.rb', line 23

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

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



34
35
36
37
38
39
40
41
42
43
# File 'lib/smartsheet/endpoints/sheets/columns.rb', line 34

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

#list(sheet_id:, params: {}, header_overrides: {}) ⇒ Object



45
46
47
48
49
50
51
52
53
# File 'lib/smartsheet/endpoints/sheets/columns.rb', line 45

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

#update(sheet_id:, column_id:, body:, params: {}, header_overrides: {}) ⇒ Object



55
56
57
58
59
60
61
62
63
64
65
# File 'lib/smartsheet/endpoints/sheets/columns.rb', line 55

def update(sheet_id:, column_id:, body:, params: {}, header_overrides: {})
  endpoint_spec = Smartsheet::API::EndpointSpec.new(:put, ['sheets', :sheet_id, 'columns', :column_id], body_type: :json)
  request_spec = Smartsheet::API::RequestSpec.new(
      header_overrides: header_overrides,
      params: params,
      body: body,
      sheet_id: sheet_id,
      column_id: column_id
  )
  client.make_request(endpoint_spec, request_spec)
end