wesley-key-sdk 4.2.0 → 4.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +34 -47
  3. data/bin/console +4 -4
  4. data/lib/{swagger_petstore_open_api30 → webhooks_and_callbacks_api}/api_helper.rb +2 -2
  5. data/lib/{swagger_petstore_open_api30 → webhooks_and_callbacks_api}/apis/base_api.rb +3 -3
  6. data/lib/webhooks_and_callbacks_api/apis/orders_api.rb +34 -0
  7. data/lib/{swagger_petstore_open_api30 → webhooks_and_callbacks_api}/client.rb +15 -34
  8. data/lib/{swagger_petstore_open_api30 → webhooks_and_callbacks_api}/configuration.rb +20 -30
  9. data/lib/webhooks_and_callbacks_api/events/callbacks/callbacks_a_handler.rb +66 -0
  10. data/lib/webhooks_and_callbacks_api/events/callbacks/callbacks_b_handler.rb +78 -0
  11. data/lib/webhooks_and_callbacks_api/events/signature_verification_failure.rb +33 -0
  12. data/lib/webhooks_and_callbacks_api/events/signature_verification_result.rb +14 -0
  13. data/lib/webhooks_and_callbacks_api/events/unknown_event.rb +32 -0
  14. data/lib/webhooks_and_callbacks_api/events/webhooks/webhooks_a_handler.rb +67 -0
  15. data/lib/webhooks_and_callbacks_api/events/webhooks/webhooks_b_handler.rb +86 -0
  16. data/lib/webhooks_and_callbacks_api/events/webhooks/webhooks_c_handler.rb +79 -0
  17. data/lib/webhooks_and_callbacks_api/events/webhooks/webhooks_handler.rb +67 -0
  18. data/lib/webhooks_and_callbacks_api/events/webhooks/webhooks_no_verification_handler.rb +39 -0
  19. data/lib/{swagger_petstore_open_api30 → webhooks_and_callbacks_api}/exceptions/api_exception.rb +2 -2
  20. data/lib/webhooks_and_callbacks_api/exceptions/error_exception.rb +57 -0
  21. data/lib/{swagger_petstore_open_api30 → webhooks_and_callbacks_api}/http/api_response.rb +2 -2
  22. data/lib/{swagger_petstore_open_api30 → webhooks_and_callbacks_api}/http/auth/api_key.rb +15 -15
  23. data/lib/webhooks_and_callbacks_api/http/auth/bearer_auth.rb +53 -0
  24. data/lib/{swagger_petstore_open_api30 → webhooks_and_callbacks_api}/http/http_call_back.rb +2 -2
  25. data/lib/{swagger_petstore_open_api30 → webhooks_and_callbacks_api}/http/http_method_enum.rb +2 -2
  26. data/lib/{swagger_petstore_open_api30 → webhooks_and_callbacks_api}/http/http_request.rb +2 -2
  27. data/lib/{swagger_petstore_open_api30 → webhooks_and_callbacks_api}/http/http_response.rb +2 -2
  28. data/lib/{swagger_petstore_open_api30 → webhooks_and_callbacks_api}/http/proxy_settings.rb +2 -2
  29. data/lib/{swagger_petstore_open_api30 → webhooks_and_callbacks_api}/logging/configuration/api_logging_configuration.rb +2 -2
  30. data/lib/{swagger_petstore_open_api30 → webhooks_and_callbacks_api}/logging/sdk_logger.rb +2 -2
  31. data/lib/webhooks_and_callbacks_api/models/address.rb +114 -0
  32. data/lib/webhooks_and_callbacks_api/models/audit_log_event.rb +115 -0
  33. data/lib/{swagger_petstore_open_api30 → webhooks_and_callbacks_api}/models/base_model.rb +2 -2
  34. data/lib/webhooks_and_callbacks_api/models/create_order_request.rb +131 -0
  35. data/lib/{swagger_petstore_open_api30/models/tag.rb → webhooks_and_callbacks_api/models/delivery_details.rb} +35 -36
  36. data/lib/webhooks_and_callbacks_api/models/email_notification_callback.rb +97 -0
  37. data/lib/webhooks_and_callbacks_api/models/event.rb +52 -0
  38. data/lib/webhooks_and_callbacks_api/models/event_type.rb +26 -0
  39. data/lib/webhooks_and_callbacks_api/models/event_type1.rb +26 -0
  40. data/lib/webhooks_and_callbacks_api/models/event_type2.rb +26 -0
  41. data/lib/webhooks_and_callbacks_api/models/event_type3.rb +26 -0
  42. data/lib/webhooks_and_callbacks_api/models/fulfillment_callback.rb +411 -0
  43. data/lib/webhooks_and_callbacks_api/models/fulfillment_status.rb +40 -0
  44. data/lib/webhooks_and_callbacks_api/models/fulfillment_statuss.rb +40 -0
  45. data/lib/webhooks_and_callbacks_api/models/inventory_stock_decrease_event.rb +90 -0
  46. data/lib/webhooks_and_callbacks_api/models/inventory_stock_depleted_event.rb +90 -0
  47. data/lib/webhooks_and_callbacks_api/models/inventory_stock_increase_event.rb +90 -0
  48. data/lib/webhooks_and_callbacks_api/models/notification_callback.rb +119 -0
  49. data/lib/webhooks_and_callbacks_api/models/oauth_scope_oauth_acg.rb +44 -0
  50. data/lib/webhooks_and_callbacks_api/models/order.rb +161 -0
  51. data/lib/webhooks_and_callbacks_api/models/order_created_event.rb +314 -0
  52. data/lib/webhooks_and_callbacks_api/models/order_item.rb +102 -0
  53. data/lib/webhooks_and_callbacks_api/models/order_updated_event.rb +100 -0
  54. data/lib/{swagger_petstore_open_api30/models/category.rb → webhooks_and_callbacks_api/models/package.rb} +29 -39
  55. data/lib/webhooks_and_callbacks_api/models/payment_callback.rb +167 -0
  56. data/lib/webhooks_and_callbacks_api/models/payment_completed_event.rb +98 -0
  57. data/lib/webhooks_and_callbacks_api/models/payment_status.rb +40 -0
  58. data/lib/webhooks_and_callbacks_api/models/payment_status_created_event.rb +89 -0
  59. data/lib/webhooks_and_callbacks_api/models/payment_status_updated_event.rb +89 -0
  60. data/lib/webhooks_and_callbacks_api/models/primitive_collection_event.rb +98 -0
  61. data/lib/webhooks_and_callbacks_api/models/root_level_primitive_one_of_event_request.rb +40 -0
  62. data/lib/webhooks_and_callbacks_api/models/root_level_primitive_one_of_event_request1.rb +40 -0
  63. data/lib/webhooks_and_callbacks_api/models/sms_notification_callback.rb +95 -0
  64. data/lib/webhooks_and_callbacks_api/models/status.rb +44 -0
  65. data/lib/webhooks_and_callbacks_api/models/status1.rb +36 -0
  66. data/lib/webhooks_and_callbacks_api/models/status2.rb +36 -0
  67. data/lib/webhooks_and_callbacks_api/models/system_alert_notification_event.rb +90 -0
  68. data/lib/webhooks_and_callbacks_api/models/system_maintenance_notification_event.rb +90 -0
  69. data/lib/webhooks_and_callbacks_api/models/system_performance_notification_event.rb +90 -0
  70. data/lib/webhooks_and_callbacks_api/models/user_action_notification_event.rb +90 -0
  71. data/lib/webhooks_and_callbacks_api/models/user_preference_notification_event.rb +90 -0
  72. data/lib/webhooks_and_callbacks_api/models/user_status_notification_event.rb +90 -0
  73. data/lib/webhooks_and_callbacks_api/models/webhook.rb +142 -0
  74. data/lib/webhooks_and_callbacks_api/models/webhook_registration.rb +103 -0
  75. data/lib/webhooks_and_callbacks_api/models/webhook_update.rb +105 -0
  76. data/lib/{swagger_petstore_open_api30 → webhooks_and_callbacks_api}/utilities/date_time_helper.rb +2 -2
  77. data/lib/{swagger_petstore_open_api30 → webhooks_and_callbacks_api}/utilities/file_wrapper.rb +2 -2
  78. data/lib/webhooks_and_callbacks_api/utilities/union_type_lookup.rb +172 -0
  79. data/lib/webhooks_and_callbacks_api.rb +122 -0
  80. metadata +78 -37
  81. data/lib/swagger_petstore_open_api30/apis/pet_api.rb +0 -287
  82. data/lib/swagger_petstore_open_api30/apis/store_api.rb +0 -131
  83. data/lib/swagger_petstore_open_api30/apis/user_api.rb +0 -233
  84. data/lib/swagger_petstore_open_api30/exceptions/oauth_provider_exception.rb +0 -64
  85. data/lib/swagger_petstore_open_api30/http/auth/petstore_auth.rb +0 -112
  86. data/lib/swagger_petstore_open_api30/models/api_response.rb +0 -118
  87. data/lib/swagger_petstore_open_api30/models/oauth_provider_error.rb +0 -62
  88. data/lib/swagger_petstore_open_api30/models/oauth_scope_petstore_auth.rb +0 -36
  89. data/lib/swagger_petstore_open_api30/models/oauth_token.rb +0 -125
  90. data/lib/swagger_petstore_open_api30/models/order.rb +0 -167
  91. data/lib/swagger_petstore_open_api30/models/order_status.rb +0 -40
  92. data/lib/swagger_petstore_open_api30/models/pet.rb +0 -168
  93. data/lib/swagger_petstore_open_api30/models/pet_status.rb +0 -40
  94. data/lib/swagger_petstore_open_api30/models/user.rb +0 -182
  95. data/lib/swagger_petstore_open_api30/utilities/xml_utilities.rb +0 -12
  96. data/lib/swagger_petstore_open_api30.rb +0 -62
