Class: Smartsheet::Comments
- Inherits:
-
Object
- Object
- Smartsheet::Comments
- Defined in:
- lib/smartsheet/endpoints/sheets/comments.rb
Overview
Comments Endpoints
Instance Attribute Summary collapse
- #attachments ⇒ CommentsAttachments readonly
Instance Method Summary collapse
- #add(sheet_id:, discussion_id:, body:, params: {}, header_overrides: {}) ⇒ Object
- #delete(sheet_id:, comment_id:, params: {}, header_overrides: {}) ⇒ Object
- #get(sheet_id:, comment_id:, params: {}, header_overrides: {}) ⇒ Object
-
#initialize(client) ⇒ Comments
constructor
A new instance of Comments.
- #update(sheet_id:, comment_id:, body:, params: {}, header_overrides: {}) ⇒ Object
Constructor Details
#initialize(client) ⇒ Comments
Returns a new instance of Comments.
13 14 15 16 17 |
# File 'lib/smartsheet/endpoints/sheets/comments.rb', line 13 def initialize(client) @client = client @attachments = CommentsAttachments.new(client) end |
Instance Attribute Details
#attachments ⇒ CommentsAttachments (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 |
# File 'lib/smartsheet/endpoints/sheets/comments.rb', line 9 class Comments attr_reader :client, :attachments private :client def initialize(client) @client = client @attachments = CommentsAttachments.new(client) end def add(sheet_id:, discussion_id:, body:, params: {}, header_overrides: {}) endpoint_spec = Smartsheet::API::EndpointSpec.new(:post, ['sheets', :sheet_id, 'discussions', :discussion_id, 'comments'], body_type: :json) request_spec = Smartsheet::API::RequestSpec.new( header_overrides: header_overrides, params: params, body: body, sheet_id: sheet_id, discussion_id: discussion_id ) client.make_request(endpoint_spec, request_spec) end def update(sheet_id:, comment_id:, body:, params: {}, header_overrides: {}) endpoint_spec = Smartsheet::API::EndpointSpec.new(:put, ['sheets', :sheet_id, 'comments', :comment_id], body_type: :json) request_spec = Smartsheet::API::RequestSpec.new( header_overrides: header_overrides, params: params, body: body, sheet_id: sheet_id, comment_id: comment_id ) client.make_request(endpoint_spec, request_spec) end def delete(sheet_id:, comment_id:, params: {}, header_overrides: {}) endpoint_spec = Smartsheet::API::EndpointSpec.new(:delete, ['sheets', :sheet_id, 'comments', :comment_id]) request_spec = Smartsheet::API::RequestSpec.new( params: params, header_overrides: header_overrides, sheet_id: sheet_id, comment_id: comment_id ) client.make_request(endpoint_spec, request_spec) end def get(sheet_id:, comment_id:, params: {}, header_overrides: {}) endpoint_spec = Smartsheet::API::EndpointSpec.new(:get, ['sheets', :sheet_id, 'comments', :comment_id]) request_spec = Smartsheet::API::RequestSpec.new( params: params, header_overrides: header_overrides, sheet_id: sheet_id, comment_id: comment_id ) client.make_request(endpoint_spec, request_spec) end end |
Instance Method Details
#add(sheet_id:, discussion_id:, body:, params: {}, header_overrides: {}) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/smartsheet/endpoints/sheets/comments.rb', line 19 def add(sheet_id:, discussion_id:, body:, params: {}, header_overrides: {}) endpoint_spec = Smartsheet::API::EndpointSpec.new(:post, ['sheets', :sheet_id, 'discussions', :discussion_id, 'comments'], body_type: :json) request_spec = Smartsheet::API::RequestSpec.new( header_overrides: header_overrides, params: params, body: body, sheet_id: sheet_id, discussion_id: discussion_id ) client.make_request(endpoint_spec, request_spec) end |
#delete(sheet_id:, comment_id:, params: {}, header_overrides: {}) ⇒ Object
43 44 45 46 47 48 49 50 51 52 |
# File 'lib/smartsheet/endpoints/sheets/comments.rb', line 43 def delete(sheet_id:, comment_id:, params: {}, header_overrides: {}) endpoint_spec = Smartsheet::API::EndpointSpec.new(:delete, ['sheets', :sheet_id, 'comments', :comment_id]) request_spec = Smartsheet::API::RequestSpec.new( params: params, header_overrides: header_overrides, sheet_id: sheet_id, comment_id: comment_id ) client.make_request(endpoint_spec, request_spec) end |
#get(sheet_id:, comment_id:, params: {}, header_overrides: {}) ⇒ Object
54 55 56 57 58 59 60 61 62 63 |
# File 'lib/smartsheet/endpoints/sheets/comments.rb', line 54 def get(sheet_id:, comment_id:, params: {}, header_overrides: {}) endpoint_spec = Smartsheet::API::EndpointSpec.new(:get, ['sheets', :sheet_id, 'comments', :comment_id]) request_spec = Smartsheet::API::RequestSpec.new( params: params, header_overrides: header_overrides, sheet_id: sheet_id, comment_id: comment_id ) client.make_request(endpoint_spec, request_spec) end |
#update(sheet_id:, comment_id:, body:, params: {}, header_overrides: {}) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/smartsheet/endpoints/sheets/comments.rb', line 31 def update(sheet_id:, comment_id:, body:, params: {}, header_overrides: {}) endpoint_spec = Smartsheet::API::EndpointSpec.new(:put, ['sheets', :sheet_id, 'comments', :comment_id], body_type: :json) request_spec = Smartsheet::API::RequestSpec.new( header_overrides: header_overrides, params: params, body: body, sheet_id: sheet_id, comment_id: comment_id ) client.make_request(endpoint_spec, request_spec) end |