late-sdk 0.0.531 → 0.0.532

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.
@@ -305,6 +305,83 @@ module Zernio
305
305
  return data, status_code, headers
306
306
  end
307
307
 
308
+ # Cancel a Reach & Frequency reservation (Meta)
309
+ # Releases a RESERVATION's locked price and inventory. Unreserved predictions expire on their own.
310
+ # @param prediction_id [String]
311
+ # @param account_id [String]
312
+ # @param ad_account_id [String]
313
+ # @param [Hash] opts the optional parameters
314
+ # @return [nil]
315
+ def cancel_rf_reservation(prediction_id, account_id, ad_account_id, opts = {})
316
+ cancel_rf_reservation_with_http_info(prediction_id, account_id, ad_account_id, opts)
317
+ nil
318
+ end
319
+
320
+ # Cancel a Reach & Frequency reservation (Meta)
321
+ # Releases a RESERVATION's locked price and inventory. Unreserved predictions expire on their own.
322
+ # @param prediction_id [String]
323
+ # @param account_id [String]
324
+ # @param ad_account_id [String]
325
+ # @param [Hash] opts the optional parameters
326
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
327
+ def cancel_rf_reservation_with_http_info(prediction_id, account_id, ad_account_id, opts = {})
328
+ if @api_client.config.debugging
329
+ @api_client.config.logger.debug 'Calling API: AdsApi.cancel_rf_reservation ...'
330
+ end
331
+ # verify the required parameter 'prediction_id' is set
332
+ if @api_client.config.client_side_validation && prediction_id.nil?
333
+ fail ArgumentError, "Missing the required parameter 'prediction_id' when calling AdsApi.cancel_rf_reservation"
334
+ end
335
+ # verify the required parameter 'account_id' is set
336
+ if @api_client.config.client_side_validation && account_id.nil?
337
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling AdsApi.cancel_rf_reservation"
338
+ end
339
+ # verify the required parameter 'ad_account_id' is set
340
+ if @api_client.config.client_side_validation && ad_account_id.nil?
341
+ fail ArgumentError, "Missing the required parameter 'ad_account_id' when calling AdsApi.cancel_rf_reservation"
342
+ end
343
+ # resource path
344
+ local_var_path = '/v1/ads/rf-predictions/{predictionId}'.sub('{' + 'predictionId' + '}', CGI.escape(prediction_id.to_s))
345
+
346
+ # query parameters
347
+ query_params = opts[:query_params] || {}
348
+ query_params[:'accountId'] = account_id
349
+ query_params[:'adAccountId'] = ad_account_id
350
+
351
+ # header parameters
352
+ header_params = opts[:header_params] || {}
353
+ # HTTP header 'Accept' (if needed)
354
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
355
+
356
+ # form parameters
357
+ form_params = opts[:form_params] || {}
358
+
359
+ # http body (model)
360
+ post_body = opts[:debug_body]
361
+
362
+ # return_type
363
+ return_type = opts[:debug_return_type]
364
+
365
+ # auth_names
366
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
367
+
368
+ new_options = opts.merge(
369
+ :operation => :"AdsApi.cancel_rf_reservation",
370
+ :header_params => header_params,
371
+ :query_params => query_params,
372
+ :form_params => form_params,
373
+ :body => post_body,
374
+ :auth_names => auth_names,
375
+ :return_type => return_type
376
+ )
377
+
378
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
379
+ if @api_client.config.debugging
380
+ @api_client.config.logger.debug "API called: AdsApi#cancel_rf_reservation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
381
+ end
382
+ return data, status_code, headers
383
+ end
384
+
308
385
  # Submit an async insights report run (Meta)
309
386
  # Submits an asynchronous Meta insights report. Same query surface as GET /v1/ads/insights, but in the JSON body; Meta processes the report server-side, which is the right choice for long ranges or large accounts where the sync query is slow or rate-limited. Returns a `reportRunId` to poll via GET /v1/ads/insights/reports/{reportRunId}. Meta only.
310
387
  # @param create_ad_insights_report_request [CreateAdInsightsReportRequest]
@@ -719,6 +796,74 @@ module Zernio
719
796
  return data, status_code, headers
720
797
  end
721
798
 
