Class: Nzbn::Api::PrivacySettings

Inherits:
Object
  • Object
show all
Defined in:
lib/nzbn/api/privacy_settings.rb

Overview

Privacy Settings API

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ PrivacySettings

Returns a new instance of PrivacySettings.



7
8
9
# File 'lib/nzbn/api/privacy_settings.rb', line 7

def initialize(client)
  @client = client
end

Instance Method Details

#get(nzbn:) ⇒ Models::PrivacySettings

Get privacy settings for an entity

Parameters:

  • nzbn (String)

    13-digit NZBN

Returns:



16
17
18
19
# File 'lib/nzbn/api/privacy_settings.rb', line 16

def get(nzbn:)
  response = @client.get("/entities/#{nzbn}/privacy-settings")
  Models::PrivacySettings.new(response)
end

#update(nzbn:, settings:) ⇒ Models::PrivacySettings

Update privacy settings

Parameters:

  • nzbn (String)

    13-digit NZBN

  • settings (Hash)

    Privacy settings to update

Returns:



27
28
29
30
# File 'lib/nzbn/api/privacy_settings.rb', line 27

def update(nzbn:, settings:)
  response = @client.put("/entities/#{nzbn}/privacy-settings", settings)
  Models::PrivacySettings.new(response)
end