Class: Svix::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/svix/svix.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(auth_token, options = SvixOptions.new) ⇒ Client

Returns a new instance of Client.



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
56
57
58
59
60
61
62
63
# File 'lib/svix/svix.rb', line 30

def initialize(auth_token, options = 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"
  elsif region == "ca"
    regional_url = "https://api.ca.svix.com"
  elsif region == "au"
    regional_url = "https://api.au.svix.com"
  else
    regional_url = "https://api.svix.com"
  end

  uri = URI(options.server_url || regional_url)
  api_client = SvixHttpClient.new(auth_token, uri)

  @application = Application.new(api_client)
  @authentication = Authentication.new(api_client)
  @background_task = BackgroundTask.new(api_client)
  @endpoint = Endpoint.new(api_client)
  @environment = Environment.new(api_client)
  @event_type = EventType.new(api_client)
  @health = Health.new(api_client)
  @ingest = Ingest.new(api_client)
  @integration = Integration.new(api_client)
  @message = Message.new(api_client)
  @message_attempt = MessageAttempt.new(api_client)
  @operational_webhook = OperationalWebhook.new(api_client)
  @operational_webhook_endpoint = OperationalWebhookEndpoint.new(api_client)
  @statistics = Statistics.new(api_client)
end

Instance Attribute Details

#applicationObject

Returns the value of attribute application.



15
16
17
# File 'lib/svix/svix.rb', line 15

def application
  @application
end

#authenticationObject

Returns the value of attribute authentication.



16
17
18
# File 'lib/svix/svix.rb', line 16

def authentication
  @authentication
end

#background_taskObject

Returns the value of attribute background_task.



17
18
19
# File 'lib/svix/svix.rb', line 17

def background_task
  @background_task
end

#endpointObject

Returns the value of attribute endpoint.



18
19
20
# File 'lib/svix/svix.rb', line 18

def endpoint
  @endpoint
end

#environmentObject

Returns the value of attribute environment.



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

def environment
  @environment
end

#event_typeObject

Returns the value of attribute event_type.



20
21
22
# File 'lib/svix/svix.rb', line 20

def event_type
  @event_type
end

#healthObject

Returns the value of attribute health.



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

def health
  @health
end

#ingestObject

Returns the value of attribute ingest.



22
23
24
# File 'lib/svix/svix.rb', line 22

def ingest
  @ingest
end

#integrationObject

Returns the value of attribute integration.



23
24
25
# File 'lib/svix/svix.rb', line 23

def integration
  @integration
end

#messageObject

Returns the value of attribute message.



24
25
26
# File 'lib/svix/svix.rb', line 24

def message
  @message
end

#message_attemptObject

Returns the value of attribute message_attempt.



25
26
27
# File 'lib/svix/svix.rb', line 25

def message_attempt
  @message_attempt
end

#operational_webhookObject

Returns the value of attribute operational_webhook.



26
27
28
# File 'lib/svix/svix.rb', line 26

def operational_webhook
  @operational_webhook
end

#operational_webhook_endpointObject

Returns the value of attribute operational_webhook_endpoint.



27
28
29
# File 'lib/svix/svix.rb', line 27

def operational_webhook_endpoint
  @operational_webhook_endpoint
end

#statisticsObject

Returns the value of attribute statistics.



28
29
30
# File 'lib/svix/svix.rb', line 28

def statistics
  @statistics
end