Class: WyWecall::Client

Inherits:
Object
  • Object
show all
Includes:
Api::Account, Api::BackUser, Api::Bot, Api::FilterRule, Api::HttpBase, Api::Intent, Api::Line, Api::LinePolicy, Api::Order, Api::Seat, Api::Sign, Api::Sms, Api::Task, Api::TaskCall, Api::Wallet
Defined in:
lib/wy_wecall/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Api::Sign

#build_body_signature, #build_signature

Methods included from Api::Wallet

#query_wallet_info, #query_wallet_sms_info

Methods included from Api::TaskCall

#delete_task_call, #query_filtered_call_list, #query_task_call_detail, #query_task_call_list, #query_trask_call_un_call_list

Methods included from Api::Task

#delete_task, #import_customer, #import_customer_with_result, #query_console_folder_list, #query_task_detail, #query_task_list, #query_task_properties, #query_task_summary, #save_task, #start_task, #start_timing_task, #stop_task, #stop_timing_task

Methods included from Api::Sms

#query_sms_send_record_list, #query_sms_template_list, #query_valid_sms_template_list

Methods included from Api::Seat

#query_seat_details, #query_seat_info

Methods included from Api::Order

#query_call_order_list, #query_sms_order_list

Methods included from Api::LinePolicy

#query_line_policy_list

Methods included from Api::Line

#query_active_lines

Methods included from Api::Intent

#create_intent, #delete_intent, #query_intent_group_detail, #query_intent_groups, #query_intent_groups_by_ids, #update_intent

Methods included from Api::FilterRule

#query_filter_rule_list

Methods included from Api::Bot

#query_bot_list

Methods included from Api::BackUser

#add_black_user, #delete_black_user, #query_black_user_by_phone, #query_black_user_group_list

Methods included from Api::Account

#query_account

Methods included from Api::HttpBase

#api_url, #conn, #current_timestamp, #get, #post

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/wy_wecall/client.rb', line 25

def initialize(options = {})
  @app_key            = options[:app_key] || WyWecall.configuration.app_key
  @app_secret         = options[:app_secret] || WyWecall.configuration.app_secret
  @app_type           = options[:app_type]  || WyWecall.configuration.app_type
  @algorithm          = options[:algorithm] || WyWecall.configuration.algorithm || WyWecall::Configuration::DEFAULT_ALGORITHM
  @headers            = options[:headers] || WyWecall.configuration.headers || WyWecall::Configuration::DEFAULT_HEADERS
  @base_url           = options[:base_url] || WyWecall.configuration.base_url || WyWecall::Configuration::DEFAULT_BASE_URL
  @connection_adapter = options[:connection_adapter] || WyWecall.configuration.connection_adapter || WyWecall::Configuration::DEFAULT_CONNECTION_ADAPTER
  @timeout            = options[:timeout] || WyWecall.configuration.timeout || WyWecall::Configuration::DEFAULT_TIMEOUT
  @open_timeout       = options[:open_timeout] || WyWecall.configuration.open_timeout || WyWecall::Configuration::DEFAULT_OPEN_TIMEOUT
  @api_path           = options[:api_path] || WyWecall.configuration.api_path || WyWecall::Configuration::DEFAULT_API_PATH
  @api_version        = options[:api_version] || WyWecall.configuration.api_version || WyWecall::Configuration::DEFAULT_API_VERSION
  @debug_flag         = options[:debug_flag] || WyWecall.configuration.debug_flag || WyWecall::Configuration::DEFAULT_DEBUG_FLAG
end

Instance Attribute Details

#algorithmObject

Returns the value of attribute algorithm.



21
22
23
# File 'lib/wy_wecall/client.rb', line 21

def algorithm
  @algorithm
end

#api_pathObject

Returns the value of attribute api_path.



21
22
23
# File 'lib/wy_wecall/client.rb', line 21

def api_path
  @api_path
end

#api_versionObject

Returns the value of attribute api_version.



21
22
23
# File 'lib/wy_wecall/client.rb', line 21

def api_version
  @api_version
end

#app_keyObject

Returns the value of attribute app_key.



21
22
23
# File 'lib/wy_wecall/client.rb', line 21

def app_key
  @app_key
end

#app_secretObject

Returns the value of attribute app_secret.



21
22
23
# File 'lib/wy_wecall/client.rb', line 21

def app_secret
  @app_secret
end

#app_typeObject

Returns the value of attribute app_type.



21
22
23
# File 'lib/wy_wecall/client.rb', line 21

def app_type
  @app_type
end

#base_urlObject

Returns the value of attribute base_url.



21
22
23
# File 'lib/wy_wecall/client.rb', line 21

def base_url
  @base_url
end

#connection_adapterObject

Returns the value of attribute connection_adapter.



21
22
23
# File 'lib/wy_wecall/client.rb', line 21

def connection_adapter
  @connection_adapter
end

#debug_flagObject

Returns the value of attribute debug_flag.



21
22
23
# File 'lib/wy_wecall/client.rb', line 21

def debug_flag
  @debug_flag
end

#headersObject

Returns the value of attribute headers.



21
22
23
# File 'lib/wy_wecall/client.rb', line 21

def headers
  @headers
end

#open_timeoutObject

Returns the value of attribute open_timeout.



21
22
23
# File 'lib/wy_wecall/client.rb', line 21

def open_timeout
  @open_timeout
end

#timeoutObject

Returns the value of attribute timeout.



21
22
23
# File 'lib/wy_wecall/client.rb', line 21

def timeout
  @timeout
end

Instance Method Details

#log_debug(message) ⇒ Object



40
41
42
43
44
# File 'lib/wy_wecall/client.rb', line 40

def log_debug(message)
  return unless @debug_flag

  puts message
end