799
+ # Create a Reach & Frequency prediction (Meta)
800
+ # Creates an R&F prediction — a QUOTE, nothing is bought and no ad entities are created. Provide a date range plus exactly one of `budgetAmount` (Meta predicts reach) or `reach` (Meta predicts the budget). The response carries the estimate and its allowed bounds (min/max budget and reach). Predictions expire on their own; to buy, reserve one via POST /v1/ads/rf-predictions/{predictionId}/reserve and pass the RESERVED id to POST /v1/ads/create with `buyingType: \"RESERVED\"`. Reservation campaigns reject automatic placements, so omitted `placements` default to Facebook feed (+ Instagram stream when a linked IG professional account resolves); Instagram placements require that IG account. Meta only.
801
+ # @param create_rf_prediction_request [CreateRfPredictionRequest]
802
+ # @param [Hash] opts the optional parameters
803
+ # @return [CreateRfPrediction201Response]
804
+ def create_rf_prediction(create_rf_prediction_request, opts = {})
805
+ data, _status_code, _headers = create_rf_prediction_with_http_info(create_rf_prediction_request, opts)
806
+ data
807
+ end
808
+
809
+ # Create a Reach &amp; Frequency prediction (Meta)
810
+ # Creates an R&amp;F prediction — a QUOTE, nothing is bought and no ad entities are created. Provide a date range plus exactly one of &#x60;budgetAmount&#x60; (Meta predicts reach) or &#x60;reach&#x60; (Meta predicts the budget). The response carries the estimate and its allowed bounds (min/max budget and reach). Predictions expire on their own; to buy, reserve one via POST /v1/ads/rf-predictions/{predictionId}/reserve and pass the RESERVED id to POST /v1/ads/create with &#x60;buyingType: \&quot;RESERVED\&quot;&#x60;. Reservation campaigns reject automatic placements, so omitted &#x60;placements&#x60; default to Facebook feed (+ Instagram stream when a linked IG professional account resolves); Instagram placements require that IG account. Meta only.
811
+ # @param create_rf_prediction_request [CreateRfPredictionRequest]
812
+ # @param [Hash] opts the optional parameters
813
+ # @return [Array<(CreateRfPrediction201Response, Integer, Hash)>] CreateRfPrediction201Response data, response status code and response headers
814
+ def create_rf_prediction_with_http_info(create_rf_prediction_request, opts = {})
815
+ if @api_client.config.debugging
816
+ @api_client.config.logger.debug 'Calling API: AdsApi.create_rf_prediction ...'
817
+ end
818
+ # verify the required parameter 'create_rf_prediction_request' is set
819
+ if @api_client.config.client_side_validation && create_rf_prediction_request.nil?
820
+ fail ArgumentError, "Missing the required parameter 'create_rf_prediction_request' when calling AdsApi.create_rf_prediction"
821
+ end
822
+ # resource path
823
+ local_var_path = '/v1/ads/rf-predictions'
824
+
825
+ # query parameters
826
+ query_params = opts[:query_params] || {}
827
+
828
+ # header parameters
829
+ header_params = opts[:header_params] || {}
830
+ # HTTP header 'Accept' (if needed)
831
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
832
+ # HTTP header 'Content-Type'
833
+ content_type = @api_client.select_header_content_type(['application/json'])
834
+ if !content_type.nil?
835
+ header_params['Content-Type'] = content_type
836
+ end
837
+
838
+ # form parameters
839
+ form_params = opts[:form_params] || {}
840
+
841
+ # http body (model)
842
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_rf_prediction_request)
843
+
844
+ # return_type
845
+ return_type = opts[:debug_return_type] || 'CreateRfPrediction201Response'
846
+
847
+ # auth_names
848
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
849
+
850
+ new_options = opts.merge(
851
+ :operation => :"AdsApi.create_rf_prediction",
852
+ :header_params => header_params,
853
+ :query_params => query_params,
854
+ :form_params => form_params,
855
+ :body => post_body,
856
+ :auth_names => auth_names,
857
+ :return_type => return_type
858
+ )
859
+
860
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
861
+ if @api_client.config.debugging
862
+ @api_client.config.logger.debug "API called: AdsApi#create_rf_prediction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
863
+ end
864
+ return data, status_code, headers
865
+ end
866
+
722
867
  # Create standalone ad
723
868
  # Creates a paid ad with custom creative across Meta, Google Ads, Pinterest, TikTok, X/Twitter, and LinkedIn. Supports three mutually-exclusive request shapes selected by the body, a legacy single-creative shape (all platforms, default), a Meta-only multi-creative shape via the creatives array (one ad set with N ads sharing budget and targeting), and a Meta-only attach shape via adSetId (adds one new ad to an existing ad set). Per-platform required fields, budget minimums, and video-ad rules are documented on each property below. LinkedIn creates a Single Image or Single Video Ad backed by a Direct Sponsored Content \"dark post\" authored by a Company Page (see `organizationId`); supported goals are engagement, traffic, awareness, and video_views (video ads use the `video` field; video_views requires a video), and traffic ads require `linkUrl`. **Idempotency:** this endpoint is not idempotent at the platform level (a blind retry creates a second campaign/ad set/ad). Send an `Idempotency-Key` header to make retries safe: the first request with a given key creates the ad and we store the response; a retry with the same key replays that exact response (with `Idempotent-Replayed: true`) instead of creating duplicates. Reusing a key with a different body returns 422; a key whose first request is still in flight returns 409 (retry after a short backoff). Keys are scoped to your credential and expire after 24h.
