Class: StackOne::StackOne

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/stack_one/stackone.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client: nil, retry_config: nil, timeout_ms: nil, security: nil, security_source: nil, server_idx: nil, server_url: nil, url_params: nil) ⇒ StackOne

Returns a new instance of StackOne.



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/stack_one/stackone.rb', line 43

def initialize(client: nil, retry_config: nil, timeout_ms: nil, security: nil, security_source: nil, server_idx: nil, server_url: nil, url_params: nil)

  connection_options = {
    request: {
      params_encoder: Faraday::FlatParamsEncoder
    }
  }
  connection_options[:request][:timeout] = (timeout_ms.to_f / 1000) unless timeout_ms.nil?

  client ||= Faraday.new(**connection_options) do |f|
    f.request :multipart, {}
    # f.response :logger, nil, { headers: true, bodies: true, errors: true }
  end
  
  if !server_url.nil?
    if !url_params.nil?
      server_url = Utils.template_url(server_url, url_params)
    end
  end

  server_idx = 0 if server_idx.nil?
  hooks = SDKHooks::Hooks.new
  @sdk_configuration = SDKConfiguration.new(
    client,
    hooks,
    retry_config,
    timeout_ms,
    security,
    security_source,
    server_url,
    server_idx
  )
  @sdk_configuration = hooks.sdk_init(config: @sdk_configuration)
  init_sdks
end

Instance Attribute Details

#accountingObject

Returns the value of attribute accounting.



19
20
21
# File 'lib/stack_one/stackone.rb', line 19

def accounting
  @accounting
end

#accountsObject

Returns the value of attribute accounts.



19
20
21
# File 'lib/stack_one/stackone.rb', line 19

def accounts
  @accounts
end

#actionsObject

Returns the value of attribute actions.



19
20
21
# File 'lib/stack_one/stackone.rb', line 19

def actions
  @actions
end

#atsObject

Returns the value of attribute ats.



19
20
21
# File 'lib/stack_one/stackone.rb', line 19

def ats
  @ats
end

#auth_configsObject

Returns the value of attribute auth_configs.



19
20
21
# File 'lib/stack_one/stackone.rb', line 19

def auth_configs
  @auth_configs
end

#connect_sessionsObject

Returns the value of attribute connect_sessions.



19
20
21
# File 'lib/stack_one/stackone.rb', line 19

def connect_sessions
  @connect_sessions
end

#connectorsObject

Returns the value of attribute connectors.



19
20
21
# File 'lib/stack_one/stackone.rb', line 19

def connectors
  @connectors
end

#crmObject

Returns the value of attribute crm.



19
20
21
# File 'lib/stack_one/stackone.rb', line 19

def crm
  @crm
end

#documentsObject

Returns the value of attribute documents.



19
20
21
# File 'lib/stack_one/stackone.rb', line 19

def documents
  @documents
end

#hrisObject

Returns the value of attribute hris.



19
20
21
# File 'lib/stack_one/stackone.rb', line 19

def hris
  @hris
end

#iamObject

Returns the value of attribute iam.



19
20
21
# File 'lib/stack_one/stackone.rb', line 19

def iam
  @iam
end

#lmsObject

Returns the value of attribute lms.



19
20
21
# File 'lib/stack_one/stackone.rb', line 19

def lms
  @lms
end

#marketingObject

Returns the value of attribute marketing.



19
20
21
# File 'lib/stack_one/stackone.rb', line 19

def marketing
  @marketing
end

#mcpObject

Returns the value of attribute mcp.



19
20
21
# File 'lib/stack_one/stackone.rb', line 19

def mcp
  @mcp
end

#messagingObject

Returns the value of attribute messaging.



19
20
21
# File 'lib/stack_one/stackone.rb', line 19

def messaging
  @messaging
end

#proxyObject

Returns the value of attribute proxy.



19
20
21
# File 'lib/stack_one/stackone.rb', line 19

def proxy
  @proxy
end

#request_logsObject

Returns the value of attribute request_logs.



19
20
21
# File 'lib/stack_one/stackone.rb', line 19

def request_logs
  @request_logs
end

#screeningObject

Returns the value of attribute screening.



19
20
21
# File 'lib/stack_one/stackone.rb', line 19

def screening
  @screening
end

#ticketingObject

Returns the value of attribute ticketing.



19
20
21
# File 'lib/stack_one/stackone.rb', line 19

def ticketing
  @ticketing
end

Instance Method Details

#get_url(base_url:, url_variables: nil) ⇒ Object



103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/stack_one/stackone.rb', line 103

def get_url(base_url:, url_variables: nil)
  sd_base_url, sd_options = @sdk_configuration.get_server_details

  if base_url.nil?
    base_url = sd_base_url
  end

  if url_variables.nil?
    url_variables = sd_options
  end

  return Utils.template_url base_url, url_variables
end

#init_sdksObject



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/stack_one/stackone.rb', line 80

def init_sdks
  @accounts = Accounts.new(@sdk_configuration)
  @actions = Actions.new(@sdk_configuration)
  @auth_configs = AuthConfigs.new(@sdk_configuration)
  @connect_sessions = ConnectSessions.new(@sdk_configuration)
  @connectors = Connectors.new(@sdk_configuration)
  @mcp = Mcp.new(@sdk_configuration)
  @request_logs = RequestLogs.new(@sdk_configuration)
  @accounting = Accounting.new(@sdk_configuration)
  @ats = Ats.new(@sdk_configuration)
  @crm = Crm.new(@sdk_configuration)
  @documents = Documents.new(@sdk_configuration)
  @hris = Hris.new(@sdk_configuration)
  @iam = Iam.new(@sdk_configuration)
  @lms = Lms.new(@sdk_configuration)
  @marketing = Marketing.new(@sdk_configuration)
  @messaging = Messaging.new(@sdk_configuration)
  @proxy = Proxy.new(@sdk_configuration)
  @screening = Screening.new(@sdk_configuration)
  @ticketing = Ticketing.new(@sdk_configuration)
end