Class: UnivapayClientSdk::WebhookUpdateRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- UnivapayClientSdk::WebhookUpdateRequest
- Defined in:
- lib/univapay_client_sdk/models/webhook_update_request.rb
Overview
Request body for updating a webhook. All fields are optional. Omitted fields are left unchanged.
Instance Attribute Summary collapse
-
#active ⇒ TrueClass | FalseClass
Enable or disable the webhook.
-
#auth_token ⇒ String
Update or clear the auth token.
-
#triggers ⇒ Array[WebhookTrigger]
Replace the trigger list.
-
#url ⇒ String
Update the webhook endpoint URL.
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: SKIP, url: SKIP, auth_token: SKIP, active: SKIP, additional_properties: nil) ⇒ WebhookUpdateRequest
constructor
A new instance of WebhookUpdateRequest.
-
#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: SKIP, url: SKIP, auth_token: SKIP, active: SKIP, additional_properties: nil) ⇒ WebhookUpdateRequest
Returns a new instance of WebhookUpdateRequest.
56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/univapay_client_sdk/models/webhook_update_request.rb', line 56 def initialize(triggers: SKIP, url: SKIP, auth_token: SKIP, active: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @triggers = triggers unless triggers == SKIP @url = url unless url == SKIP @auth_token = auth_token unless auth_token == SKIP @active = active unless active == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#active ⇒ TrueClass | FalseClass
Enable or disable the webhook.
27 28 29 |
# File 'lib/univapay_client_sdk/models/webhook_update_request.rb', line 27 def active @active end |
#auth_token ⇒ String
Update or clear the auth token. Send null to remove.
23 24 25 |
# File 'lib/univapay_client_sdk/models/webhook_update_request.rb', line 23 def auth_token @auth_token end |
#triggers ⇒ Array[WebhookTrigger]
Replace the trigger list. Must be non-empty if provided.
15 16 17 |
# File 'lib/univapay_client_sdk/models/webhook_update_request.rb', line 15 def triggers @triggers end |
#url ⇒ String
Update the webhook endpoint URL.
19 20 21 |
# File 'lib/univapay_client_sdk/models/webhook_update_request.rb', line 19 def url @url end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/univapay_client_sdk/models/webhook_update_request.rb', line 69 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. triggers = hash.key?('triggers') ? hash['triggers'] : SKIP url = hash.key?('url') ? hash['url'] : SKIP auth_token = hash.key?('auth_token') ? hash['auth_token'] : SKIP active = hash.key?('active') ? hash['active'] : 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. WebhookUpdateRequest.new(triggers: triggers, url: url, auth_token: auth_token, active: active, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
30 31 32 33 34 35 36 37 |
# File 'lib/univapay_client_sdk/models/webhook_update_request.rb', line 30 def self.names @_hash = {} if @_hash.nil? @_hash['triggers'] = 'triggers' @_hash['url'] = 'url' @_hash['auth_token'] = 'auth_token' @_hash['active'] = 'active' @_hash end |
.nullables ⇒ Object
An array for nullable fields
50 51 52 53 54 |
# File 'lib/univapay_client_sdk/models/webhook_update_request.rb', line 50 def self.nullables %w[ auth_token ] end |
.optionals ⇒ Object
An array for optional fields
40 41 42 43 44 45 46 47 |
# File 'lib/univapay_client_sdk/models/webhook_update_request.rb', line 40 def self.optionals %w[ triggers url auth_token active ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
101 102 103 104 105 106 |
# File 'lib/univapay_client_sdk/models/webhook_update_request.rb', line 101 def inspect class_name = self.class.name.split('::').last "<#{class_name} triggers: #{@triggers.inspect}, url: #{@url.inspect}, auth_token:"\ " #{@auth_token.inspect}, active: #{@active.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
94 95 96 97 98 |
# File 'lib/univapay_client_sdk/models/webhook_update_request.rb', line 94 def to_s class_name = self.class.name.split('::').last "<#{class_name} triggers: #{@triggers}, url: #{@url}, auth_token: #{@auth_token}, active:"\ " #{@active}, additional_properties: #{@additional_properties}>" end |