724
869
  # @param create_standalone_ad_request [CreateStandaloneAdRequest]
@@ -2407,6 +2552,81 @@ module Zernio
2407
2552
  return data, status_code, headers
2408
2553
  end
2409
2554
 
2555
+ # Read a Reach & Frequency prediction (Meta)
2556
+ # @param prediction_id [String]
2557
+ # @param account_id [String]
2558
+ # @param ad_account_id [String]
2559
+ # @param [Hash] opts the optional parameters
2560
+ # @return [CreateRfPrediction201Response]
2561
+ def get_rf_prediction(prediction_id, account_id, ad_account_id, opts = {})
2562
+ data, _status_code, _headers = get_rf_prediction_with_http_info(prediction_id, account_id, ad_account_id, opts)
2563
+ data
2564
+ end
2565
+
2566
+ # Read a Reach &amp; Frequency prediction (Meta)
2567
+ # @param prediction_id [String]
2568
+ # @param account_id [String]
2569
+ # @param ad_account_id [String]
2570
+ # @param [Hash] opts the optional parameters
2571
+ # @return [Array<(CreateRfPrediction201Response, Integer, Hash)>] CreateRfPrediction201Response data, response status code and response headers
2572
+ def get_rf_prediction_with_http_info(prediction_id, account_id, ad_account_id, opts = {})
2573
+ if @api_client.config.debugging
2574
+ @api_client.config.logger.debug 'Calling API: AdsApi.get_rf_prediction ...'
2575
+ end
2576
+ # verify the required parameter 'prediction_id' is set
2577
+ if @api_client.config.client_side_validation && prediction_id.nil?
2578
+ fail ArgumentError, "Missing the required parameter 'prediction_id' when calling AdsApi.get_rf_prediction"
2579
+ end
2580
+ # verify the required parameter 'account_id' is set
2581
+ if @api_client.config.client_side_validation && account_id.nil?
2582
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling AdsApi.get_rf_prediction"
2583
+ end
2584
+ # verify the required parameter 'ad_account_id' is set
2585
+ if @api_client.config.client_side_validation && ad_account_id.nil?
2586
+ fail ArgumentError, "Missing the required parameter 'ad_account_id' when calling AdsApi.get_rf_prediction"
2587
+ end
2588
+ # resource path
2589
+ local_var_path = '/v1/ads/rf-predictions/{predictionId}'.sub('{' + 'predictionId' + '}', CGI.escape(prediction_id.to_s))
2590
+
2591
+ # query parameters
2592
+ query_params = opts[:query_params] || {}
2593
+ query_params[:'accountId'] = account_id
2594
+ query_params[:'adAccountId'] = ad_account_id
2595
+
2596
+ # header parameters
2597
+ header_params = opts[:header_params] || {}
2598
+ # HTTP header 'Accept' (if needed)
2599
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2600
+
2601
+ # form parameters
2602
+ form_params = opts[:form_params] || {}
2603
+
2604
+ # http body (model)
2605
+ post_body = opts[:debug_body]
2606
+
2607
+ # return_type
2608
+ return_type = opts[:debug_return_type] || 'CreateRfPrediction201Response'
2609
+
2610
+ # auth_names
2611
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
2612
+
2613
+ new_options = opts.merge(
2614
+ :operation => :"AdsApi.get_rf_prediction",
2615
+ :header_params => header_params,
2616
+ :query_params => query_params,
2617
+ :form_params => form_params,
2618
+ :body => post_body,
2619
+ :auth_names => auth_names,
2620
+ :return_type => return_type
2621
+ )
2622
+
2623
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2624
+ if @api_client.config.debugging
2625
+ @api_client.config.logger.debug "API called: AdsApi#get_rf_prediction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2626
+ end
2627
+ return data, status_code, headers
2628
+ end
2629
+
2410
2630
  # List ad accounts
2411
2631
  # Returns the platform ad accounts available for the given social account (e.g. Meta ad accounts, TikTok advertiser IDs, Google Ads customer IDs). For TikTok agencies: enumerates every advertiser under every Business Center the token can read (paginated server-side), then chunks the lookup against TikTok's `/advertiser/info/` endpoint (which has a per-call cap of ≤100 IDs). Solo advertisers without a BC fall back to the OAuth-time `advertiser_ids` list. Cached for 1h on the SocialAccount; lazy-refreshed on first call after expiry.