@@ -1,9 +1,9 @@
1
- # swagger_petstore_open_api30
1
+ # webhooks_and_callbacks_api
2
2
  #
3
3
  # This file was automatically generated by
4
4
  # APIMATIC v3.0 ( https://www.apimatic.io ).
5
5
 
6
- module SwaggerPetstoreOpenApi30
6
+ module WebhooksAndCallbacksApi
7
7
  ##
8
8
  # ProxySettings encapsulates HTTP proxy configuration for Faraday,
9
9
  # including optional basic authentication.
@@ -1,9 +1,9 @@
1
- # swagger_petstore_open_api30
1
+ # webhooks_and_callbacks_api
2
2
  #
3
3
  # This file was automatically generated by
4
4
  # APIMATIC v3.0 ( https://www.apimatic.io ).
5
5
 
6
- module SwaggerPetstoreOpenApi30
6
+ module WebhooksAndCallbacksApi
7
7
  # Initializes a new instance of RequestLoggingConfiguration.
8
8
  class RequestLoggingConfiguration < CoreLibrary::ApiRequestLoggingConfiguration
9
9
  # @param log_body [Boolean] Indicates whether the message body should be logged. Default is false.
@@ -1,9 +1,9 @@
1
- # swagger_petstore_open_api30
1
+ # webhooks_and_callbacks_api
2
2
  #
