Module: BWAPI::Client::Admin::Clients::SubClients

Included in:
BWAPI::Client::Admin
Defined in:
lib/bwapi/client/admin/clients/sub_clients.rb

Overview

Subclients module for admin/subclient endpoints

Instance Method Summary collapse

Instance Method Details

#client_sub_clients(client_id, opts = {}) ⇒ Hash

Get all sub clients

Parameters:

  • client_id (Integer)

    Id of the client

  • opts (Hash) (defaults to: {})

    options hash of parameters

Options Hash (opts):

  • page (Integer)

    Page of projects to retrieve

  • pageSize (Integer)

    Results per page of results

Returns:

  • (Hash)

    All sub clients for client



14
15
16
# File 'lib/bwapi/client/admin/clients/sub_clients.rb', line 14

def client_sub_clients(client_id, opts = {})
  get "admin/clients/#{client_id}/subclients", opts
end

#create_client_sub_client(client_id, opts = {}) ⇒ Hash

Create new subclient

Parameters:

  • client_id (Integer)

    Id of the client

  • opts (Hash) (defaults to: {})

    options hash of parameters

Options Hash (opts):

  • startDate (Date)

    Start date of the client

  • contactTitle (String)

    Contact title of the client

  • address1 (String)

    Address line one of the client

  • address2 (String)

    Address line two of the client

  • address3 (String)

    Address line three of the client

  • pricingModel (String)

    Pricing model of the client

  • mentionArchiveSize (Integer)

    Mention archive size for the client

  • id (Integer)

    Id of the sub client

  • parentId (Integer)

    Parent id of the sub client

  • maxUsers (Integer)

    Maxiumum number of users for the client

  • isLegacy (Boolean)

    Legacy status of the client

  • name (String)

    Name of the client

  • contactTelephone (String)

    Telephone number of the client

  • priceStructureId (Integer)

    Id of the price structure for client

  • tags (Hash)

    Tags for the client

  • website (String)

    The website for the client

  • contactEmail (String)

    The contact email for the client

  • expiryDate (Date)

    The expiry date for the client

  • theme (String)

    The theme of the client

  • priceStructureLineId (Integer)

    The level of the price structure for the client

  • mentionBasedPricingMatrixLevel (Integer)

    The amount of mentions allowed

  • postcode (String)

    The postcode of the client

  • country (String)

    The country of the client

  • contactName (String)

    The contact name of the client

  • maximumSubscribedBrands (Integer)

    The maximum subscribed brands for the client

  • contactMobile (String)

    The mobile number for the client

Returns:

  • (Hash)

    New sub client



58
59
60
# File 'lib/bwapi/client/admin/clients/sub_clients.rb', line 58

def create_client_sub_client(client_id, opts = {})
  post "admin/clients/#{client_id}/subclients", opts
end

#delete_client_sub_client(client_id, sub_client_id) ⇒ Hash

Delete specific sub client of client

Parameters:

  • client_id (Integer)

    Id of the client

  • sub_client_id (Integer)

    Id of the sub client

Returns:

  • (Hash)

    Specific sub client for client



103
104
105
# File 'lib/bwapi/client/admin/clients/sub_clients.rb', line 103

def delete_client_sub_client(client_id, sub_client_id)
  delete "admin/clients/#{client_id}/subclients/#{sub_client_id}"
end

#get_client_sub_client(client_id, sub_client_id) ⇒ Hash

Get specific sub client of client

Parameters:

  • client_id (Integer)

    Id of the client

  • sub_client_id (Integer)

    Id of the sub client

Returns:

  • (Hash)

    Specific sub client for client



23
24
25
# File 'lib/bwapi/client/admin/clients/sub_clients.rb', line 23

def get_client_sub_client(client_id, sub_client_id)
  get "admin/clients/#{client_id}/subclients/#{sub_client_id}"
end

#update_client_sub_client(client_id, sub_client_id, opts = {}) ⇒ Hash

Update new subclient

Parameters:

  • client_id (Integer)

    Id of the client

  • sub_client_id (Integer)

    Id of the sub client

  • opts (Hash) (defaults to: {})

    options hash of parameters

Options Hash (opts):

  • startDate (Date)

    Start date of the client

  • contactTitle (String)

    Contact title of the client

  • address1 (String)

    Address line one of the client

  • address2 (String)

    Address line two of the client

  • address3 (String)

    Address line three of the client

  • pricingModel (String)

    Pricing model of the client

  • mentionArchiveSize (Integer)

    Mention archive size for the client

  • id (Integer)

    Id of the sub client

  • parentId (Integer)

    Parent id of the sub client

  • maxUsers (Integer)

    Maxiumum number of users for the client

  • isLegacy (Boolean)

    Legacy status of the client

  • name (String)

    Name of the client

  • contactTelephone (String)

    Telephone number of the client

  • priceStructureId (Integer)

    Id of the price structure for client

  • tags (Hash)

    Tags for the client

  • website (String)

    The website for the client

  • contactEmail (String)

    The contact email for the client

  • expiryDate (Date)

    The expiry date for the client

  • theme (String)

    The theme of the client

  • priceStructureLineId (Integer)

    The level of the price structure for the client

  • mentionBasedPricingMatrixLevel (Integer)

    The amount of mentions allowed

  • postcode (String)

    The postcode of the client

  • country (String)

    The country of the client

  • contactName (String)

    The contact name of the client

  • maximumSubscribedBrands (Integer)

    The maximum subscribed brands for the client

  • contactMobile (String)

    The mobile number for the client

Returns:

  • (Hash)

    Edited sub client



94
95
96
# File 'lib/bwapi/client/admin/clients/sub_clients.rb', line 94

def update_client_sub_client(client_id, sub_client_id, opts = {})
  put "admin/clients/#{client_id}/subclients/#{sub_client_id}", opts
end