2412
2632
  # @param account_id [String] Social account ID
@@ -3564,6 +3784,80 @@ module Zernio
3564
3784
  return data, status_code, headers
3565
3785
  end
3566
3786
 
3787
+ # Reserve a Reach & Frequency prediction (Meta)
3788
+ # Locks the quoted price + inventory until the returned `expiresAt` and mints a NEW prediction id — pass that RESERVED id (not the original) as `rfPredictionId` on POST /v1/ads/create. Release an unused reservation via DELETE. Meta only.
3789
+ # @param prediction_id [String]
3790
+ # @param reserve_rf_prediction_request [ReserveRfPredictionRequest]
3791
+ # @param [Hash] opts the optional parameters
3792
+ # @return [ReserveRfPrediction201Response]
3793
+ def reserve_rf_prediction(prediction_id, reserve_rf_prediction_request, opts = {})
3794
+ data, _status_code, _headers = reserve_rf_prediction_with_http_info(prediction_id, reserve_rf_prediction_request, opts)
3795
+ data
3796
+ end
3797
+
3798
+ # Reserve a Reach &amp; Frequency prediction (Meta)
3799
+ # Locks the quoted price + inventory until the returned &#x60;expiresAt&#x60; and mints a NEW prediction id — pass that RESERVED id (not the original) as &#x60;rfPredictionId&#x60; on POST /v1/ads/create. Release an unused reservation via DELETE. Meta only.
3800
+ # @param prediction_id [String]
3801
+ # @param reserve_rf_prediction_request [ReserveRfPredictionRequest]
3802
+ # @param [Hash] opts the optional parameters
3803
+ # @return [Array<(ReserveRfPrediction201Response, Integer, Hash)>] ReserveRfPrediction201Response data, response status code and response headers
3804
+ def reserve_rf_prediction_with_http_info(prediction_id, reserve_rf_prediction_request, opts = {})
3805
+ if @api_client.config.debugging
3806
+ @api_client.config.logger.debug 'Calling API: AdsApi.reserve_rf_prediction ...'
3807
+ end
3808
+ # verify the required parameter 'prediction_id' is set
3809
+ if @api_client.config.client_side_validation && prediction_id.nil?
3810
+ fail ArgumentError, "Missing the required parameter 'prediction_id' when calling AdsApi.reserve_rf_prediction"
3811
+ end
3812
+ # verify the required parameter 'reserve_rf_prediction_request' is set
3813
+ if @api_client.config.client_side_validation && reserve_rf_prediction_request.nil?
3814
+ fail ArgumentError, "Missing the required parameter 'reserve_rf_prediction_request' when calling AdsApi.reserve_rf_prediction"
3815
+ end
3816
+ # resource path
3817
+ local_var_path = '/v1/ads/rf-predictions/{predictionId}/reserve'.sub('{' + 'predictionId' + '}', CGI.escape(prediction_id.to_s))
3818
+
3819
+ # query parameters
3820
+ query_params = opts[:query_params] || {}
3821
+
3822
+ # header parameters
3823
+ header_params = opts[:header_params] || {}
3824
+ # HTTP header 'Accept' (if needed)
3825
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
3826
+ # HTTP header 'Content-Type'
3827
+ content_type = @api_client.select_header_content_type(['application/json'])
3828
+ if !content_type.nil?
3829
+ header_params['Content-Type'] = content_type
3830
+ end
3831
+
3832
+ # form parameters
3833
+ form_params = opts[:form_params] || {}
3834
+
3835
+ # http body (model)
3836
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(reserve_rf_prediction_request)
3837
+
3838
+ # return_type
3839
+ return_type = opts[:debug_return_type] || 'ReserveRfPrediction201Response'
3840
+
3841
+ # auth_names
3842
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
3843
+
3844
+ new_options = opts.merge(
3845
+ :operation => :"AdsApi.reserve_rf_prediction",
3846
+ :header_params => header_params,
3847
+ :query_params => query_params,
3848
+ :form_params => form_params,
3849
+ :body => post_body,
3850
+ :auth_names => auth_names,
3851
+ :return_type => return_type
3852
+ )
3853
+
3854
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
3855
+ if @api_client.config.debugging
3856
+ @api_client.config.logger.debug "API called: AdsApi#reserve_rf_prediction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3857
+ end
3858
+ return data, status_code, headers
3859
+ end
3860
+
3567
3861
  # Search targeting interests