3
3
  # This file was automatically generated by
4
4
  # APIMATIC v3.0 ( https://www.apimatic.io ).
5
5
 
6
- module SwaggerPetstoreOpenApi30
6
+ module WebhooksAndCallbacksApi
7
7
  # Represents the generic logger facade
8
8
  class AbstractLogger < Logger
9
9
  # Logs a message with a specified log level and additional parameters.
@@ -0,0 +1,114 @@
1
+ # webhooks_and_callbacks_api
2
+ #
3
+ # This file was automatically generated by
4
+ # APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module WebhooksAndCallbacksApi
7
+ # Address Model.
8
+ class Address < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [String]
14
+ attr_accessor :street
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [String]
18
+ attr_accessor :city
19
+
20
+ # TODO: Write general description for this method
21
+ # @return [String]
22
+ attr_accessor :zip
23
+
24
+ # A mapping from model property names to API property names.
25
+ def self.names
26
+ @_hash = {} if @_hash.nil?
27
+ @_hash['street'] = 'street'
28
+ @_hash['city'] = 'city'
29
+ @_hash['zip'] = 'zip'
30
+ @_hash
31
+ end
32
+
33
+ # An array for optional fields
34
+ def self.optionals
35
+ %w[
36
+ zip
37
+ ]
38
+ end
39
+
40
+ # An array for nullable fields
41
+ def self.nullables
42
+ []
43
+ end
44
+
45
+ def initialize(street:, city:, zip: SKIP, additional_properties: nil)
46
+ # Add additional model properties to the instance
47
+ additional_properties = {} if additional_properties.nil?
48
+
49
+ @street = street
50
+ @city = city
51
+ @zip = zip unless zip == SKIP
52
+ @additional_properties = additional_properties
53
+ end
54
+
55
+ # Creates an instance of the object from a hash.
56
+ def self.from_hash(hash)
57
+ return nil unless hash
58
+
59
+ # Extract variables from the hash.
60
+ street = hash.key?('street') ? hash['street'] : nil
61
+ city = hash.key?('city') ? hash['city'] : nil
62
+ zip = hash.key?('zip') ? hash['zip'] : SKIP
63
+
64
+ # Create a new hash for additional properties, removing known properties.
65
+ new_hash = hash.reject { |k, _| names.value?(k) }
66
+
67
+ additional_properties = APIHelper.get_additional_properties(
68
+ new_hash, proc { |value| value }
69
+ )
70
+
71
+ # Create object from extracted values.
72
+ Address.new(street: street,
73
+ city: city,
74
+ zip: zip,
75
+ additional_properties: additional_properties)
76
+ end
77
+
78
+ # Validates an instance of the object from a given value.
79
+ # @param [Address | Hash] The value against the validation is performed.
80
+ def self.validate(value)
81
+ if value.instance_of? self
82
+ return (
83
+ APIHelper.valid_type?(value.street,
84
+ ->(val) { val.instance_of? String }) and
85
+ APIHelper.valid_type?(value.city,
86
+ ->(val) { val.instance_of? String })
87
+ )
88
+ end
89
+
90
+ return false unless value.instance_of? Hash
91
+
92
+ (
93
+ APIHelper.valid_type?(value['street'],
94
+ ->(val) { val.instance_of? String }) and
95
+ APIHelper.valid_type?(value['city'],
96
+ ->(val) { val.instance_of? String })
97
+ )
98
+ end
99
+
100
+ # Provides a human-readable string representation of the object.
101
+ def to_s
102
+ class_name = self.class.name.split('::').last
103
+ "<#{class_name} street: #{@street}, city: #{@city}, zip: #{@zip}, additional_properties:"\
104
+ " #{@additional_properties}>"
105
+ end
106
+
107
+ # Provides a debugging-friendly string with detailed object information.
108
+ def inspect
109
+ class_name = self.class.name.split('::').last
110
+ "<#{class_name} street: #{@street.inspect}, city: #{@city.inspect}, zip: #{@zip.inspect},"\
111
+ " additional_properties: #{@additional_properties}>"
112
+ end
113
+ end
114
+ end
@@ -0,0 +1,115 @@
1
+ # webhooks_and_callbacks_api
2
+ #
3
+ # This file was automatically generated by
4
+ # APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module WebhooksAndCallbacksApi
7
+ # AuditLogEvent Model.
8
+ class AuditLogEvent < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [EventType3]
14
+ attr_accessor :event_type
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [String]
18
+ attr_accessor :actor
19
+
20
+ # TODO: Write general description for this method
21
+ # @return [String]
22
+ attr_accessor :action
23
+
24
+ # TODO: Write general description for this method
25
+ # @return [Object]
26
+ attr_accessor :context
27
+
28
+ # A mapping from model property names to API property names.
29
+ def self.names
30
+ @_hash = {} if @_hash.nil?
31
+ @_hash['event_type'] = 'eventType'
32
+ @_hash['actor'] = 'actor'
33
+ @_hash['action'] = 'action'
34
+ @_hash['context'] = 'context'
35
+ @_hash
36
+ end
37
+
38
+ # An array for optional fields
39
+ def self.optionals
40
+ %w[
41
+ event_type
42
+ actor
43
+ action
44
+ context
45
+ ]
46
+ end
47
+
48
+ # An array for nullable fields
49
+ def self.nullables
50
+ []
51
+ end
52
+
53
+ def initialize(event_type: SKIP, actor: SKIP, action: SKIP, context: SKIP,
54
+ additional_properties: nil)
55
+ # Add additional model properties to the instance
56
+ additional_properties = {} if additional_properties.nil?
57
+
58
+ @event_type = event_type unless event_type == SKIP
59
+ @actor = actor unless actor == SKIP
60
+ @action = action unless action == SKIP
61
+ @context = context unless context == SKIP
62
+ @additional_properties = additional_properties
63
+ end
64
+
65
+ # Creates an instance of the object from a hash.
66
+ def self.from_hash(hash)
67
+ return nil unless hash
68
+
69
+ # Extract variables from the hash.
70
+ event_type = hash.key?('eventType') ? hash['eventType'] : SKIP
71
+ actor = hash.key?('actor') ? hash['actor'] : SKIP
72
+ action = hash.key?('action') ? hash['action'] : SKIP
73
+ context = hash.key?('context') ? hash['context'] : SKIP
74
+
75
+ # Create a new hash for additional properties, removing known properties.
76
+ new_hash = hash.reject { |k, _| names.value?(k) }
77
+
78
+ additional_properties = APIHelper.get_additional_properties(
79
+ new_hash, proc { |value| value }
80
+ )
81
+
82
+ # Create object from extracted values.
83
+ AuditLogEvent.new(event_type: event_type,
84
+ actor: actor,
85
+ action: action,
86
+ context: context,
87
+ additional_properties: additional_properties)
88
+ end
89
+
90
+ # Validates an instance of the object from a given value.
91
+ # @param [AuditLogEvent | Hash] The value against the validation is performed.
92
+ def self.validate(value)
93
+ return true if value.instance_of? self
94
+
95
+ return false unless value.instance_of? Hash
96
+
97
+ true
98
+ end
99
+
100
+ # Provides a human-readable string representation of the object.
101
+ def to_s
102
+ class_name = self.class.name.split('::').last
103
+ "<#{class_name} event_type: #{@event_type}, actor: #{@actor}, action: #{@action}, context:"\
104
+ " #{@context}, additional_properties: #{@additional_properties}>"
105
+ end
106
+
107
+ # Provides a debugging-friendly string with detailed object information.
108
+ def inspect
109
+ class_name = self.class.name.split('::').last
110
+ "<#{class_name} event_type: #{@event_type.inspect}, actor: #{@actor.inspect}, action:"\
111
+ " #{@action.inspect}, context: #{@context.inspect}, additional_properties:"\
112
+ " #{@additional_properties}>"
113
+ end
114
+ end
115
+ end
@@ -1,9 +1,9 @@
1
- # swagger_petstore_open_api30
1
+ # webhooks_and_callbacks_api
2
2
  #
