Class: Svix::Client
- Inherits:
-
Object
- Object
- Svix::Client
- Defined in:
- lib/svix/svix.rb
Instance Attribute Summary collapse
-
#application ⇒ Object
Returns the value of attribute application.
-
#authentication ⇒ Object
Returns the value of attribute authentication.
-
#endpoint ⇒ Object
Returns the value of attribute endpoint.
-
#event_type ⇒ Object
Returns the value of attribute event_type.
-
#integration ⇒ Object
Returns the value of attribute integration.
-
#message ⇒ Object
Returns the value of attribute message.
-
#message_attempt ⇒ Object
Returns the value of attribute message_attempt.
Instance Method Summary collapse
-
#initialize(auth_token, options = SvixOptions.new) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(auth_token, options = SvixOptions.new) ⇒ Client
Returns a new instance of Client.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/svix/svix.rb', line 23 def initialize(auth_token, = SvixOptions.new) region = auth_token.split(".").last if region == "us" regional_url = "https://api.us.svix.com" elsif region == "eu" regional_url = "https://api.eu.svix.com" elsif region == "in" regional_url = "https://api.in.svix.com" else regional_url = "https://api.svix.com" end uri = URI(.server_url || regional_url) configuration = Configuration.new configuration.debugging = .debug configuration.scheme = uri.scheme configuration.host = uri.port ? "#{uri.host}:#{uri.port}" : uri.host configuration.access_token = auth_token configuration.server_index = nil api_client = ApiClient.new(configuration) api_client.user_agent = "svix-libs/#{VERSION}/ruby" @application = ApplicationAPI.new(api_client) @authentication = AuthenticationAPI.new(api_client) @endpoint = EndpointAPI.new(api_client) @event_type = EventTypeAPI.new(api_client) @integration = IntegrationAPI.new(api_client) @message = MessageAPI.new(api_client) @message_attempt = MessageAttemptAPI.new(api_client) end |
Instance Attribute Details
#application ⇒ Object
Returns the value of attribute application.
15 16 17 |
# File 'lib/svix/svix.rb', line 15 def application @application end |
#authentication ⇒ Object
Returns the value of attribute authentication.
16 17 18 |
# File 'lib/svix/svix.rb', line 16 def authentication @authentication end |
#endpoint ⇒ Object
Returns the value of attribute endpoint.
17 18 19 |
# File 'lib/svix/svix.rb', line 17 def endpoint @endpoint end |
#event_type ⇒ Object
Returns the value of attribute event_type.
18 19 20 |
# File 'lib/svix/svix.rb', line 18 def event_type @event_type end |
#integration ⇒ Object
Returns the value of attribute integration.
19 20 21 |
# File 'lib/svix/svix.rb', line 19 def integration @integration end |
#message ⇒ Object
Returns the value of attribute message.
20 21 22 |
# File 'lib/svix/svix.rb', line 20 def @message end |
#message_attempt ⇒ Object
Returns the value of attribute message_attempt.
21 22 23 |
# File 'lib/svix/svix.rb', line 21 def @message_attempt end |