3568
3862
  # Deprecated alias for `GET /v1/ads/targeting/search?dimension=interest`. Kept for backward compatibility, it returns the legacy `{ interests: [...] }` shape rather than the normalized `{ results: [...] }`. New integrations should use `GET /v1/ads/targeting/search` with `dimension=interest`.
3569
3863
  # @param q [String] Search query
@@ -0,0 +1,165 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
5
+
6
+ The version of the OpenAPI document: 1.0.4
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Zernio
17
+ class CreateRfPrediction201Response < ApiModelBase
18
+ attr_accessor :ad_account_id
19
+
20
+ attr_accessor :currency
21
+
22
+ attr_accessor :prediction
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'ad_account_id' => :'adAccountId',
28
+ :'currency' => :'currency',
29
+ :'prediction' => :'prediction'
30
+ }
31
+ end
32
+
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ acceptable_attribute_map.values
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'ad_account_id' => :'String',
47
+ :'currency' => :'String',
48
+ :'prediction' => :'RfPrediction'
49
+ }
50
+ end
51
+
52
+ # List of attributes with nullable: true
53
+ def self.openapi_nullable
54
+ Set.new([
55
+ ])
56
+ end
57
+
58
+ # Initializes the object
59
+ # @param [Hash] attributes Model attributes in the form of hash
60
+ def initialize(attributes = {})
61
+ if (!attributes.is_a?(Hash))
62
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::CreateRfPrediction201Response` initialize method"
63
+ end
64
+
65
+ # check to see if the attribute exists and convert string to symbol for hash key
66
+ acceptable_attribute_map = self.class.acceptable_attribute_map
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!acceptable_attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::CreateRfPrediction201Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'ad_account_id')
75
+ self.ad_account_id = attributes[:'ad_account_id']
76
+ end
77
+
78
+ if attributes.key?(:'currency')
79
+ self.currency = attributes[:'currency']
80
+ end
81
+
82
+ if attributes.key?(:'prediction')
83
+ self.prediction = attributes[:'prediction']
84
+ end
85
+ end
86
+
87
+ # Show invalid properties with the reasons. Usually used together with valid?
88
+ # @return Array for valid properties with the reasons
89
+ def list_invalid_properties
90
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
91
+ invalid_properties = Array.new
92
+ invalid_properties
93
+ end
94
+
95
+ # Check to see if the all the properties in the model are valid
96
+ # @return true if the model is valid
97
+ def valid?
98
+ warn '[DEPRECATED] the `valid?` method is obsolete'
99
+ true
100
+ end
101
+
102
+ # Checks equality by comparing each attribute.
103
+ # @param [Object] Object to be compared
104
+ def ==(o)
105
+ return true if self.equal?(o)
106
+ self.class == o.class &&
107
+ ad_account_id == o.ad_account_id &&
108
+ currency == o.currency &&
109
+ prediction == o.prediction
110
+ end
111
+
112
+ # @see the `==` method
113
+ # @param [Object] Object to be compared
114
+ def eql?(o)
115
+ self == o
116
+ end
117
+
118
+ # Calculates hash code according to all attributes.
119
+ # @return [Integer] Hash code
120
+ def hash
121
+ [ad_account_id, currency, prediction].hash
122
+ end
123
+
124
+ # Builds the object from hash
125
+ # @param [Hash] attributes Model attributes in the form of hash
126
+ # @return [Object] Returns the model itself
127
+ def self.build_from_hash(attributes)
128
+ return nil unless attributes.is_a?(Hash)
129
+ attributes = attributes.transform_keys(&:to_sym)
130
+ transformed_hash = {}
131
+ openapi_types.each_pair do |key, type|
132
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
133
+ transformed_hash["#{key}"] = nil
134
+ elsif type =~ /\AArray<(.*)>/i
135
+ # check to ensure the input is an array given that the attribute
136
+ # is documented as an array but the input is not
137
+ if attributes[attribute_map[key]].is_a?(Array)
138
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
139
+ end
140
+ elsif !attributes[attribute_map[key]].nil?
141
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
142
+ end
143
+ end
144
+ new(transformed_hash)
145
+ end
146
+
147
+ # Returns the object in the form of hash
148
+ # @return [Hash] Returns the object in the form of hash
149
+ def to_hash
150
+ hash = {}
151
+ self.class.attribute_map.each_pair do |attr, param|
152
+ value = self.send(attr)
153
+ if value.nil?
154
+ is_nullable = self.class.openapi_nullable.include?(attr)
155
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
156
+ end
157
+
158
+ hash[param] = _to_hash(value)
159
+ end
160
+ hash
161
+ end
162
+
163
+ end
164
+
165
+ end