Class: Smartsheet::SheetsSummaries

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

Overview

Sheet Summaries Endpoints

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ SheetsSummaries

Returns a new instance of SheetsSummaries.



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

def initialize(client)
  @client = client
end

Instance Method Details

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



34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/smartsheet/endpoints/sheets/sheets_summaries.rb', line 34

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

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



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/smartsheet/endpoints/sheets/sheets_summaries.rb', line 74

def add_image(
    sheet_id:,
    field_id:,
    file:,
    filename:,
    file_length:,
    content_type: '',
    params: {},
    header_overrides: {}
)
  endpoint_spec = Smartsheet::API::EndpointSpec.new(
      :post,
      ['sheets', :sheet_id, 'summary', 'fields', :field_id, 'images'],
      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,
      field_id: field_id
  )
  client.make_request(endpoint_spec, request_spec)
end

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



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/smartsheet/endpoints/sheets/sheets_summaries.rb', line 99

def add_image_from_path(
    sheet_id:,
    field_id:,
    path:,
    filename: nil,
    content_type: '',
    params: {},
    header_overrides: {}
)
  endpoint_spec = Smartsheet::API::EndpointSpec.new(
      :post,
      ['sheets', :sheet_id, 'summary', 'fields', :field_id, 'images'],
      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,
      field_id: field_id
  )
  client.make_request(endpoint_spec, request_spec)
end

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



49
50
51
52
53
54
55
56
57
# File 'lib/smartsheet/endpoints/sheets/sheets_summaries.rb', line 49

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

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



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

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

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



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

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

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



59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/smartsheet/endpoints/sheets/sheets_summaries.rb', line 59

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