Class: UnivapayClientSdk::WebhookCreateRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- UnivapayClientSdk::WebhookCreateRequest
- Defined in:
- lib/univapay_client_sdk/models/webhook_create_request.rb
Overview
Request body to create a new store-level webhook subscription.
Instance Attribute Summary collapse
-
#auth_token ⇒ String
Optional bearer token sent in the
Authorizationheader of webhook requests. -
#triggers ⇒ Array[WebhookTrigger]
List of event types that trigger this webhook.
-
#url ⇒ String
The URL to POST webhook payloads to.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(triggers:, url:, auth_token: SKIP, additional_properties: nil) ⇒ WebhookCreateRequest
constructor
A new instance of WebhookCreateRequest.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(triggers:, url:, auth_token: SKIP, additional_properties: nil) ⇒ WebhookCreateRequest
Returns a new instance of WebhookCreateRequest.
49 50 51 52 53 54 55 56 57 58 |
# File 'lib/univapay_client_sdk/models/webhook_create_request.rb', line 49 def initialize(triggers:, url:, auth_token: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @triggers = triggers @url = url @auth_token = auth_token unless auth_token == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#auth_token ⇒ String
Optional bearer token sent in the Authorization header of webhook
requests.
24 25 26 |
# File 'lib/univapay_client_sdk/models/webhook_create_request.rb', line 24 def auth_token @auth_token end |
#triggers ⇒ Array[WebhookTrigger]
List of event types that trigger this webhook. Must be non-empty and contain only events valid for the store level.
15 16 17 |
# File 'lib/univapay_client_sdk/models/webhook_create_request.rb', line 15 def triggers @triggers end |
#url ⇒ String
The URL to POST webhook payloads to.
19 20 21 |
# File 'lib/univapay_client_sdk/models/webhook_create_request.rb', line 19 def url @url end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/univapay_client_sdk/models/webhook_create_request.rb', line 61 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. triggers = hash.key?('triggers') ? hash['triggers'] : nil url = hash.key?('url') ? hash['url'] : nil auth_token = hash.key?('auth_token') ? hash['auth_token'] : SKIP # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. WebhookCreateRequest.new(triggers: triggers, url: url, auth_token: auth_token, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
27 28 29 30 31 32 33 |
# File 'lib/univapay_client_sdk/models/webhook_create_request.rb', line 27 def self.names @_hash = {} if @_hash.nil? @_hash['triggers'] = 'triggers' @_hash['url'] = 'url' @_hash['auth_token'] = 'auth_token' @_hash end |
.nullables ⇒ Object
An array for nullable fields
43 44 45 46 47 |
# File 'lib/univapay_client_sdk/models/webhook_create_request.rb', line 43 def self.nullables %w[ auth_token ] end |
.optionals ⇒ Object
An array for optional fields
36 37 38 39 40 |
# File 'lib/univapay_client_sdk/models/webhook_create_request.rb', line 36 def self.optionals %w[ auth_token ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
91 92 93 94 95 |
# File 'lib/univapay_client_sdk/models/webhook_create_request.rb', line 91 def inspect class_name = self.class.name.split('::').last "<#{class_name} triggers: #{@triggers.inspect}, url: #{@url.inspect}, auth_token:"\ " #{@auth_token.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
84 85 86 87 88 |
# File 'lib/univapay_client_sdk/models/webhook_create_request.rb', line 84 def to_s class_name = self.class.name.split('::').last "<#{class_name} triggers: #{@triggers}, url: #{@url}, auth_token: #{@auth_token},"\ " additional_properties: #{@additional_properties}>" end |