3
3
  # This file was automatically generated by
4
4
  # APIMATIC v3.0 ( https://www.apimatic.io ).
5
5
 
6
- module SwaggerPetstoreOpenApi30
6
+ module WebhooksAndCallbacksApi
7
7
  # Base model.
8
8
  # rubocop:disable all
9
9
  class BaseModel < CoreLibrary::BaseModel
@@ -0,0 +1,131 @@
1
+ # webhooks_and_callbacks_api
2
+ #
3
+ # This file was automatically generated by
4
+ # APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module WebhooksAndCallbacksApi
7
+ # CreateOrderRequest Model.
8
+ class CreateOrderRequest < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Unique identifier for the customer
13
+ # @return [String]
14
+ attr_accessor :customer_id
15
+
16
+ # Unique identifier for the customer
17
+ # @return [Array[OrderItem]]
18
+ attr_accessor :items
19
+
20
+ # URL to receive callback notifications
21
+ # @return [String]
22
+ attr_accessor :callback_url
23
+
24
+ # Binary file upload
25
+ # @return [Binary]
26
+ attr_accessor :document
27
+
28
+ # Additional order metadata
29
+ # @return [Object]
30
+ attr_accessor :metadata
31
+
32
+ # Additional order metadata
33
+ # @return [Hash[String, String]]
34
+ attr_accessor :attributes
35
+
36
+ # A mapping from model property names to API property names.
37
+ def self.names
38
+ @_hash = {} if @_hash.nil?
39
+ @_hash['customer_id'] = 'customerId'
40
+ @_hash['items'] = 'items'
41
+ @_hash['callback_url'] = 'callbackUrl'
42
+ @_hash['document'] = 'document'
43
+ @_hash['metadata'] = 'metadata'
44
+ @_hash['attributes'] = 'attributes'
45
+ @_hash
46
+ end
47
+
48
+ # An array for optional fields
49
+ def self.optionals
50
+ %w[
51
+ document
52
+ metadata
53
+ attributes
54
+ ]
55
+ end
56
+
57
+ # An array for nullable fields
58
+ def self.nullables
59
+ []
60
+ end
61
+
62
+ def initialize(customer_id:, items:, callback_url:, document: SKIP,
63
+ metadata: SKIP, attributes: SKIP, additional_properties: nil)
64
+ # Add additional model properties to the instance
65
+ additional_properties = {} if additional_properties.nil?
66
+
67
+ @customer_id = customer_id
68
+ @items = items
69
+ @callback_url = callback_url
70
+ @document = document unless document == SKIP
71
+ @metadata = metadata unless metadata == SKIP
72
+ @attributes = attributes unless attributes == SKIP
73
+ @additional_properties = additional_properties
74
+ end
75
+
76
+ # Creates an instance of the object from a hash.
77
+ def self.from_hash(hash)
78
+ return nil unless hash
79
+
80
+ # Extract variables from the hash.
81
+ customer_id = hash.key?('customerId') ? hash['customerId'] : nil
82
+ # Parameter is an array, so we need to iterate through it
83
+ items = nil
84
+ unless hash['items'].nil?
85
+ items = []
86
+ hash['items'].each do |structure|
87
+ items << (OrderItem.from_hash(structure) if structure)
88
+ end
89
+ end
90
+
91
+ items = nil unless hash.key?('items')
92
+ callback_url = hash.key?('callbackUrl') ? hash['callbackUrl'] : nil
93
+ document = hash.key?('document') ? hash['document'] : SKIP
94
+ metadata = hash.key?('metadata') ? hash['metadata'] : SKIP
95
+ attributes = hash.key?('attributes') ? hash['attributes'] : SKIP
96
+
97
+ # Create a new hash for additional properties, removing known properties.
98
+ new_hash = hash.reject { |k, _| names.value?(k) }
99
+
100
+ additional_properties = APIHelper.get_additional_properties(
101
+ new_hash, proc { |value| value }
102
+ )
103
+
104
+ # Create object from extracted values.
105
+ CreateOrderRequest.new(customer_id: customer_id,
106
+ items: items,
107
+ callback_url: callback_url,
108
+ document: document,
109
+ metadata: metadata,
110
+ attributes: attributes,
111
+ additional_properties: additional_properties)
112
+ end
113
+
114
+ # Provides a human-readable string representation of the object.
115
+ def to_s
116
+ class_name = self.class.name.split('::').last
117
+ "<#{class_name} customer_id: #{@customer_id}, items: #{@items}, callback_url:"\
118
+ " #{@callback_url}, document: #{@document}, metadata: #{@metadata}, attributes:"\
119
+ " #{@attributes}, additional_properties: #{@additional_properties}>"
120
+ end
121
+
122
+ # Provides a debugging-friendly string with detailed object information.
123
+ def inspect
124
+ class_name = self.class.name.split('::').last
125
+ "<#{class_name} customer_id: #{@customer_id.inspect}, items: #{@items.inspect},"\
126
+ " callback_url: #{@callback_url.inspect}, document: #{@document.inspect}, metadata:"\
127
+ " #{@metadata.inspect}, attributes: #{@attributes.inspect}, additional_properties:"\
128
+ " #{@additional_properties}>"
129
+ end
130
+ end
131
+ end
@@ -1,35 +1,36 @@
1
- # swagger_petstore_open_api30
1
+ # webhooks_and_callbacks_api
2
2
  #
