Class: Smartsheet::Rows
- Inherits:
-
Object
- Object
- Smartsheet::Rows
- Defined in:
- lib/smartsheet/endpoints/sheets/rows.rb
Overview
Rows Endpoints
Instance Attribute Summary collapse
- #attachments ⇒ RowsAttachments readonly
Instance Method Summary collapse
- #add(sheet_id:, body:, params: {}, header_overrides: {}) ⇒ Object
- #copy_to_another_sheet(sheet_id:, body:, params: {}, header_overrides: {}) ⇒ Object
- #delete(sheet_id:, row_ids:, params: {}, header_overrides: {}) ⇒ Object
- #get(sheet_id:, row_id:, params: {}, header_overrides: {}) ⇒ Object
-
#initialize(client) ⇒ Rows
constructor
A new instance of Rows.
- #move_to_another_sheet(sheet_id:, body:, params: {}, header_overrides: {}) ⇒ Object
- #send_via_email(sheet_id:, body:, params: {}, header_overrides: {}) ⇒ Object
- #sort(sheet_id:, body:, params: {}, header_overrides: {}) ⇒ Object
- #update(sheet_id:, body:, params: {}, header_overrides: {}) ⇒ Object
Constructor Details
#initialize(client) ⇒ Rows
Returns a new instance of Rows.
13 14 15 16 17 |
# File 'lib/smartsheet/endpoints/sheets/rows.rb', line 13 def initialize(client) @client = client @attachments = RowsAttachments.new(client) end |
Instance Attribute Details
#attachments ⇒ RowsAttachments (readonly)
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 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 55 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 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/smartsheet/endpoints/sheets/rows.rb', line 9 class Rows attr_reader :client, :attachments private :client def initialize(client) @client = client @attachments = RowsAttachments.new(client) end def add(sheet_id:, body:, params: {}, header_overrides: {}) endpoint_spec = Smartsheet::API::EndpointSpec.new(:post, ['sheets', :sheet_id, 'rows'], 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 def copy_to_another_sheet(sheet_id:, body:, params: {}, header_overrides: {}) endpoint_spec = Smartsheet::API::EndpointSpec.new(:post, ['sheets', :sheet_id, 'rows', 'copy'], body_type: :json) request_spec = Smartsheet::API::RequestSpec.new( header_overrides: header_overrides, body: body, params: params, sheet_id: sheet_id ) client.make_request(endpoint_spec, request_spec) end def delete(sheet_id:, row_ids:, params: {}, header_overrides: {}) params[:ids] = row_ids.join(',') endpoint_spec = Smartsheet::API::EndpointSpec.new(:delete, ['sheets', :sheet_id, 'rows']) request_spec = Smartsheet::API::RequestSpec.new( header_overrides: header_overrides, params: params, sheet_id: sheet_id ) client.make_request(endpoint_spec, request_spec) end def get(sheet_id:, row_id:, params: {}, header_overrides: {}) endpoint_spec = Smartsheet::API::EndpointSpec.new(:get, ['sheets', :sheet_id, 'rows', :row_id]) request_spec = Smartsheet::API::RequestSpec.new( header_overrides: header_overrides, params: params, sheet_id: sheet_id, row_id: row_id ) client.make_request(endpoint_spec, request_spec) end def move_to_another_sheet(sheet_id:, body:, params: {}, header_overrides: {}) endpoint_spec = Smartsheet::API::EndpointSpec.new(:post, ['sheets', :sheet_id, 'rows', 'move'], body_type: :json) request_spec = Smartsheet::API::RequestSpec.new( header_overrides: header_overrides, body: body, params: params, sheet_id: sheet_id ) client.make_request(endpoint_spec, request_spec) end def send_via_email(sheet_id:, body:, params: {}, header_overrides: {}) endpoint_spec = Smartsheet::API::EndpointSpec.new(:post, ['sheets', :sheet_id, 'rows', 'emails'], 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 def update(sheet_id:, body:, params: {}, header_overrides: {}) endpoint_spec = Smartsheet::API::EndpointSpec.new(:put, ['sheets', :sheet_id, 'rows'], body_type: :json) request_spec = Smartsheet::API::RequestSpec.new( header_overrides: header_overrides, body: body, params: params, sheet_id: sheet_id ) client.make_request(endpoint_spec, request_spec) end def sort(sheet_id:, body:, params: {}, header_overrides: {}) endpoint_spec = Smartsheet::API::EndpointSpec.new(:post, ['sheets', :sheet_id, 'sort'], body_type: :json) request_spec = Smartsheet::API::RequestSpec.new( header_overrides: header_overrides, body: body, params: params, sheet_id: sheet_id ) client.make_request(endpoint_spec, request_spec) end end |
Instance Method Details
#add(sheet_id:, body:, params: {}, header_overrides: {}) ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/smartsheet/endpoints/sheets/rows.rb', line 19 def add(sheet_id:, body:, params: {}, header_overrides: {}) endpoint_spec = Smartsheet::API::EndpointSpec.new(:post, ['sheets', :sheet_id, 'rows'], 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 |
#copy_to_another_sheet(sheet_id:, body:, params: {}, header_overrides: {}) ⇒ Object
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/smartsheet/endpoints/sheets/rows.rb', line 30 def copy_to_another_sheet(sheet_id:, body:, params: {}, header_overrides: {}) endpoint_spec = Smartsheet::API::EndpointSpec.new(:post, ['sheets', :sheet_id, 'rows', 'copy'], body_type: :json) request_spec = Smartsheet::API::RequestSpec.new( header_overrides: header_overrides, body: body, params: params, sheet_id: sheet_id ) client.make_request(endpoint_spec, request_spec) end |
#delete(sheet_id:, row_ids:, params: {}, header_overrides: {}) ⇒ Object
41 42 43 44 45 46 47 48 49 50 |
# File 'lib/smartsheet/endpoints/sheets/rows.rb', line 41 def delete(sheet_id:, row_ids:, params: {}, header_overrides: {}) params[:ids] = row_ids.join(',') endpoint_spec = Smartsheet::API::EndpointSpec.new(:delete, ['sheets', :sheet_id, 'rows']) request_spec = Smartsheet::API::RequestSpec.new( header_overrides: header_overrides, params: params, sheet_id: sheet_id ) client.make_request(endpoint_spec, request_spec) end |
#get(sheet_id:, row_id:, params: {}, header_overrides: {}) ⇒ Object
52 53 54 55 56 57 58 59 60 61 |
# File 'lib/smartsheet/endpoints/sheets/rows.rb', line 52 def get(sheet_id:, row_id:, params: {}, header_overrides: {}) endpoint_spec = Smartsheet::API::EndpointSpec.new(:get, ['sheets', :sheet_id, 'rows', :row_id]) request_spec = Smartsheet::API::RequestSpec.new( header_overrides: header_overrides, params: params, sheet_id: sheet_id, row_id: row_id ) client.make_request(endpoint_spec, request_spec) end |
#move_to_another_sheet(sheet_id:, body:, params: {}, header_overrides: {}) ⇒ Object
63 64 65 66 67 68 69 70 71 72 |
# File 'lib/smartsheet/endpoints/sheets/rows.rb', line 63 def move_to_another_sheet(sheet_id:, body:, params: {}, header_overrides: {}) endpoint_spec = Smartsheet::API::EndpointSpec.new(:post, ['sheets', :sheet_id, 'rows', 'move'], body_type: :json) request_spec = Smartsheet::API::RequestSpec.new( header_overrides: header_overrides, body: body, params: params, sheet_id: sheet_id ) client.make_request(endpoint_spec, request_spec) end |
#send_via_email(sheet_id:, body:, params: {}, header_overrides: {}) ⇒ Object
74 75 76 77 78 79 80 81 82 83 |
# File 'lib/smartsheet/endpoints/sheets/rows.rb', line 74 def send_via_email(sheet_id:, body:, params: {}, header_overrides: {}) endpoint_spec = Smartsheet::API::EndpointSpec.new(:post, ['sheets', :sheet_id, 'rows', 'emails'], 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 |
#sort(sheet_id:, body:, params: {}, header_overrides: {}) ⇒ Object
96 97 98 99 100 101 102 103 104 105 |
# File 'lib/smartsheet/endpoints/sheets/rows.rb', line 96 def sort(sheet_id:, body:, params: {}, header_overrides: {}) endpoint_spec = Smartsheet::API::EndpointSpec.new(:post, ['sheets', :sheet_id, 'sort'], body_type: :json) request_spec = Smartsheet::API::RequestSpec.new( header_overrides: header_overrides, body: body, params: params, sheet_id: sheet_id ) client.make_request(endpoint_spec, request_spec) end |
#update(sheet_id:, body:, params: {}, header_overrides: {}) ⇒ Object
85 86 87 88 89 90 91 92 93 94 |
# File 'lib/smartsheet/endpoints/sheets/rows.rb', line 85 def update(sheet_id:, body:, params: {}, header_overrides: {}) endpoint_spec = Smartsheet::API::EndpointSpec.new(:put, ['sheets', :sheet_id, 'rows'], body_type: :json) request_spec = Smartsheet::API::RequestSpec.new( header_overrides: header_overrides, body: body, params: params, sheet_id: sheet_id ) client.make_request(endpoint_spec, request_spec) end |