growwer 2.0.0 → 2.1.0
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.
- checksums.yaml +4 -4
- data/README.md +57 -4
- data/docs/AccountApi.md +1 -1
- data/docs/AdvanceTestOrderRequest.md +18 -0
- data/docs/BalanceLowEventData.md +20 -0
- data/docs/BalanceLowEventDataWallet.md +20 -0
- data/docs/CatalogueApi.md +2 -2
- data/docs/CreateWebhookRequest.md +24 -0
- data/docs/GetMe200Response.md +3 -1
- data/docs/ListWebhookDeliveries200Response.md +20 -0
- data/docs/ListWebhooks200Response.md +20 -0
- data/docs/OrderEventData.md +18 -0
- data/docs/TestHelpersApi.md +222 -0
- data/docs/TopUpTestWallet200Response.md +20 -0
- data/docs/TopUpTestWalletRequest.md +18 -0
- data/docs/UpdateWebhookRequest.md +26 -0
- data/docs/Webhook.md +38 -0
- data/docs/WebhookDelivery.md +32 -0
- data/docs/WebhookDeliveryAttempt.md +26 -0
- data/docs/WebhookEvent.md +28 -0
- data/docs/WebhookEventData.md +51 -0
- data/docs/WebhookEventType.md +15 -0
- data/docs/WebhookTestEventData.md +18 -0
- data/docs/WebhookWithSecret.md +40 -0
- data/docs/WebhooksApi.md +662 -0
- data/growwer.gemspec +1 -1
- data/lib/growwer/api/account_api.rb +3 -3
- data/lib/growwer/api/buyer_orders_api.rb +1 -1
- data/lib/growwer/api/buyer_wallet_api.rb +1 -1
- data/lib/growwer/api/catalogue_api.rb +5 -5
- data/lib/growwer/api/files_api.rb +1 -1
- data/lib/growwer/api/managed_services_api.rb +1 -1
- data/lib/growwer/api/projects_api.rb +1 -1
- data/lib/growwer/api/saved_filters_api.rb +1 -1
- data/lib/growwer/api/seller_account_api.rb +1 -1
- data/lib/growwer/api/seller_medias_api.rb +1 -1
- data/lib/growwer/api/seller_orders_api.rb +1 -1
- data/lib/growwer/api/seller_wallet_api.rb +1 -1
- data/lib/growwer/api/test_helpers_api.rb +254 -0
- data/lib/growwer/api/webhooks_api.rb +707 -0
- data/lib/growwer/api_client.rb +2 -2
- data/lib/growwer/api_error.rb +1 -1
- data/lib/growwer/api_model_base.rb +1 -1
- data/lib/growwer/configuration.rb +1 -1
- data/lib/growwer/models/advance_test_order_request.rb +189 -0
- data/lib/growwer/models/balance.rb +1 -1
- data/lib/growwer/models/balance_low_event_data.rb +192 -0
- data/lib/growwer/models/balance_low_event_data_wallet.rb +192 -0
- data/lib/growwer/models/catalogue_media.rb +1 -1
- data/lib/growwer/models/catalogue_media_flash_offer.rb +1 -1
- data/lib/growwer/models/catalogue_media_metrics.rb +1 -1
- data/lib/growwer/models/catalogue_offer.rb +1 -1
- data/lib/growwer/models/catalogue_offer_or_null.rb +1 -1
- data/lib/growwer/models/catalogue_post_offer.rb +1 -1
- data/lib/growwer/models/catalogue_post_offer_all_of_extras.rb +1 -1
- data/lib/growwer/models/catalogue_post_offer_all_of_extras_sensitive_topic.rb +1 -1
- data/lib/growwer/models/code_name.rb +1 -1
- data/lib/growwer/models/count_saved_filter_medias200_response.rb +1 -1
- data/lib/growwer/models/create_project_request.rb +1 -1
- data/lib/growwer/models/create_saved_filter_request.rb +1 -1
- data/lib/growwer/models/create_seller_media_request.rb +1 -1
- data/lib/growwer/models/create_seller_media_request_post_offer.rb +1 -1
- data/lib/growwer/models/create_webhook_request.rb +248 -0
- data/lib/growwer/models/error.rb +1 -1
- data/lib/growwer/models/get_buyer_wallet200_response.rb +1 -1
- data/lib/growwer/models/get_me200_response.rb +57 -20
- data/lib/growwer/models/get_me200_response_buyer.rb +1 -1
- data/lib/growwer/models/get_me200_response_catalogue.rb +1 -1
- data/lib/growwer/models/get_me200_response_managed_service.rb +1 -1
- data/lib/growwer/models/get_me200_response_seller.rb +2 -1
- data/lib/growwer/models/get_seller_wallet200_response.rb +1 -1
- data/lib/growwer/models/get_vocabulary200_response.rb +1 -1
- data/lib/growwer/models/get_vocabulary200_response_topics_inner.rb +1 -1
- data/lib/growwer/models/invoice.rb +1 -1
- data/lib/growwer/models/link_addition_order_briefing.rb +1 -1
- data/lib/growwer/models/link_addition_order_briefing_request.rb +1 -1
- data/lib/growwer/models/list_buyer_transactions200_response.rb +1 -1
- data/lib/growwer/models/list_flash_offers200_response.rb +1 -1
- data/lib/growwer/models/list_invoices200_response.rb +1 -1
- data/lib/growwer/models/list_managed_service_campaigns200_response.rb +1 -1
- data/lib/growwer/models/list_managed_service_proposals200_response.rb +1 -1
- data/lib/growwer/models/list_orders200_response.rb +1 -1
- data/lib/growwer/models/list_projects200_response.rb +1 -1
- data/lib/growwer/models/list_saved_filters200_response.rb +1 -1
- data/lib/growwer/models/list_seller_medias200_response.rb +1 -1
- data/lib/growwer/models/list_seller_orders200_response.rb +1 -1
- data/lib/growwer/models/list_seller_transactions200_response.rb +1 -1
- data/lib/growwer/models/list_webhook_deliveries200_response.rb +192 -0
- data/lib/growwer/models/list_webhooks200_response.rb +192 -0
- data/lib/growwer/models/list_withdrawals200_response.rb +1 -1
- data/lib/growwer/models/managed_service_campaign.rb +1 -1
- data/lib/growwer/models/managed_service_campaign_project.rb +1 -1
- data/lib/growwer/models/managed_service_campaign_proposal_counts.rb +1 -1
- data/lib/growwer/models/managed_service_campaign_strategy.rb +1 -1
- data/lib/growwer/models/managed_service_proposal.rb +1 -1
- data/lib/growwer/models/managed_service_proposal_briefing.rb +1 -1
- data/lib/growwer/models/managed_service_proposal_briefing_links_inner.rb +1 -1
- data/lib/growwer/models/managed_service_proposal_media.rb +1 -1
- data/lib/growwer/models/managed_service_proposal_review.rb +1 -1
- data/lib/growwer/models/managed_service_proposal_review_request.rb +1 -1
- data/lib/growwer/models/managed_service_proposal_review_request_reviews_inner.rb +1 -1
- data/lib/growwer/models/managed_service_proposals_estimate.rb +1 -1
- data/lib/growwer/models/managed_service_proposals_estimate_request.rb +1 -1
- data/lib/growwer/models/managed_service_request.rb +1 -1
- data/lib/growwer/models/managed_service_request_sent.rb +1 -1
- data/lib/growwer/models/money.rb +1 -1
- data/lib/growwer/models/money_or_null.rb +1 -1
- data/lib/growwer/models/order.rb +1 -1
- data/lib/growwer/models/order_action_reason.rb +1 -1
- data/lib/growwer/models/order_briefing.rb +1 -1
- data/lib/growwer/models/order_channel.rb +1 -1
- data/lib/growwer/models/order_create_request.rb +1 -1
- data/lib/growwer/models/order_delivery.rb +1 -1
- data/lib/growwer/models/order_draft.rb +1 -1
- data/lib/growwer/models/order_estimate.rb +1 -1
- data/lib/growwer/models/order_estimate_request.rb +1 -1
- data/lib/growwer/models/order_estimate_request_briefing.rb +1 -1
- data/lib/growwer/models/order_event_data.rb +165 -0
- data/lib/growwer/models/order_link.rb +1 -1
- data/lib/growwer/models/order_link_request.rb +1 -1
- data/lib/growwer/models/order_media.rb +1 -1
- data/lib/growwer/models/order_project.rb +1 -1
- data/lib/growwer/models/order_state_history_inner.rb +1 -1
- data/lib/growwer/models/order_state_history_inner_reason.rb +1 -1
- data/lib/growwer/models/post_order_briefing.rb +1 -1
- data/lib/growwer/models/post_order_briefing_request.rb +1 -1
- data/lib/growwer/models/project.rb +1 -1
- data/lib/growwer/models/project_catalogue_media.rb +1 -1
- data/lib/growwer/models/project_catalogue_media_all_of_project.rb +1 -1
- data/lib/growwer/models/project_catalogue_media_all_of_project_ai_keywords.rb +1 -1
- data/lib/growwer/models/put_seller_holiday200_response.rb +1 -1
- data/lib/growwer/models/put_seller_holiday_request.rb +1 -1
- data/lib/growwer/models/request_medias201_response.rb +1 -1
- data/lib/growwer/models/request_medias_request.rb +1 -1
- data/lib/growwer/models/saved_filter.rb +1 -1
- data/lib/growwer/models/saved_filter_notifications.rb +1 -1
- data/lib/growwer/models/seller_fees.rb +1 -1
- data/lib/growwer/models/seller_fees_or_null.rb +1 -1
- data/lib/growwer/models/seller_media.rb +1 -1
- data/lib/growwer/models/seller_media_flash_offer.rb +1 -1
- data/lib/growwer/models/seller_media_link_addition_offer.rb +1 -1
- data/lib/growwer/models/seller_media_link_addition_offer_pricing_options_inner.rb +1 -1
- data/lib/growwer/models/seller_media_post_offer.rb +1 -1
- data/lib/growwer/models/seller_media_post_offer_pricing_options_inner.rb +1 -1
- data/lib/growwer/models/seller_order.rb +1 -1
- data/lib/growwer/models/seller_order_briefing.rb +1 -1
- data/lib/growwer/models/seller_order_channel.rb +1 -1
- data/lib/growwer/models/seller_order_draft.rb +1 -1
- data/lib/growwer/models/seller_order_draft_file.rb +1 -1
- data/lib/growwer/models/seller_order_post_delivery.rb +1 -1
- data/lib/growwer/models/seller_order_project.rb +1 -1
- data/lib/growwer/models/seller_order_refutation.rb +1 -1
- data/lib/growwer/models/seller_order_rejection.rb +1 -1
- data/lib/growwer/models/seller_order_rejection_reason.rb +1 -1
- data/lib/growwer/models/seller_post_order_briefing.rb +1 -1
- data/lib/growwer/models/seller_transaction.rb +1 -1
- data/lib/growwer/models/top_up_test_wallet200_response.rb +191 -0
- data/lib/growwer/models/top_up_test_wallet_request.rb +165 -0
- data/lib/growwer/models/transaction.rb +1 -1
- data/lib/growwer/models/update_project_request.rb +1 -1
- data/lib/growwer/models/update_seller_media_request.rb +1 -1
- data/lib/growwer/models/update_seller_media_request_extra_services_inner.rb +1 -1
- data/lib/growwer/models/update_seller_media_request_link_addition_offer.rb +1 -1
- data/lib/growwer/models/update_seller_media_request_link_addition_offer_pricing_options_inner.rb +1 -1
- data/lib/growwer/models/update_seller_media_request_post_offer.rb +1 -1
- data/lib/growwer/models/update_seller_media_request_post_offer_pricing_options_inner.rb +1 -1
- data/lib/growwer/models/update_webhook_request.rb +245 -0
- data/lib/growwer/models/upload_file201_response.rb +1 -1
- data/lib/growwer/models/webhook.rb +395 -0
- data/lib/growwer/models/webhook_delivery.rb +365 -0
- data/lib/growwer/models/webhook_delivery_attempt.rb +264 -0
- data/lib/growwer/models/webhook_event.rb +324 -0
- data/lib/growwer/models/webhook_event_data.rb +104 -0
- data/lib/growwer/models/webhook_event_type.rb +46 -0
- data/lib/growwer/models/webhook_test_event_data.rb +166 -0
- data/lib/growwer/models/webhook_with_secret.rb +413 -0
- data/lib/growwer/models/withdrawal.rb +1 -1
- data/lib/growwer/version.rb +2 -2
- data/lib/growwer.rb +21 -1
- data/spec/api/test_helpers_api_spec.rb +74 -0
- data/spec/api/webhooks_api_spec.rb +154 -0
- data/spec/models/advance_test_order_request_spec.rb +40 -0
- data/spec/models/balance_low_event_data_spec.rb +42 -0
- data/spec/models/balance_low_event_data_wallet_spec.rb +42 -0
- data/spec/models/create_webhook_request_spec.rb +54 -0
- data/spec/models/list_webhook_deliveries200_response_spec.rb +42 -0
- data/spec/models/list_webhooks200_response_spec.rb +42 -0
- data/spec/models/order_event_data_spec.rb +36 -0
- data/spec/models/top_up_test_wallet200_response_spec.rb +42 -0
- data/spec/models/top_up_test_wallet_request_spec.rb +36 -0
- data/spec/models/update_webhook_request_spec.rb +60 -0
- data/spec/models/webhook_delivery_attempt_spec.rb +64 -0
- data/spec/models/webhook_delivery_spec.rb +86 -0
- data/spec/models/webhook_event_data_spec.rb +32 -0
- data/spec/models/webhook_event_spec.rb +78 -0
- data/spec/models/webhook_event_type_spec.rb +30 -0
- data/spec/models/webhook_spec.rb +100 -0
- data/spec/models/webhook_test_event_data_spec.rb +36 -0
- data/spec/models/webhook_with_secret_spec.rb +106 -0
- data/spec/spec_helper.rb +1 -1
- metadata +82 -2
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Growwer API
|
|
3
|
+
|
|
4
|
+
#The Growwer customer API. Authenticate every call with an API key created on your profile page, sent as `Authorization: Bearer <key>`. A read key can call every GET operation; writes need a read and write key and an `Idempotency-Key` header. Idempotency: use a new `Idempotency-Key` (1 to 255 printable ASCII characters without spaces) for each operation and reuse it only to retry that same operation. Keys belong to your account, not to one API key. - A successful write is stored for 30 days: a retry with the same key and the same request replays its response with `Idempotent-Replayed: true` and does nothing again. - A refused write (4xx) has no effect and releases its key: once you fix the cause, retry with the same key and the write runs. - A failed write (5xx) may have taken effect, so it is never run again under its key: a retry gets 409 `idempotency_outcome_unknown`. Check whether it took effect before retrying with a new key. - A retry while the first request is still running gets 409 `idempotency_request_in_progress`. A request still running after 5 minutes is treated as failed: a retry gets 409 `idempotency_outcome_unknown`. - The same key with a different request (method, path, query or body) gets 409 `idempotency_key_reused`. A write without the header gets 400 `idempotency_key_required`. Test mode: a test key (`gw_sk_test_` plus 43 characters) works on your account's test data alone, apart from the real catalogue: test projects, orders and files, and a test wallet that starts at 1,000.00 EUR. Every response to a test key carries `Growwer-Mode: test`, and an id of the other mode answers 404 as a missing object would. - A test order is validated and debited from the test wallet as a live one is. A simulated seller accepts it a minute later and delivers it two minutes after that; you approve the delivery or request an update. - The Test helpers top the test wallet up, move a test order on at once and reset your test data. A live key on them gets 403 `test_mode_only`. - A test key on the seller and managed service operations, on a project's catalogue writes and on media requests gets 403 `not_available_in_test_mode`. - Idempotency keys are scoped per mode: the same `Idempotency-Key` sent with a live and a test key never replays the other mode's response. Webhooks: a subscription receives the events of its mode, signed as Standard Webhooks. A subscription created with a live key gets the events of your orders and your wallet; one created with a test key gets those of your test orders and test wallet, with `mode: test`, and never a live event. `x-webhooks` lists every event Growwer POSTs and its payload; the WebhookEvent schema describes the headers, the signature and the retries. Every response carries `X-Request-Id`. Errors share one shape, `{code, message, requestId, details?}`. Money is integer cents plus a currency code and dates are ISO-8601.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1
|
|
7
|
+
Contact: support@growwer.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.24.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Growwer
|
|
17
|
+
class WebhookDelivery < ApiModelBase
|
|
18
|
+
attr_accessor :id
|
|
19
|
+
|
|
20
|
+
# The event's id, sent as `webhook-id` on every attempt and redelivery.
|
|
21
|
+
attr_accessor :event_id
|
|
22
|
+
|
|
23
|
+
attr_accessor :event_type
|
|
24
|
+
|
|
25
|
+
# `pending` while it is sent or retried, `succeeded` once an attempt got a 2xx, `failed` once the retries ran out, the endpoint answered 410 or the subscription was disabled.
|
|
26
|
+
attr_accessor :status
|
|
27
|
+
|
|
28
|
+
# How many attempts it took, redeliveries included.
|
|
29
|
+
attr_accessor :attempt_count
|
|
30
|
+
|
|
31
|
+
# When the next retry is due, null when none is.
|
|
32
|
+
attr_accessor :next_attempt_at
|
|
33
|
+
|
|
34
|
+
attr_accessor :created_at
|
|
35
|
+
|
|
36
|
+
# The latest 10 attempts, newest first.
|
|
37
|
+
attr_accessor :attempts
|
|
38
|
+
|
|
39
|
+
class EnumAttributeValidator
|
|
40
|
+
attr_reader :datatype
|
|
41
|
+
attr_reader :allowable_values
|
|
42
|
+
|
|
43
|
+
def initialize(datatype, allowable_values)
|
|
44
|
+
@allowable_values = allowable_values.map do |value|
|
|
45
|
+
case datatype.to_s
|
|
46
|
+
when /Integer/i
|
|
47
|
+
value.to_i
|
|
48
|
+
when /Float/i
|
|
49
|
+
value.to_f
|
|
50
|
+
else
|
|
51
|
+
value
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def valid?(value)
|
|
57
|
+
!value || allowable_values.include?(value)
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
62
|
+
def self.attribute_map
|
|
63
|
+
{
|
|
64
|
+
:'id' => :'id',
|
|
65
|
+
:'event_id' => :'eventId',
|
|
66
|
+
:'event_type' => :'eventType',
|
|
67
|
+
:'status' => :'status',
|
|
68
|
+
:'attempt_count' => :'attemptCount',
|
|
69
|
+
:'next_attempt_at' => :'nextAttemptAt',
|
|
70
|
+
:'created_at' => :'createdAt',
|
|
71
|
+
:'attempts' => :'attempts'
|
|
72
|
+
}
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Returns attribute mapping this model knows about
|
|
76
|
+
def self.acceptable_attribute_map
|
|
77
|
+
attribute_map
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# Returns all the JSON keys this model knows about
|
|
81
|
+
def self.acceptable_attributes
|
|
82
|
+
acceptable_attribute_map.values
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Attribute type mapping.
|
|
86
|
+
def self.openapi_types
|
|
87
|
+
{
|
|
88
|
+
:'id' => :'String',
|
|
89
|
+
:'event_id' => :'String',
|
|
90
|
+
:'event_type' => :'String',
|
|
91
|
+
:'status' => :'String',
|
|
92
|
+
:'attempt_count' => :'Integer',
|
|
93
|
+
:'next_attempt_at' => :'Time',
|
|
94
|
+
:'created_at' => :'Time',
|
|
95
|
+
:'attempts' => :'Array<WebhookDeliveryAttempt>'
|
|
96
|
+
}
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# List of attributes with nullable: true
|
|
100
|
+
def self.openapi_nullable
|
|
101
|
+
Set.new([
|
|
102
|
+
:'next_attempt_at',
|
|
103
|
+
])
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Initializes the object
|
|
107
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
108
|
+
def initialize(attributes = {})
|
|
109
|
+
if (!attributes.is_a?(Hash))
|
|
110
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Growwer::WebhookDelivery` initialize method"
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
114
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
115
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
116
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
117
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Growwer::WebhookDelivery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
118
|
+
end
|
|
119
|
+
h[k.to_sym] = v
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if attributes.key?(:'id')
|
|
123
|
+
self.id = attributes[:'id']
|
|
124
|
+
else
|
|
125
|
+
self.id = nil
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
if attributes.key?(:'event_id')
|
|
129
|
+
self.event_id = attributes[:'event_id']
|
|
130
|
+
else
|
|
131
|
+
self.event_id = nil
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
if attributes.key?(:'event_type')
|
|
135
|
+
self.event_type = attributes[:'event_type']
|
|
136
|
+
else
|
|
137
|
+
self.event_type = nil
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
if attributes.key?(:'status')
|
|
141
|
+
self.status = attributes[:'status']
|
|
142
|
+
else
|
|
143
|
+
self.status = nil
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
if attributes.key?(:'attempt_count')
|
|
147
|
+
self.attempt_count = attributes[:'attempt_count']
|
|
148
|
+
else
|
|
149
|
+
self.attempt_count = nil
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
if attributes.key?(:'next_attempt_at')
|
|
153
|
+
self.next_attempt_at = attributes[:'next_attempt_at']
|
|
154
|
+
else
|
|
155
|
+
self.next_attempt_at = nil
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
if attributes.key?(:'created_at')
|
|
159
|
+
self.created_at = attributes[:'created_at']
|
|
160
|
+
else
|
|
161
|
+
self.created_at = nil
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
if attributes.key?(:'attempts')
|
|
165
|
+
if (value = attributes[:'attempts']).is_a?(Array)
|
|
166
|
+
self.attempts = value
|
|
167
|
+
end
|
|
168
|
+
else
|
|
169
|
+
self.attempts = nil
|
|
170
|
+
end
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
174
|
+
# @return Array for valid properties with the reasons
|
|
175
|
+
def list_invalid_properties
|
|
176
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
177
|
+
invalid_properties = Array.new
|
|
178
|
+
if @id.nil?
|
|
179
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
if @event_id.nil?
|
|
183
|
+
invalid_properties.push('invalid value for "event_id", event_id cannot be nil.')
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
if @event_type.nil?
|
|
187
|
+
invalid_properties.push('invalid value for "event_type", event_type cannot be nil.')
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
if @status.nil?
|
|
191
|
+
invalid_properties.push('invalid value for "status", status cannot be nil.')
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
if @attempt_count.nil?
|
|
195
|
+
invalid_properties.push('invalid value for "attempt_count", attempt_count cannot be nil.')
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
if @created_at.nil?
|
|
199
|
+
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
if @attempts.nil?
|
|
203
|
+
invalid_properties.push('invalid value for "attempts", attempts cannot be nil.')
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
invalid_properties
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
# Check to see if the all the properties in the model are valid
|
|
210
|
+
# @return true if the model is valid
|
|
211
|
+
def valid?
|
|
212
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
213
|
+
return false if @id.nil?
|
|
214
|
+
return false if @event_id.nil?
|
|
215
|
+
return false if @event_type.nil?
|
|
216
|
+
event_type_validator = EnumAttributeValidator.new('String', ["order.created", "order.accepted", "order.rejected", "order.published", "order.update_requested", "order.completed", "order.cancelled", "balance.low", "webhook.test"])
|
|
217
|
+
return false unless event_type_validator.valid?(@event_type)
|
|
218
|
+
return false if @status.nil?
|
|
219
|
+
status_validator = EnumAttributeValidator.new('String', ["pending", "succeeded", "failed"])
|
|
220
|
+
return false unless status_validator.valid?(@status)
|
|
221
|
+
return false if @attempt_count.nil?
|
|
222
|
+
return false if @created_at.nil?
|
|
223
|
+
return false if @attempts.nil?
|
|
224
|
+
true
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
# Custom attribute writer method with validation
|
|
228
|
+
# @param [Object] id Value to be assigned
|
|
229
|
+
def id=(id)
|
|
230
|
+
if id.nil?
|
|
231
|
+
fail ArgumentError, 'id cannot be nil'
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
@id = id
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
# Custom attribute writer method with validation
|
|
238
|
+
# @param [Object] event_id Value to be assigned
|
|
239
|
+
def event_id=(event_id)
|
|
240
|
+
if event_id.nil?
|
|
241
|
+
fail ArgumentError, 'event_id cannot be nil'
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
@event_id = event_id
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
248
|
+
# @param [Object] event_type Object to be assigned
|
|
249
|
+
def event_type=(event_type)
|
|
250
|
+
validator = EnumAttributeValidator.new('String', ["order.created", "order.accepted", "order.rejected", "order.published", "order.update_requested", "order.completed", "order.cancelled", "balance.low", "webhook.test"])
|
|
251
|
+
unless validator.valid?(event_type)
|
|
252
|
+
fail ArgumentError, "invalid value for \"event_type\", must be one of #{validator.allowable_values}."
|
|
253
|
+
end
|
|
254
|
+
@event_type = event_type
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
258
|
+
# @param [Object] status Object to be assigned
|
|
259
|
+
def status=(status)
|
|
260
|
+
validator = EnumAttributeValidator.new('String', ["pending", "succeeded", "failed"])
|
|
261
|
+
unless validator.valid?(status)
|
|
262
|
+
fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
|
|
263
|
+
end
|
|
264
|
+
@status = status
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
# Custom attribute writer method with validation
|
|
268
|
+
# @param [Object] attempt_count Value to be assigned
|
|
269
|
+
def attempt_count=(attempt_count)
|
|
270
|
+
if attempt_count.nil?
|
|
271
|
+
fail ArgumentError, 'attempt_count cannot be nil'
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
@attempt_count = attempt_count
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
# Custom attribute writer method with validation
|
|
278
|
+
# @param [Object] created_at Value to be assigned
|
|
279
|
+
def created_at=(created_at)
|
|
280
|
+
if created_at.nil?
|
|
281
|
+
fail ArgumentError, 'created_at cannot be nil'
|
|
282
|
+
end
|
|
283
|
+
|
|
284
|
+
@created_at = created_at
|
|
285
|
+
end
|
|
286
|
+
|
|
287
|
+
# Custom attribute writer method with validation
|
|
288
|
+
# @param [Object] attempts Value to be assigned
|
|
289
|
+
def attempts=(attempts)
|
|
290
|
+
if attempts.nil?
|
|
291
|
+
fail ArgumentError, 'attempts cannot be nil'
|
|
292
|
+
end
|
|
293
|
+
|
|
294
|
+
@attempts = attempts
|
|
295
|
+
end
|
|
296
|
+
|
|
297
|
+
# Checks equality by comparing each attribute.
|
|
298
|
+
# @param [Object] Object to be compared
|
|
299
|
+
def ==(o)
|
|
300
|
+
return true if self.equal?(o)
|
|
301
|
+
self.class == o.class &&
|
|
302
|
+
id == o.id &&
|
|
303
|
+
event_id == o.event_id &&
|
|
304
|
+
event_type == o.event_type &&
|
|
305
|
+
status == o.status &&
|
|
306
|
+
attempt_count == o.attempt_count &&
|
|
307
|
+
next_attempt_at == o.next_attempt_at &&
|
|
308
|
+
created_at == o.created_at &&
|
|
309
|
+
attempts == o.attempts
|
|
310
|
+
end
|
|
311
|
+
|
|
312
|
+
# @see the `==` method
|
|
313
|
+
# @param [Object] Object to be compared
|
|
314
|
+
def eql?(o)
|
|
315
|
+
self == o
|
|
316
|
+
end
|
|
317
|
+
|
|
318
|
+
# Calculates hash code according to all attributes.
|
|
319
|
+
# @return [Integer] Hash code
|
|
320
|
+
def hash
|
|
321
|
+
[id, event_id, event_type, status, attempt_count, next_attempt_at, created_at, attempts].hash
|
|
322
|
+
end
|
|
323
|
+
|
|
324
|
+
# Builds the object from hash
|
|
325
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
326
|
+
# @return [Object] Returns the model itself
|
|
327
|
+
def self.build_from_hash(attributes)
|
|
328
|
+
return nil unless attributes.is_a?(Hash)
|
|
329
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
330
|
+
transformed_hash = {}
|
|
331
|
+
openapi_types.each_pair do |key, type|
|
|
332
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
333
|
+
transformed_hash["#{key}"] = nil
|
|
334
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
335
|
+
# check to ensure the input is an array given that the attribute
|
|
336
|
+
# is documented as an array but the input is not
|
|
337
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
338
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
339
|
+
end
|
|
340
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
341
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
342
|
+
end
|
|
343
|
+
end
|
|
344
|
+
new(transformed_hash)
|
|
345
|
+
end
|
|
346
|
+
|
|
347
|
+
# Returns the object in the form of hash
|
|
348
|
+
# @return [Hash] Returns the object in the form of hash
|
|
349
|
+
def to_hash
|
|
350
|
+
hash = {}
|
|
351
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
352
|
+
value = self.send(attr)
|
|
353
|
+
if value.nil?
|
|
354
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
355
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
356
|
+
end
|
|
357
|
+
|
|
358
|
+
hash[param] = _to_hash(value)
|
|
359
|
+
end
|
|
360
|
+
hash
|
|
361
|
+
end
|
|
362
|
+
|
|
363
|
+
end
|
|
364
|
+
|
|
365
|
+
end
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Growwer API
|
|
3
|
+
|
|
4
|
+
#The Growwer customer API. Authenticate every call with an API key created on your profile page, sent as `Authorization: Bearer <key>`. A read key can call every GET operation; writes need a read and write key and an `Idempotency-Key` header. Idempotency: use a new `Idempotency-Key` (1 to 255 printable ASCII characters without spaces) for each operation and reuse it only to retry that same operation. Keys belong to your account, not to one API key. - A successful write is stored for 30 days: a retry with the same key and the same request replays its response with `Idempotent-Replayed: true` and does nothing again. - A refused write (4xx) has no effect and releases its key: once you fix the cause, retry with the same key and the write runs. - A failed write (5xx) may have taken effect, so it is never run again under its key: a retry gets 409 `idempotency_outcome_unknown`. Check whether it took effect before retrying with a new key. - A retry while the first request is still running gets 409 `idempotency_request_in_progress`. A request still running after 5 minutes is treated as failed: a retry gets 409 `idempotency_outcome_unknown`. - The same key with a different request (method, path, query or body) gets 409 `idempotency_key_reused`. A write without the header gets 400 `idempotency_key_required`. Test mode: a test key (`gw_sk_test_` plus 43 characters) works on your account's test data alone, apart from the real catalogue: test projects, orders and files, and a test wallet that starts at 1,000.00 EUR. Every response to a test key carries `Growwer-Mode: test`, and an id of the other mode answers 404 as a missing object would. - A test order is validated and debited from the test wallet as a live one is. A simulated seller accepts it a minute later and delivers it two minutes after that; you approve the delivery or request an update. - The Test helpers top the test wallet up, move a test order on at once and reset your test data. A live key on them gets 403 `test_mode_only`. - A test key on the seller and managed service operations, on a project's catalogue writes and on media requests gets 403 `not_available_in_test_mode`. - Idempotency keys are scoped per mode: the same `Idempotency-Key` sent with a live and a test key never replays the other mode's response. Webhooks: a subscription receives the events of its mode, signed as Standard Webhooks. A subscription created with a live key gets the events of your orders and your wallet; one created with a test key gets those of your test orders and test wallet, with `mode: test`, and never a live event. `x-webhooks` lists every event Growwer POSTs and its payload; the WebhookEvent schema describes the headers, the signature and the retries. Every response carries `X-Request-Id`. Errors share one shape, `{code, message, requestId, details?}`. Money is integer cents plus a currency code and dates are ISO-8601.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1
|
|
7
|
+
Contact: support@growwer.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.24.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Growwer
|
|
17
|
+
class WebhookDeliveryAttempt < ApiModelBase
|
|
18
|
+
attr_accessor :attempted_at
|
|
19
|
+
|
|
20
|
+
# The HTTP status your endpoint answered, null when it did not answer. Only 2xx succeeds; a redirect is not followed and fails.
|
|
21
|
+
attr_accessor :status_code
|
|
22
|
+
|
|
23
|
+
# How long the attempt took, in milliseconds. It gives up after 15 seconds.
|
|
24
|
+
attr_accessor :duration_ms
|
|
25
|
+
|
|
26
|
+
# Up to the first 1024 bytes of the response body, null when it did not answer.
|
|
27
|
+
attr_accessor :response_body
|
|
28
|
+
|
|
29
|
+
# Why there is no status, null when it answered. `address_not_allowed`, its host resolved to, or connected to, an address that is not public.
|
|
30
|
+
attr_accessor :error
|
|
31
|
+
|
|
32
|
+
class EnumAttributeValidator
|
|
33
|
+
attr_reader :datatype
|
|
34
|
+
attr_reader :allowable_values
|
|
35
|
+
|
|
36
|
+
def initialize(datatype, allowable_values)
|
|
37
|
+
@allowable_values = allowable_values.map do |value|
|
|
38
|
+
case datatype.to_s
|
|
39
|
+
when /Integer/i
|
|
40
|
+
value.to_i
|
|
41
|
+
when /Float/i
|
|
42
|
+
value.to_f
|
|
43
|
+
else
|
|
44
|
+
value
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def valid?(value)
|
|
50
|
+
!value || allowable_values.include?(value)
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
55
|
+
def self.attribute_map
|
|
56
|
+
{
|
|
57
|
+
:'attempted_at' => :'attemptedAt',
|
|
58
|
+
:'status_code' => :'statusCode',
|
|
59
|
+
:'duration_ms' => :'durationMs',
|
|
60
|
+
:'response_body' => :'responseBody',
|
|
61
|
+
:'error' => :'error'
|
|
62
|
+
}
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Returns attribute mapping this model knows about
|
|
66
|
+
def self.acceptable_attribute_map
|
|
67
|
+
attribute_map
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Returns all the JSON keys this model knows about
|
|
71
|
+
def self.acceptable_attributes
|
|
72
|
+
acceptable_attribute_map.values
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Attribute type mapping.
|
|
76
|
+
def self.openapi_types
|
|
77
|
+
{
|
|
78
|
+
:'attempted_at' => :'Time',
|
|
79
|
+
:'status_code' => :'Integer',
|
|
80
|
+
:'duration_ms' => :'Integer',
|
|
81
|
+
:'response_body' => :'String',
|
|
82
|
+
:'error' => :'String'
|
|
83
|
+
}
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# List of attributes with nullable: true
|
|
87
|
+
def self.openapi_nullable
|
|
88
|
+
Set.new([
|
|
89
|
+
:'status_code',
|
|
90
|
+
:'response_body',
|
|
91
|
+
:'error'
|
|
92
|
+
])
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Initializes the object
|
|
96
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
97
|
+
def initialize(attributes = {})
|
|
98
|
+
if (!attributes.is_a?(Hash))
|
|
99
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Growwer::WebhookDeliveryAttempt` initialize method"
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
103
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
104
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
105
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
106
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Growwer::WebhookDeliveryAttempt`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
107
|
+
end
|
|
108
|
+
h[k.to_sym] = v
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if attributes.key?(:'attempted_at')
|
|
112
|
+
self.attempted_at = attributes[:'attempted_at']
|
|
113
|
+
else
|
|
114
|
+
self.attempted_at = nil
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
if attributes.key?(:'status_code')
|
|
118
|
+
self.status_code = attributes[:'status_code']
|
|
119
|
+
else
|
|
120
|
+
self.status_code = nil
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
if attributes.key?(:'duration_ms')
|
|
124
|
+
self.duration_ms = attributes[:'duration_ms']
|
|
125
|
+
else
|
|
126
|
+
self.duration_ms = nil
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
if attributes.key?(:'response_body')
|
|
130
|
+
self.response_body = attributes[:'response_body']
|
|
131
|
+
else
|
|
132
|
+
self.response_body = nil
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
if attributes.key?(:'error')
|
|
136
|
+
self.error = attributes[:'error']
|
|
137
|
+
else
|
|
138
|
+
self.error = nil
|
|
139
|
+
end
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
143
|
+
# @return Array for valid properties with the reasons
|
|
144
|
+
def list_invalid_properties
|
|
145
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
146
|
+
invalid_properties = Array.new
|
|
147
|
+
if @attempted_at.nil?
|
|
148
|
+
invalid_properties.push('invalid value for "attempted_at", attempted_at cannot be nil.')
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
if @duration_ms.nil?
|
|
152
|
+
invalid_properties.push('invalid value for "duration_ms", duration_ms cannot be nil.')
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
invalid_properties
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# Check to see if the all the properties in the model are valid
|
|
159
|
+
# @return true if the model is valid
|
|
160
|
+
def valid?
|
|
161
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
162
|
+
return false if @attempted_at.nil?
|
|
163
|
+
return false if @duration_ms.nil?
|
|
164
|
+
error_validator = EnumAttributeValidator.new('String', ["address_not_allowed", "timeout", "connection_failed"])
|
|
165
|
+
return false unless error_validator.valid?(@error)
|
|
166
|
+
true
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# Custom attribute writer method with validation
|
|
170
|
+
# @param [Object] attempted_at Value to be assigned
|
|
171
|
+
def attempted_at=(attempted_at)
|
|
172
|
+
if attempted_at.nil?
|
|
173
|
+
fail ArgumentError, 'attempted_at cannot be nil'
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
@attempted_at = attempted_at
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
# Custom attribute writer method with validation
|
|
180
|
+
# @param [Object] duration_ms Value to be assigned
|
|
181
|
+
def duration_ms=(duration_ms)
|
|
182
|
+
if duration_ms.nil?
|
|
183
|
+
fail ArgumentError, 'duration_ms cannot be nil'
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
@duration_ms = duration_ms
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
190
|
+
# @param [Object] error Object to be assigned
|
|
191
|
+
def error=(error)
|
|
192
|
+
validator = EnumAttributeValidator.new('String', ["address_not_allowed", "timeout", "connection_failed"])
|
|
193
|
+
unless validator.valid?(error)
|
|
194
|
+
fail ArgumentError, "invalid value for \"error\", must be one of #{validator.allowable_values}."
|
|
195
|
+
end
|
|
196
|
+
@error = error
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
# Checks equality by comparing each attribute.
|
|
200
|
+
# @param [Object] Object to be compared
|
|
201
|
+
def ==(o)
|
|
202
|
+
return true if self.equal?(o)
|
|
203
|
+
self.class == o.class &&
|
|
204
|
+
attempted_at == o.attempted_at &&
|
|
205
|
+
status_code == o.status_code &&
|
|
206
|
+
duration_ms == o.duration_ms &&
|
|
207
|
+
response_body == o.response_body &&
|
|
208
|
+
error == o.error
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
# @see the `==` method
|
|
212
|
+
# @param [Object] Object to be compared
|
|
213
|
+
def eql?(o)
|
|
214
|
+
self == o
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
# Calculates hash code according to all attributes.
|
|
218
|
+
# @return [Integer] Hash code
|
|
219
|
+
def hash
|
|
220
|
+
[attempted_at, status_code, duration_ms, response_body, error].hash
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
# Builds the object from hash
|
|
224
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
225
|
+
# @return [Object] Returns the model itself
|
|
226
|
+
def self.build_from_hash(attributes)
|
|
227
|
+
return nil unless attributes.is_a?(Hash)
|
|
228
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
229
|
+
transformed_hash = {}
|
|
230
|
+
openapi_types.each_pair do |key, type|
|
|
231
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
232
|
+
transformed_hash["#{key}"] = nil
|
|
233
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
234
|
+
# check to ensure the input is an array given that the attribute
|
|
235
|
+
# is documented as an array but the input is not
|
|
236
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
237
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
238
|
+
end
|
|
239
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
240
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
241
|
+
end
|
|
242
|
+
end
|
|
243
|
+
new(transformed_hash)
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
# Returns the object in the form of hash
|
|
247
|
+
# @return [Hash] Returns the object in the form of hash
|
|
248
|
+
def to_hash
|
|
249
|
+
hash = {}
|
|
250
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
251
|
+
value = self.send(attr)
|
|
252
|
+
if value.nil?
|
|
253
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
254
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
hash[param] = _to_hash(value)
|
|
258
|
+
end
|
|
259
|
+
hash
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
end
|