3
3
  # This file was automatically generated by
4
4
  # APIMATIC v3.0 ( https://www.apimatic.io ).
5
5
 
6
- module SwaggerPetstoreOpenApi30
7
- # Tag Model.
8
- class Tag < BaseModel
6
+ require 'date'
7
+ module WebhooksAndCallbacksApi
8
+ # DeliveryDetails Model.
9
+ class DeliveryDetails < BaseModel
9
10
  SKIP = Object.new
10
11
  private_constant :SKIP
11
12
 
12
13
  # TODO: Write general description for this method
13
- # @return [Integer]
14
- attr_accessor :id
14
+ # @return [String]
15
+ attr_accessor :method
15
16
 
16
17
  # TODO: Write general description for this method
17
- # @return [String]
18
- attr_accessor :name
18
+ # @return [DateTime]
19
+ attr_accessor :eta
19
20
 
20
21
  # A mapping from model property names to API property names.
21
22
  def self.names
22
23
  @_hash = {} if @_hash.nil?
23
- @_hash['id'] = 'id'
24
- @_hash['name'] = 'name'
24
+ @_hash['method'] = 'method'
25
+ @_hash['eta'] = 'eta'
25
26
  @_hash
26
27
  end
27
28
 
28
29
  # An array for optional fields
29
30
  def self.optionals
