Class: Svix::Endpoint
- Inherits:
-
Object
- Object
- Svix::Endpoint
- Defined in:
- lib/svix/api/endpoint.rb,
lib/svix/api_internal/endpoint.rb
Instance Attribute Summary collapse
-
#auto_config ⇒ Object
Returns the value of attribute auto_config.
Instance Method Summary collapse
- #bulk_replay(app_id, endpoint_id, bulk_replay_in, options = {}) ⇒ Object
- #create(app_id, endpoint_in, options = {}) ⇒ Object
- #delete(app_id, endpoint_id) ⇒ Object
- #get(app_id, endpoint_id) ⇒ Object
- #get_headers(app_id, endpoint_id) ⇒ Object
- #get_secret(app_id, endpoint_id) ⇒ Object
- #get_stats(app_id, endpoint_id, options = {}) ⇒ Object
-
#initialize(client) ⇒ Endpoint
constructor
A new instance of Endpoint.
- #list(app_id, options = {}) ⇒ Object
- #patch(app_id, endpoint_id, endpoint_patch) ⇒ Object
- #patch_headers(app_id, endpoint_id, endpoint_headers_patch_in) ⇒ Object
- #patch_transformation(app_id, endpoint_id, endpoint_transformation_patch) ⇒ Object
- #recover(app_id, endpoint_id, recover_in, options = {}) ⇒ Object
- #replay_missing(app_id, endpoint_id, replay_in, options = {}) ⇒ Object
- #rotate_secret(app_id, endpoint_id, endpoint_secret_rotate_in, options = {}) ⇒ Object
- #send_example(app_id, endpoint_id, event_example_in, options = {}) ⇒ Object
- #transformation_get(app_id, endpoint_id) ⇒ Object
- #transformation_partial_update(app_id, endpoint_id, endpoint_transformation_in) ⇒ Object
- #update(app_id, endpoint_id, endpoint_update) ⇒ Object
- #update_headers(app_id, endpoint_id, endpoint_headers_in) ⇒ Object
Constructor Details
#initialize(client) ⇒ Endpoint
Returns a new instance of Endpoint.
8 9 10 |
# File 'lib/svix/api/endpoint.rb', line 8 def initialize(client) @client = client end |
Instance Attribute Details
#auto_config ⇒ Object
Returns the value of attribute auto_config.
8 9 10 |
# File 'lib/svix/api_internal/endpoint.rb', line 8 def auto_config @auto_config end |
Instance Method Details
#bulk_replay(app_id, endpoint_id, bulk_replay_in, options = {}) ⇒ Object
145 146 147 148 149 150 151 152 153 154 155 156 |
# File 'lib/svix/api/endpoint.rb', line 145 def bulk_replay(app_id, endpoint_id, bulk_replay_in, = {}) = .transform_keys(&:to_s) res = @client.execute_request( "POST", "/api/v1/app/#{app_id}/endpoint/#{endpoint_id}/bulk-replay", headers: { "idempotency-key" => ["idempotency-key"] }, body: bulk_replay_in ) ReplayOut.deserialize(res) end |
#create(app_id, endpoint_in, options = {}) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/svix/api/endpoint.rb', line 26 def create(app_id, endpoint_in, = {}) = .transform_keys(&:to_s) res = @client.execute_request( "POST", "/api/v1/app/#{app_id}/endpoint", headers: { "idempotency-key" => ["idempotency-key"] }, body: endpoint_in ) EndpointOut.deserialize(res) end |
#delete(app_id, endpoint_id) ⇒ Object
56 57 58 59 60 61 |
# File 'lib/svix/api/endpoint.rb', line 56 def delete(app_id, endpoint_id) @client.execute_request( "DELETE", "/api/v1/app/#{app_id}/endpoint/#{endpoint_id}" ) end |
#get(app_id, endpoint_id) ⇒ Object
39 40 41 42 43 44 45 |
# File 'lib/svix/api/endpoint.rb', line 39 def get(app_id, endpoint_id) res = @client.execute_request( "GET", "/api/v1/app/#{app_id}/endpoint/#{endpoint_id}" ) EndpointOut.deserialize(res) end |
#get_headers(app_id, endpoint_id) ⇒ Object
92 93 94 95 96 97 98 |
# File 'lib/svix/api/endpoint.rb', line 92 def get_headers(app_id, endpoint_id) res = @client.execute_request( "GET", "/api/v1/app/#{app_id}/endpoint/#{endpoint_id}/headers" ) EndpointHeadersOut.deserialize(res) end |
#get_secret(app_id, endpoint_id) ⇒ Object
72 73 74 75 76 77 78 |
# File 'lib/svix/api/endpoint.rb', line 72 def get_secret(app_id, endpoint_id) res = @client.execute_request( "GET", "/api/v1/app/#{app_id}/endpoint/#{endpoint_id}/secret" ) EndpointSecretOut.deserialize(res) end |
#get_stats(app_id, endpoint_id, options = {}) ⇒ Object
158 159 160 161 162 163 164 165 166 167 168 169 |
# File 'lib/svix/api/endpoint.rb', line 158 def get_stats(app_id, endpoint_id, = {}) = .transform_keys(&:to_s) res = @client.execute_request( "GET", "/api/v1/app/#{app_id}/endpoint/#{endpoint_id}/stats", query_params: { "since" => ["since"], "until" => ["until"] } ) EndpointStats.deserialize(res) end |
#list(app_id, options = {}) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/svix/api/endpoint.rb', line 12 def list(app_id, = {}) = .transform_keys(&:to_s) res = @client.execute_request( "GET", "/api/v1/app/#{app_id}/endpoint", query_params: { "limit" => ["limit"], "iterator" => ["iterator"], "order" => ["order"] } ) ListResponseEndpointOut.deserialize(res) end |
#patch(app_id, endpoint_id, endpoint_patch) ⇒ Object
63 64 65 66 67 68 69 70 |
# File 'lib/svix/api/endpoint.rb', line 63 def patch(app_id, endpoint_id, endpoint_patch) res = @client.execute_request( "PATCH", "/api/v1/app/#{app_id}/endpoint/#{endpoint_id}", body: endpoint_patch ) EndpointOut.deserialize(res) end |
#patch_headers(app_id, endpoint_id, endpoint_headers_patch_in) ⇒ Object
108 109 110 111 112 113 114 |
# File 'lib/svix/api/endpoint.rb', line 108 def patch_headers(app_id, endpoint_id, endpoint_headers_patch_in) @client.execute_request( "PATCH", "/api/v1/app/#{app_id}/endpoint/#{endpoint_id}/headers", body: endpoint_headers_patch_in ) end |
#patch_transformation(app_id, endpoint_id, endpoint_transformation_patch) ⇒ Object
124 125 126 127 128 129 130 |
# File 'lib/svix/api/endpoint.rb', line 124 def patch_transformation(app_id, endpoint_id, endpoint_transformation_patch) @client.execute_request( "PATCH", "/api/v1/app/#{app_id}/endpoint/#{endpoint_id}/transformation", body: endpoint_transformation_patch ) end |
#recover(app_id, endpoint_id, recover_in, options = {}) ⇒ Object
171 172 173 174 175 176 177 178 179 180 181 182 |
# File 'lib/svix/api/endpoint.rb', line 171 def recover(app_id, endpoint_id, recover_in, = {}) = .transform_keys(&:to_s) res = @client.execute_request( "POST", "/api/v1/app/#{app_id}/endpoint/#{endpoint_id}/recover", headers: { "idempotency-key" => ["idempotency-key"] }, body: recover_in ) RecoverOut.deserialize(res) end |
#replay_missing(app_id, endpoint_id, replay_in, options = {}) ⇒ Object
132 133 134 135 136 137 138 139 140 141 142 143 |
# File 'lib/svix/api/endpoint.rb', line 132 def replay_missing(app_id, endpoint_id, replay_in, = {}) = .transform_keys(&:to_s) res = @client.execute_request( "POST", "/api/v1/app/#{app_id}/endpoint/#{endpoint_id}/replay-missing", headers: { "idempotency-key" => ["idempotency-key"] }, body: replay_in ) ReplayOut.deserialize(res) end |
#rotate_secret(app_id, endpoint_id, endpoint_secret_rotate_in, options = {}) ⇒ Object
80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/svix/api/endpoint.rb', line 80 def rotate_secret(app_id, endpoint_id, endpoint_secret_rotate_in, = {}) = .transform_keys(&:to_s) @client.execute_request( "POST", "/api/v1/app/#{app_id}/endpoint/#{endpoint_id}/secret/rotate", headers: { "idempotency-key" => ["idempotency-key"] }, body: endpoint_secret_rotate_in ) end |
#send_example(app_id, endpoint_id, event_example_in, options = {}) ⇒ Object
184 185 186 187 188 189 190 191 192 193 194 195 |
# File 'lib/svix/api/endpoint.rb', line 184 def send_example(app_id, endpoint_id, event_example_in, = {}) = .transform_keys(&:to_s) res = @client.execute_request( "POST", "/api/v1/app/#{app_id}/endpoint/#{endpoint_id}/send-example", headers: { "idempotency-key" => ["idempotency-key"] }, body: event_example_in ) MessageOut.deserialize(res) end |
#transformation_get(app_id, endpoint_id) ⇒ Object
116 117 118 119 120 121 122 |
# File 'lib/svix/api/endpoint.rb', line 116 def transformation_get(app_id, endpoint_id) res = @client.execute_request( "GET", "/api/v1/app/#{app_id}/endpoint/#{endpoint_id}/transformation" ) EndpointTransformationOut.deserialize(res) end |
#transformation_partial_update(app_id, endpoint_id, endpoint_transformation_in) ⇒ Object
197 198 199 200 201 202 203 |
# File 'lib/svix/api/endpoint.rb', line 197 def transformation_partial_update(app_id, endpoint_id, endpoint_transformation_in) @client.execute_request( "PATCH", "/api/v1/app/#{app_id}/endpoint/#{endpoint_id}/transformation", body: endpoint_transformation_in ) end |
#update(app_id, endpoint_id, endpoint_update) ⇒ Object
47 48 49 50 51 52 53 54 |
# File 'lib/svix/api/endpoint.rb', line 47 def update(app_id, endpoint_id, endpoint_update) res = @client.execute_request( "PUT", "/api/v1/app/#{app_id}/endpoint/#{endpoint_id}", body: endpoint_update ) EndpointOut.deserialize(res) end |
#update_headers(app_id, endpoint_id, endpoint_headers_in) ⇒ Object
100 101 102 103 104 105 106 |
# File 'lib/svix/api/endpoint.rb', line 100 def update_headers(app_id, endpoint_id, endpoint_headers_in) @client.execute_request( "PUT", "/api/v1/app/#{app_id}/endpoint/#{endpoint_id}/headers", body: endpoint_headers_in ) end |