Class: Legion::Extensions::ServiceNow::Client

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Account::Runners::Account

#create_account, #get_account, #list_accounts, #update_account

Methods included from Helpers::Client

#fetch_oauth2_token

Methods included from ServiceCatalog::Runners::ServiceCatalog

#add_to_cart, #checkout_cart, #delete_cart, #get_cart, #get_catalog, #get_category, #get_item, #get_item_variables, #list_catalogs, #list_items, #order_now

Methods included from Knowledge::Runners::Knowledge

#create_article, #delete_article, #get_article, #list_articles, #update_article

Methods included from Legion::Extensions::ServiceNow::Cmdb::Meta::Runners::Meta

#get_class_meta, #get_hierarchy

Methods included from Legion::Extensions::ServiceNow::Cmdb::Instance::Runners::Instance

#create_ci, #create_relationship, #delete_ci, #get_ci, #get_relationships, #list_cis, #update_ci

Methods included from Legion::Extensions::ServiceNow::Change::Runners::Change

#calculate_conflicts, #create_emergency, #create_normal, #create_standard, #create_task, #delete_change, #delete_task, #get_approvals, #get_change, #get_conflicts, #list_changes, #list_tasks, #update_change, #update_task

Constructor Details

#initialize(url: nil, client_id: nil, client_secret: nil, token: nil, username: nil, password: nil, **extra) ⇒ Client

Returns a new instance of Client.



17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/legion/extensions/service_now/client.rb', line 17

def initialize(url: nil, client_id: nil, client_secret: nil,
               token: nil, username: nil, password: nil, **extra)
  @opts = {
    url:           url,
    client_id:     client_id,
    client_secret: client_secret,
    token:         token,
    username:      username,
    password:      password,
    **extra
  }.compact
end

Instance Attribute Details

#optsObject (readonly)

Returns the value of attribute opts.



15
16
17
# File 'lib/legion/extensions/service_now/client.rb', line 15

def opts
  @opts
end

Instance Method Details

#connection(**override) ⇒ Object



30
31
32
# File 'lib/legion/extensions/service_now/client.rb', line 30

def connection(**override)
  super(**@opts, **override)
end