30
31
  %w[
31
- id
32
- name
32
+ method
33
+ eta
33
34
  ]
34
35
  end
35
36
 
@@ -38,12 +39,12 @@ module SwaggerPetstoreOpenApi30
38
39
  []
39
40
  end
40
41
 
41
- def initialize(id: SKIP, name: SKIP, additional_properties: nil)
42
+ def initialize(method: SKIP, eta: SKIP, additional_properties: nil)
42
43
  # Add additional model properties to the instance
43
44
  additional_properties = {} if additional_properties.nil?
44
45
 
45
- @id = id unless id == SKIP
46
- @name = name unless name == SKIP
46
+ @method = method unless method == SKIP
47
+ @eta = eta unless eta == SKIP
47
48
  @additional_properties = additional_properties
48
49
  end
49
50
 
@@ -52,8 +53,12 @@ module SwaggerPetstoreOpenApi30
52
53
  return nil unless hash
53
54
 
54
55
  # Extract variables from the hash.
55
- id = hash.key?('id') ? hash['id'] : SKIP
56
- name = hash.key?('name') ? hash['name'] : SKIP
56
+ method = hash.key?('method') ? hash['method'] : SKIP
57
+ eta = if hash.key?('eta')
58
+ (DateTimeHelper.from_rfc3339(hash['eta']) if hash['eta'])
59
+ else
60
+ SKIP
61
+ end
57
62
 
