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

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

Overview

Subclients module for admin/subclient endpoints

Instance Method Summary collapse

Instance Method Details

#client_sub_clients(client_id, opts = {}) ⇒ Hashie::Mash Also known as: sub_clients

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:

  • (Hashie::Mash) —

    All sub clients for client



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

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

#create_client_sub_client(client_id, opts = {}) ⇒ Hashie::Mash Also known as: create_sub_client

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:

  • (Hashie::Mash) —

    New sub client



61
62
63
# File 'lib/bwapi/client/admin/sub_clients.rb', line 61

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) ⇒ Hashie::Mash Also known as: delete_sub_client

Delete specific sub client of client

Parameters:

  • client_id (Integer) —

    Id of the client

  • sub_client_id (Integer) —

    Id of the sub client

Returns:

  • (Hashie::Mash) —

    Specific sub client for client



108
109
110
# File 'lib/bwapi/client/admin/sub_clients.rb', line 108

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) ⇒ Hashie::Mash Also known as: sub_client

Get specific sub client of client

Parameters:

  • client_id (Integer) —

    Id of the client

  • sub_client_id (Integer) —

    Id of the sub client

Returns:

  • (Hashie::Mash) —

    Specific sub client for client



25
26
27
# File 'lib/bwapi/client/admin/sub_clients.rb', line 25

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 = {}) ⇒ Hashie::Mash Also known as: update_sub_client

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:

  • (Hashie::Mash) —

    Edited sub client



98
99
100
# File 'lib/bwapi/client/admin/sub_clients.rb', line 98

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