Sha256: bfb27fcfc867f21dcd63002d195a9419dd4df109e7bdcf3e2726d1657f1865db

Contents?: true

Size: 937 Bytes

Versions: 1

Compression:

Stored size: 937 Bytes

Contents

# Unless explicitly stated otherwise all files in this repository are licensed under the BSD-3-Clause License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2011-Present Datadog, Inc.

module Dogapi
  class V1 # for namespacing

    class CommentService < Dogapi::APIService

      API_VERSION = 'v1'

      # Submit a comment.
      def comment(message, options = {})
        body = {
          'message' => message,
        }.merge options

        request(Net::HTTP::Post, "/api/#{API_VERSION}/comments", nil, body, true)
      end

      # Update a comment.
      def update_comment(comment_id, options = {})
        request(Net::HTTP::Put, "/api/#{API_VERSION}/comments/#{comment_id}", nil, options, true)
      end

      def delete_comment(comment_id)
        request(Net::HTTP::Delete, "/api/#{API_VERSION}/comments/#{comment_id}", nil, nil, false)
      end

    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dogapi-1.45.0 lib/dogapi/v1/comment.rb