58
63
  # Create a new hash for additional properties, removing known properties.
59
64
  new_hash = hash.reject { |k, _| names.value?(k) }
@@ -63,42 +68,36 @@ module SwaggerPetstoreOpenApi30
63
68
  )
64
69
 
65
70
  # Create object from extracted values.
66
- Tag.new(id: id,
67
- name: name,
68
- additional_properties: additional_properties)
71
+ DeliveryDetails.new(method: method,
72
+ eta: eta,
73
+ additional_properties: additional_properties)
69
74
  end
70
75
 
71
- def self.from_element(root)
72
- id = XmlUtilities.from_element(root, 'id', Integer)
73
- name = XmlUtilities.from_element(root, 'name', String)
74
-
75
- new(id: id,
76
- name: name,
77
- additional_properties: additional_properties)
76
+ def to_custom_eta
77
+ DateTimeHelper.to_rfc3339(eta)
78
78
  end
79
79
 
80
- def to_xml_element(doc, root_name)
81
- root = doc.create_element(root_name)
80
+ # Validates an instance of the object from a given value.
81
+ # @param [DeliveryDetails | Hash] The value against the validation is performed.
82
+ def self.validate(value)
83
+ return true if value.instance_of? self
82
84
 
83
- XmlUtilities.add_as_subelement(doc, root, 'id', id)
84
- XmlUtilities.add_as_subelement(doc, root, 'name', name)
85
- XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
86
- additional_properties)
85
+ return false unless value.instance_of? Hash
87
86
 
88
- root
87
+ true
89
88
  end
90
89
 
91
90
  # Provides a human-readable string representation of the object.
