Class: Onlyfans::Resources::Webhooks
- Inherits:
-
Object
- Object
- Onlyfans::Resources::Webhooks
- Defined in:
- lib/onlyfans/resources/webhooks.rb
Instance Method Summary collapse
-
#create(account_scope:, endpoint_url:, events:, account_ids: nil, signing_secret: nil, request_options: {}) ⇒ Onlyfans::Models::WebhookCreateResponse
Some parameter documentations has been truncated, see Models::WebhookCreateParams for more details.
-
#delete(webhook_id, request_options: {}) ⇒ Hash{Symbol=>Object}?
Delete an existing webhook.
-
#initialize(client:) ⇒ Webhooks
constructor
private
A new instance of Webhooks.
-
#list(request_options: {}) ⇒ Onlyfans::Models::WebhookListResponse
Retrieve a list of webhooks for your Team.
-
#list_events(request_options: {}) ⇒ Onlyfans::Models::WebhookListEventsResponse
Retrieve a list of all available webhook event types.
-
#retrieve(webhook_id, request_options: {}) ⇒ Onlyfans::Models::WebhookRetrieveResponse
Retrieve details about a specific webhook.
-
#update(webhook_id, account_scope:, endpoint_url:, events:, account_ids: nil, enabled: nil, request_options: {}) ⇒ Onlyfans::Models::WebhookUpdateResponse
Some parameter documentations has been truncated, see Models::WebhookUpdateParams for more details.
Constructor Details
#initialize(client:) ⇒ Webhooks
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Webhooks.
155 156 157 |
# File 'lib/onlyfans/resources/webhooks.rb', line 155 def initialize(client:) @client = client end |
Instance Method Details
#create(account_scope:, endpoint_url:, events:, account_ids: nil, signing_secret: nil, request_options: {}) ⇒ Onlyfans::Models::WebhookCreateResponse
Some parameter documentations has been truncated, see Models::WebhookCreateParams for more details.
Create a new webhook for your Team
**List
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/onlyfans/resources/webhooks.rb', line 29 def create(params) parsed, = Onlyfans::WebhookCreateParams.dump_request(params) @client.request( method: :post, path: "api/webhooks", body: parsed, model: Onlyfans::Models::WebhookCreateResponse, options: ) end |
#delete(webhook_id, request_options: {}) ⇒ Hash{Symbol=>Object}?
Delete an existing webhook
125 126 127 128 129 130 131 132 |
# File 'lib/onlyfans/resources/webhooks.rb', line 125 def delete(webhook_id, params = {}) @client.request( method: :delete, path: ["api/webhooks/%1$s", webhook_id], model: Onlyfans::Internal::Type::HashOf[Onlyfans::Internal::Type::Unknown], options: params[:request_options] ) end |
#list(request_options: {}) ⇒ Onlyfans::Models::WebhookListResponse
Retrieve a list of webhooks for your Team
105 106 107 108 109 110 111 112 |
# File 'lib/onlyfans/resources/webhooks.rb', line 105 def list(params = {}) @client.request( method: :get, path: "api/webhooks", model: Onlyfans::Models::WebhookListResponse, options: params[:request_options] ) end |
#list_events(request_options: {}) ⇒ Onlyfans::Models::WebhookListEventsResponse
Retrieve a list of all available webhook event types
143 144 145 146 147 148 149 150 |
# File 'lib/onlyfans/resources/webhooks.rb', line 143 def list_events(params = {}) @client.request( method: :get, path: "api/webhooks/events", model: Onlyfans::Models::WebhookListEventsResponse, options: params[:request_options] ) end |
#retrieve(webhook_id, request_options: {}) ⇒ Onlyfans::Models::WebhookRetrieveResponse
Retrieve details about a specific webhook
51 52 53 54 55 56 57 58 |
# File 'lib/onlyfans/resources/webhooks.rb', line 51 def retrieve(webhook_id, params = {}) @client.request( method: :get, path: ["api/webhooks/%1$s", webhook_id], model: Onlyfans::Models::WebhookRetrieveResponse, options: params[:request_options] ) end |
#update(webhook_id, account_scope:, endpoint_url:, events:, account_ids: nil, enabled: nil, request_options: {}) ⇒ Onlyfans::Models::WebhookUpdateResponse
Some parameter documentations has been truncated, see Models::WebhookUpdateParams for more details.
Update an existing webhook
**List
85 86 87 88 89 90 91 92 93 94 |
# File 'lib/onlyfans/resources/webhooks.rb', line 85 def update(webhook_id, params) parsed, = Onlyfans::WebhookUpdateParams.dump_request(params) @client.request( method: :put, path: ["api/webhooks/%1$s", webhook_id], body: parsed, model: Onlyfans::Models::WebhookUpdateResponse, options: ) end |