Class: CachetSubscribers

Inherits:
CachetClient show all
Defined in:
lib/cachet.rb

Overview

Inherits CachetClient and handles all Subscribers API Calls

Constant Summary

Constants inherited from CachetClient

CachetClient::INCIDENT_FIXED, CachetClient::INCIDENT_IDENTIFIED, CachetClient::INCIDENT_INVESTIGATING, CachetClient::INCIDENT_SCHEDULED, CachetClient::INCIDENT_WATCHING, CachetClient::STATUS_MAJOR_OUTAGE, CachetClient::STATUS_OPERATIONAL, CachetClient::STATUS_PARTIAL_OUTAGE, CachetClient::STATUS_PERFORMANCE_ISSUES, CachetClient::VERSION

Instance Method Summary collapse

Methods inherited from CachetClient

#initialize, #ping, #request

Constructor Details

This class inherits a constructor from CachetClient

Instance Method Details

#create(options) ⇒ Object

Create Subscriber.

Parameters:

  • options (Hash)

    a customizable set of options

Options Hash (options):

  • :email (string)

    *Required* Email address to subscribe

  • :verify (int)

    Whether to send verification email 0/1

Returns:

  • object


415
416
417
418
419
# File 'lib/cachet.rb', line 415

def create(options)
  request method:  :post,
          url:     @base_url + 'subscribers',
          payload: options
end

#delete(options) ⇒ Object

Delete a Subscriber.

Parameters:

  • options (Hash)

    a customizable set of options

Options Hash (options):

  • :id (string)

    ID of the subscriber to delete

Returns:

  • object


427
428
429
430
# File 'lib/cachet.rb', line 427

def delete(options)
  request method:  :delete,
          url:     @base_url + 'subscribers/' + options['id'].to_s
end

#listObject

List all Subscribers.

Returns:

  • object


403
404
405
406
# File 'lib/cachet.rb', line 403

def list
  request method:  :get,
          url:     @base_url + 'subscribers'
end