92
91
  def to_s
93
92
  class_name = self.class.name.split('::').last
94
- "<#{class_name} id: #{@id}, name: #{@name}, additional_properties:"\
93
+ "<#{class_name} method: #{@method}, eta: #{@eta}, additional_properties:"\
95
94
  " #{@additional_properties}>"
96
95
  end
97
96
 
98
97
  # Provides a debugging-friendly string with detailed object information.
99
98
  def inspect
100
99
  class_name = self.class.name.split('::').last
101
- "<#{class_name} id: #{@id.inspect}, name: #{@name.inspect}, additional_properties:"\
100
+ "<#{class_name} method: #{@method.inspect}, eta: #{@eta.inspect}, additional_properties:"\
102
101
  " #{@additional_properties}>"
103
102
  end
104
103
  end
@@ -0,0 +1,97 @@
1
+ # webhooks_and_callbacks_api
2
+ #
3
+ # This file was automatically generated by
4
+ # APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module WebhooksAndCallbacksApi
7
+ # EmailNotificationCallback Model.
8
+ class EmailNotificationCallback < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [String]
14
+ attr_accessor :message_id
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [String]
18
+ attr_accessor :recipient_email
19
+
20
+ # TODO: Write general description for this method
21
+ # @return [Status1]
22
+ attr_accessor :status
23
+
24
+ # A mapping from model property names to API property names.
25
+ def self.names
26
+ @_hash = {} if @_hash.nil?
27
+ @_hash['message_id'] = 'messageId'
28
+ @_hash['recipient_email'] = 'recipientEmail'
29
+ @_hash['status'] = 'status'
30
+ @_hash
31
+ end
32
+
33
+ # An array for optional fields
34
+ def self.optionals
35
+ %w[
36
+ message_id
37
+ recipient_email
38
+ status
39
+ ]
40
+ end
41
+
42
+ # An array for nullable fields
43
+ def self.nullables
44
+ []
45
+ end
46
+
47
+ def initialize(message_id: SKIP, recipient_email: SKIP, status: SKIP,
48
+ additional_properties: nil)
49
+ # Add additional model properties to the instance
50
+ additional_properties = {} if additional_properties.nil?
51
+
52
+ @message_id = message_id unless message_id == SKIP
53
+ @recipient_email = recipient_email unless recipient_email == SKIP
54
+ @status = status unless status == SKIP
55
+ @additional_properties = additional_properties
56
+ end
57
+
58
+ # Creates an instance of the object from a hash.
59
+ def self.from_hash(hash)
60
+ return nil unless hash
61
+
62
+ # Extract variables from the hash.
63
+ message_id = hash.key?('messageId') ? hash['messageId'] : SKIP
64
+ recipient_email =
65
+ hash.key?('recipientEmail') ? hash['recipientEmail'] : SKIP
66
+ status = hash.key?('status') ? hash['status'] : SKIP
67
+
68
+ # Create a new hash for additional properties, removing known properties.
69
+ new_hash = hash.reject { |k, _| names.value?(k) }
70
+
71
+ additional_properties = APIHelper.get_additional_properties(
72
+ new_hash, proc { |value| value }
73
+ )
74
+
75
+ # Create object from extracted values.
76
+ EmailNotificationCallback.new(message_id: message_id,
77
+ recipient_email: recipient_email,
78
+ status: status,
79
+ additional_properties: additional_properties)
80
+ end
81
+
82
+ # Provides a human-readable string representation of the object.
83
+ def to_s
84
+ class_name = self.class.name.split('::').last
85
+ "<#{class_name} message_id: #{@message_id}, recipient_email: #{@recipient_email}, status:"\
86
+ " #{@status}, additional_properties: #{@additional_properties}>"
87
+ end
88
+
89
+ # Provides a debugging-friendly string with detailed object information.
90
+ def inspect
91
+ class_name = self.class.name.split('::').last
92
+ "<#{class_name} message_id: #{@message_id.inspect}, recipient_email:"\
93
+ " #{@recipient_email.inspect}, status: #{@status.inspect}, additional_properties:"\
94
+ " #{@additional_properties}>"
95
+ end
96
+ end
97
+ end