late-sdk 0.0.904 → 0.0.905

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c0e7e92a18a0b4ffef10dc9526ff7f50aef4136b4706e646cf50bd57757ec768
4
- data.tar.gz: 9a416747623893629b1f70bd2e6bdc0929de2319b915cee948a4b4bf19e729ab
3
+ metadata.gz: cc564a09e08a5c4caf2ad2af1da06d6fa117f751b638afd5985bc7e8177acdeb
4
+ data.tar.gz: 814d1d115a66d0c6b8ea7b3e74f5e3420eee3821742c4794ee21bd92bd7bab91
5
5
  SHA512:
6
- metadata.gz: 0d39b519f7cd61826546aaf7a9fa41fd4a7540d094da5c179af6448758e89c88bf1530255d1ff47496314957055e8ec80545c6ee60865418a433501e06030b24
7
- data.tar.gz: 4133f345fc4e8efb6ea5fa6994d29470dd356371787993cb24d7cd19272df54c4fb0320694e585389d24037f83469f057cc94c27aac8a8c1ed4986f3f6513c58
6
+ metadata.gz: 9023ceaf046c1b7d7f457233db11fdb9afb60b464e3b59b818e7afffcdfe0d5f278babf228cc9baedafef6e425b5e977be3a32c4aeffcef778e2e2f4c9885509
7
+ data.tar.gz: 5c828499382dc76650229c8e4bac8d29990cddfb5da83d89020f435f0592249867c99ad17d6ebb92ffbd88905ce4e97e1267502d18319cc2537b48a9c8d60fe5
data/README.md CHANGED
@@ -109,6 +109,7 @@ Class | Method | HTTP request | Description
109
109
  *Zernio::AdAccountsApi* | [**add_account_callouts**](docs/AdAccountsApi.md#add_account_callouts) | **POST** /v1/ads/accounts/callouts | Add account callouts
110
110
  *Zernio::AdAccountsApi* | [**add_account_sitelinks**](docs/AdAccountsApi.md#add_account_sitelinks) | **POST** /v1/ads/accounts/sitelinks | Add account sitelinks
111
111
  *Zernio::AdAccountsApi* | [**add_account_structured_snippets**](docs/AdAccountsApi.md#add_account_structured_snippets) | **POST** /v1/ads/accounts/structured-snippets | Add account snippets
112
+ *Zernio::AdAccountsApi* | [**create_ad_account**](docs/AdAccountsApi.md#create_ad_account) | **POST** /v1/ads/accounts | Create Meta ad account
112
113
  *Zernio::AdAccountsApi* | [**create_ad_negative_keyword_list**](docs/AdAccountsApi.md#create_ad_negative_keyword_list) | **POST** /v1/ads/accounts/negative-keyword-lists | Create a negative keyword list
113
114
  *Zernio::AdAccountsApi* | [**create_custom_conversion**](docs/AdAccountsApi.md#create_custom_conversion) | **POST** /v1/accounts/{accountId}/custom-conversions | Create or reuse a custom conversion
114
115
  *Zernio::AdAccountsApi* | [**create_high_demand_period**](docs/AdAccountsApi.md#create_high_demand_period) | **POST** /v1/ads/high-demand-periods | Schedule a budget increase
@@ -1029,6 +1030,8 @@ Class | Method | HTTP request | Description
1029
1030
  - [Zernio::CreateAccountGroup201Response](docs/CreateAccountGroup201Response.md)
1030
1031
  - [Zernio::CreateAccountGroup201ResponseGroup](docs/CreateAccountGroup201ResponseGroup.md)
1031
1032
  - [Zernio::CreateAccountGroupRequest](docs/CreateAccountGroupRequest.md)
1033
+ - [Zernio::CreateAdAccount201Response](docs/CreateAdAccount201Response.md)
1034
+ - [Zernio::CreateAdAccountRequest](docs/CreateAdAccountRequest.md)
1032
1035
  - [Zernio::CreateAdAudience201Response](docs/CreateAdAudience201Response.md)
1033
1036
  - [Zernio::CreateAdAudienceRequest](docs/CreateAdAudienceRequest.md)
1034
1037
  - [Zernio::CreateAdCampaign200Response](docs/CreateAdCampaign200Response.md)
@@ -7,6 +7,7 @@ All URIs are relative to *https://zernio.com/api*
7
7
  | [**add_account_callouts**](AdAccountsApi.md#add_account_callouts) | **POST** /v1/ads/accounts/callouts | Add account callouts |
8
8
  | [**add_account_sitelinks**](AdAccountsApi.md#add_account_sitelinks) | **POST** /v1/ads/accounts/sitelinks | Add account sitelinks |
9
9
  | [**add_account_structured_snippets**](AdAccountsApi.md#add_account_structured_snippets) | **POST** /v1/ads/accounts/structured-snippets | Add account snippets |
10
+ | [**create_ad_account**](AdAccountsApi.md#create_ad_account) | **POST** /v1/ads/accounts | Create Meta ad account |
10
11
  | [**create_ad_negative_keyword_list**](AdAccountsApi.md#create_ad_negative_keyword_list) | **POST** /v1/ads/accounts/negative-keyword-lists | Create a negative keyword list |
11
12
  | [**create_custom_conversion**](AdAccountsApi.md#create_custom_conversion) | **POST** /v1/accounts/{accountId}/custom-conversions | Create or reuse a custom conversion |
12
13
  | [**create_high_demand_period**](AdAccountsApi.md#create_high_demand_period) | **POST** /v1/ads/high-demand-periods | Schedule a budget increase |
@@ -257,6 +258,75 @@ end
257
258
  - **Accept**: application/json
258
259
 
259
260
 
261
+ ## create_ad_account
262
+
263
+ > <CreateAdAccount201Response> create_ad_account(create_ad_account_request)
264
+
265
+ Create Meta ad account
266
+
267
+ Creates a durable Meta ad account in the end user's own business portfolio using their connected Meta Ads token. Requires an active metaads accountId, Ads access, business_management permission and business admin access. Discover portfolios with GET /v1/ads/businesses. System-user tokens may return an empty businesses list; supply the known business ID in that case. The self-serve account starts without a payment method. The user must add a payment method in Ads Manager before ads can deliver. Zernio cannot add payment methods. Meta may require business verification and limits how many accounts a business can create. Closing an account does not guarantee more capacity. An ad account cannot truly be deleted, even after closing it and removing it from a business. timezoneId is Meta's numeric ID, not an IANA timezone name. Select it from https://developers.facebook.com/docs/marketing-api/reference/ad-account/timezone-ids/. For example, 1 is America/Los_Angeles. Meta validates supported currencies and IDs. endAdvertiser, mediaAgency and partner default to NONE for the self-serve flow. The new account is added atomically to an existing scoped ad-account allowlist. Unrestricted connections stay unrestricted. Reconnecting the same Meta identity preserves this scope unless a caller explicitly replaces it. Discovery is nudged immediately. Use the returned adAccountId with the existing ads endpoints. This operation is not idempotent and Zernio never automatically retries it. Unknown body fields are rejected. No validateOnly or dry-run option is supported. After a timeout or a 502 with details.creationStatus=unknown, check the business in Ads Manager before attempting another creation. A 201 with connectionUpdated=false means the account exists but needs reconnecting with adAccountIds containing the returned ID and the previous scoped IDs via GET /v1/connect/facebook/ads. Do not repeat the create call.
268
+
269
+ ### Examples
270
+
271
+ ```ruby
272
+ require 'time'
273
+ require 'zernio-sdk'
274
+ # setup authorization
275
+ Zernio.configure do |config|
276
+ # Configure Bearer authorization (JWT): bearerAuth
277
+ config.access_token = 'YOUR_BEARER_TOKEN'
278
+ end
279
+
280
+ api_instance = Zernio::AdAccountsApi.new
281
+ create_ad_account_request = Zernio::CreateAdAccountRequest.new({account_id: 'account_id_example', business_id: 'business_id_example', name: 'name_example', currency: 'currency_example', timezone_id: 37}) # CreateAdAccountRequest |
282
+
283
+ begin
284
+ # Create Meta ad account
285
+ result = api_instance.create_ad_account(create_ad_account_request)
286
+ p result
287
+ rescue Zernio::ApiError => e
288
+ puts "Error when calling AdAccountsApi->create_ad_account: #{e}"
289
+ end
290
+ ```
291
+
292
+ #### Using the create_ad_account_with_http_info variant
293
+
294
+ This returns an Array which contains the response data, status code and headers.
295
+
296
+ > <Array(<CreateAdAccount201Response>, Integer, Hash)> create_ad_account_with_http_info(create_ad_account_request)
297
+
298
+ ```ruby
299
+ begin
300
+ # Create Meta ad account
301
+ data, status_code, headers = api_instance.create_ad_account_with_http_info(create_ad_account_request)
302
+ p status_code # => 2xx
303
+ p headers # => { ... }
304
+ p data # => <CreateAdAccount201Response>
305
+ rescue Zernio::ApiError => e
306
+ puts "Error when calling AdAccountsApi->create_ad_account_with_http_info: #{e}"
307
+ end
308
+ ```
309
+
310
+ ### Parameters
311
+
312
+ | Name | Type | Description | Notes |
313
+ | ---- | ---- | ----------- | ----- |
314
+ | **create_ad_account_request** | [**CreateAdAccountRequest**](CreateAdAccountRequest.md) | | |
315
+
316
+ ### Return type
317
+
318
+ [**CreateAdAccount201Response**](CreateAdAccount201Response.md)
319
+
320
+ ### Authorization
321
+
322
+ [bearerAuth](../README.md#bearerAuth)
323
+
324
+ ### HTTP request headers
325
+
326
+ - **Content-Type**: application/json
327
+ - **Accept**: application/json
328
+
329
+
260
330
  ## create_ad_negative_keyword_list
261
331
 
262
332
  > <CreateAdNegativeKeywordList201Response> create_ad_negative_keyword_list(create_ad_negative_keyword_list_request)
@@ -0,0 +1,30 @@
1
+ # Zernio::CreateAdAccount201Response
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **ad_account_id** | **String** | New Meta ad account ID for subsequent ads calls. | |
8
+ | **business_id** | **String** | Owning business portfolio ID. | |
9
+ | **connection_updated** | **Boolean** | Whether the connection scope and discovery schedule were updated. | |
10
+ | **payment_method_required** | **Boolean** | Always true as a delivery prerequisite. This is not a live funding-source check. Confirm payment or invoicing in Ads Manager. | |
11
+ | **ads_manager_url** | **String** | Open the created account in Ads Manager. | |
12
+ | **next_steps** | **String** | Payment setup instructions for the user. | |
13
+ | **warnings** | **Array&lt;String&gt;** | Recovery instructions if the account could not be attached to the connection. | |
14
+
15
+ ## Example
16
+
17
+ ```ruby
18
+ require 'zernio-sdk'
19
+
20
+ instance = Zernio::CreateAdAccount201Response.new(
21
+ ad_account_id: null,
22
+ business_id: null,
23
+ connection_updated: null,
24
+ payment_method_required: null,
25
+ ads_manager_url: null,
26
+ next_steps: null,
27
+ warnings: null
28
+ )
29
+ ```
30
+
@@ -0,0 +1,46 @@
1
+ # Zernio::CreateAdAccountRequest
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **account_id** | **String** | Zernio metaads SocialAccount ID. | |
8
+ | **business_id** | **String** | Business portfolio that will own the account. | |
9
+ | **name** | **String** | Ad account name. Whitespace is trimmed. | |
10
+ | **currency** | **String** | Uppercase ISO 4217 currency supported by Meta. | |
11
+ | **timezone_id** | **Integer** | Numeric Meta timezone ID from the linked timezone list. For example 1 is America/Los_Angeles. | |
12
+ | **end_advertiser** | **String** | End advertiser business or page ID. NONE uses the owning business. | [optional][default to &#39;NONE&#39;] |
13
+ | **media_agency** | **String** | Media agency business or page ID. NONE for self-serve customers. | [optional][default to &#39;NONE&#39;] |
14
+ | **partner** | **String** | Partner business or page ID. NONE for self-serve customers. | [optional][default to &#39;NONE&#39;] |
15
+ | **invoice** | **Boolean** | Request Meta invoicing. Eligibility is determined by Meta. | [optional] |
16
+ | **invoice_group_id** | **String** | Existing Meta invoice group ID. | [optional] |
17
+ | **invoicing_emails** | **Array&lt;String&gt;** | Addresses for Meta invoices. | [optional] |
18
+ | **io** | **Boolean** | Meta insertion-order invoicing option. | [optional] |
19
+ | **po_number** | **String** | Purchase order number. | [optional] |
20
+ | **funding_id** | **String** | Existing Meta funding reference. Does not add a payment method. | [optional] |
21
+ | **ad_account_created_from_bm_flag** | **Boolean** | Meta Business Manager creation flag. | [optional] |
22
+
23
+ ## Example
24
+
25
+ ```ruby
26
+ require 'zernio-sdk'
27
+
28
+ instance = Zernio::CreateAdAccountRequest.new(
29
+ account_id: null,
30
+ business_id: null,
31
+ name: null,
32
+ currency: null,
33
+ timezone_id: null,
34
+ end_advertiser: null,
35
+ media_agency: null,
36
+ partner: null,
37
+ invoice: null,
38
+ invoice_group_id: null,
39
+ invoicing_emails: null,
40
+ io: null,
41
+ po_number: null,
42
+ funding_id: null,
43
+ ad_account_created_from_bm_flag: null
44
+ )
45
+ ```
46
+
@@ -223,6 +223,74 @@ module Zernio
223
223
  return data, status_code, headers
224
224
  end
225
225
 
226
+ # Create Meta ad account
227
+ # Creates a durable Meta ad account in the end user's own business portfolio using their connected Meta Ads token. Requires an active metaads accountId, Ads access, business_management permission and business admin access. Discover portfolios with GET /v1/ads/businesses. System-user tokens may return an empty businesses list; supply the known business ID in that case. The self-serve account starts without a payment method. The user must add a payment method in Ads Manager before ads can deliver. Zernio cannot add payment methods. Meta may require business verification and limits how many accounts a business can create. Closing an account does not guarantee more capacity. An ad account cannot truly be deleted, even after closing it and removing it from a business. timezoneId is Meta's numeric ID, not an IANA timezone name. Select it from https://developers.facebook.com/docs/marketing-api/reference/ad-account/timezone-ids/. For example, 1 is America/Los_Angeles. Meta validates supported currencies and IDs. endAdvertiser, mediaAgency and partner default to NONE for the self-serve flow. The new account is added atomically to an existing scoped ad-account allowlist. Unrestricted connections stay unrestricted. Reconnecting the same Meta identity preserves this scope unless a caller explicitly replaces it. Discovery is nudged immediately. Use the returned adAccountId with the existing ads endpoints. This operation is not idempotent and Zernio never automatically retries it. Unknown body fields are rejected. No validateOnly or dry-run option is supported. After a timeout or a 502 with details.creationStatus=unknown, check the business in Ads Manager before attempting another creation. A 201 with connectionUpdated=false means the account exists but needs reconnecting with adAccountIds containing the returned ID and the previous scoped IDs via GET /v1/connect/facebook/ads. Do not repeat the create call.
228
+ # @param create_ad_account_request [CreateAdAccountRequest]
229
+ # @param [Hash] opts the optional parameters
230
+ # @return [CreateAdAccount201Response]
231
+ def create_ad_account(create_ad_account_request, opts = {})
232
+ data, _status_code, _headers = create_ad_account_with_http_info(create_ad_account_request, opts)
233
+ data
234
+ end
235
+
236
+ # Create Meta ad account
237
+ # Creates a durable Meta ad account in the end user&#39;s own business portfolio using their connected Meta Ads token. Requires an active metaads accountId, Ads access, business_management permission and business admin access. Discover portfolios with GET /v1/ads/businesses. System-user tokens may return an empty businesses list; supply the known business ID in that case. The self-serve account starts without a payment method. The user must add a payment method in Ads Manager before ads can deliver. Zernio cannot add payment methods. Meta may require business verification and limits how many accounts a business can create. Closing an account does not guarantee more capacity. An ad account cannot truly be deleted, even after closing it and removing it from a business. timezoneId is Meta&#39;s numeric ID, not an IANA timezone name. Select it from https://developers.facebook.com/docs/marketing-api/reference/ad-account/timezone-ids/. For example, 1 is America/Los_Angeles. Meta validates supported currencies and IDs. endAdvertiser, mediaAgency and partner default to NONE for the self-serve flow. The new account is added atomically to an existing scoped ad-account allowlist. Unrestricted connections stay unrestricted. Reconnecting the same Meta identity preserves this scope unless a caller explicitly replaces it. Discovery is nudged immediately. Use the returned adAccountId with the existing ads endpoints. This operation is not idempotent and Zernio never automatically retries it. Unknown body fields are rejected. No validateOnly or dry-run option is supported. After a timeout or a 502 with details.creationStatus&#x3D;unknown, check the business in Ads Manager before attempting another creation. A 201 with connectionUpdated&#x3D;false means the account exists but needs reconnecting with adAccountIds containing the returned ID and the previous scoped IDs via GET /v1/connect/facebook/ads. Do not repeat the create call.
238
+ # @param create_ad_account_request [CreateAdAccountRequest]
239
+ # @param [Hash] opts the optional parameters
240
+ # @return [Array<(CreateAdAccount201Response, Integer, Hash)>] CreateAdAccount201Response data, response status code and response headers
241
+ def create_ad_account_with_http_info(create_ad_account_request, opts = {})
242
+ if @api_client.config.debugging
243
+ @api_client.config.logger.debug 'Calling API: AdAccountsApi.create_ad_account ...'
244
+ end
245
+ # verify the required parameter 'create_ad_account_request' is set
246
+ if @api_client.config.client_side_validation && create_ad_account_request.nil?
247
+ fail ArgumentError, "Missing the required parameter 'create_ad_account_request' when calling AdAccountsApi.create_ad_account"
248
+ end
249
+ # resource path
250
+ local_var_path = '/v1/ads/accounts'
251
+
252
+ # query parameters
253
+ query_params = opts[:query_params] || {}
254
+
255
+ # header parameters
256
+ header_params = opts[:header_params] || {}
257
+ # HTTP header 'Accept' (if needed)
258
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
259
+ # HTTP header 'Content-Type'
260
+ content_type = @api_client.select_header_content_type(['application/json'])
261
+ if !content_type.nil?
262
+ header_params['Content-Type'] = content_type
263
+ end
264
+
265
+ # form parameters
266
+ form_params = opts[:form_params] || {}
267
+
268
+ # http body (model)
269
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_ad_account_request)
270
+
271
+ # return_type
272
+ return_type = opts[:debug_return_type] || 'CreateAdAccount201Response'
273
+
274
+ # auth_names
275
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
276
+
277
+ new_options = opts.merge(
278
+ :operation => :"AdAccountsApi.create_ad_account",
279
+ :header_params => header_params,
280
+ :query_params => query_params,
281
+ :form_params => form_params,
282
+ :body => post_body,
283
+ :auth_names => auth_names,
284
+ :return_type => return_type
285
+ )
286
+
287
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
288
+ if @api_client.config.debugging
289
+ @api_client.config.logger.debug "API called: AdAccountsApi#create_ad_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
290
+ end
291
+ return data, status_code, headers
292
+ end
293
+
226
294
  # Create a negative keyword list
227
295
  # Creates one Google Ads shared negative keyword list with optional initial keywords in a single atomic mutation. Daily quota is reserved for every mutate item, so large batches may return 429 before any change. This operation is not idempotent. The list is not attached to any campaign.
228
296
  # @param create_ad_negative_keyword_list_request [CreateAdNegativeKeywordListRequest]
@@ -0,0 +1,340 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
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 CreateAdAccount201Response < ApiModelBase
18
+ # New Meta ad account ID for subsequent ads calls.
19
+ attr_accessor :ad_account_id
20
+
21
+ # Owning business portfolio ID.
22
+ attr_accessor :business_id
23
+
24
+ # Whether the connection scope and discovery schedule were updated.
25
+ attr_accessor :connection_updated
26
+
27
+ # Always true as a delivery prerequisite. This is not a live funding-source check. Confirm payment or invoicing in Ads Manager.
28
+ attr_accessor :payment_method_required
29
+
30
+ # Open the created account in Ads Manager.
31
+ attr_accessor :ads_manager_url
32
+
33
+ # Payment setup instructions for the user.
34
+ attr_accessor :next_steps
35
+
36
+ # Recovery instructions if the account could not be attached to the connection.
37
+ attr_accessor :warnings
38
+
39
+ # Attribute mapping from ruby-style variable name to JSON key.
40
+ def self.attribute_map
41
+ {
42
+ :'ad_account_id' => :'adAccountId',
43
+ :'business_id' => :'businessId',
44
+ :'connection_updated' => :'connectionUpdated',
45
+ :'payment_method_required' => :'paymentMethodRequired',
46
+ :'ads_manager_url' => :'adsManagerUrl',
47
+ :'next_steps' => :'nextSteps',
48
+ :'warnings' => :'warnings'
49
+ }
50
+ end
51
+
52
+ # Returns attribute mapping this model knows about
53
+ def self.acceptable_attribute_map
54
+ attribute_map
55
+ end
56
+
57
+ # Returns all the JSON keys this model knows about
58
+ def self.acceptable_attributes
59
+ acceptable_attribute_map.values
60
+ end
61
+
62
+ # Attribute type mapping.
63
+ def self.openapi_types
64
+ {
65
+ :'ad_account_id' => :'String',
66
+ :'business_id' => :'String',
67
+ :'connection_updated' => :'Boolean',
68
+ :'payment_method_required' => :'Boolean',
69
+ :'ads_manager_url' => :'String',
70
+ :'next_steps' => :'String',
71
+ :'warnings' => :'Array<String>'
72
+ }
73
+ end
74
+
75
+ # List of attributes with nullable: true
76
+ def self.openapi_nullable
77
+ Set.new([
78
+ ])
79
+ end
80
+
81
+ # Initializes the object
82
+ # @param [Hash] attributes Model attributes in the form of hash
83
+ def initialize(attributes = {})
84
+ if (!attributes.is_a?(Hash))
85
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::CreateAdAccount201Response` initialize method"
86
+ end
87
+
88
+ # check to see if the attribute exists and convert string to symbol for hash key
89
+ acceptable_attribute_map = self.class.acceptable_attribute_map
90
+ attributes = attributes.each_with_object({}) { |(k, v), h|
91
+ if (!acceptable_attribute_map.key?(k.to_sym))
92
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::CreateAdAccount201Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
93
+ end
94
+ h[k.to_sym] = v
95
+ }
96
+
97
+ if attributes.key?(:'ad_account_id')
98
+ self.ad_account_id = attributes[:'ad_account_id']
99
+ else
100
+ self.ad_account_id = nil
101
+ end
102
+
103
+ if attributes.key?(:'business_id')
104
+ self.business_id = attributes[:'business_id']
105
+ else
106
+ self.business_id = nil
107
+ end
108
+
109
+ if attributes.key?(:'connection_updated')
110
+ self.connection_updated = attributes[:'connection_updated']
111
+ else
112
+ self.connection_updated = nil
113
+ end
114
+
115
+ if attributes.key?(:'payment_method_required')
116
+ self.payment_method_required = attributes[:'payment_method_required']
117
+ else
118
+ self.payment_method_required = nil
119
+ end
120
+
121
+ if attributes.key?(:'ads_manager_url')
122
+ self.ads_manager_url = attributes[:'ads_manager_url']
123
+ else
124
+ self.ads_manager_url = nil
125
+ end
126
+
127
+ if attributes.key?(:'next_steps')
128
+ self.next_steps = attributes[:'next_steps']
129
+ else
130
+ self.next_steps = nil
131
+ end
132
+
133
+ if attributes.key?(:'warnings')
134
+ if (value = attributes[:'warnings']).is_a?(Array)
135
+ self.warnings = value
136
+ end
137
+ else
138
+ self.warnings = 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 @ad_account_id.nil?
148
+ invalid_properties.push('invalid value for "ad_account_id", ad_account_id cannot be nil.')
149
+ end
150
+
151
+ pattern = Regexp.new(/^act_[0-9]+$/)
152
+ if @ad_account_id !~ pattern
153
+ invalid_properties.push("invalid value for \"ad_account_id\", must conform to the pattern #{pattern}.")
154
+ end
155
+
156
+ if @business_id.nil?
157
+ invalid_properties.push('invalid value for "business_id", business_id cannot be nil.')
158
+ end
159
+
160
+ if @connection_updated.nil?
161
+ invalid_properties.push('invalid value for "connection_updated", connection_updated cannot be nil.')
162
+ end
163
+
164
+ if @payment_method_required.nil?
165
+ invalid_properties.push('invalid value for "payment_method_required", payment_method_required cannot be nil.')
166
+ end
167
+
168
+ if @ads_manager_url.nil?
169
+ invalid_properties.push('invalid value for "ads_manager_url", ads_manager_url cannot be nil.')
170
+ end
171
+
172
+ if @next_steps.nil?
173
+ invalid_properties.push('invalid value for "next_steps", next_steps cannot be nil.')
174
+ end
175
+
176
+ if @warnings.nil?
177
+ invalid_properties.push('invalid value for "warnings", warnings cannot be nil.')
178
+ end
179
+
180
+ invalid_properties
181
+ end
182
+
183
+ # Check to see if the all the properties in the model are valid
184
+ # @return true if the model is valid
185
+ def valid?
186
+ warn '[DEPRECATED] the `valid?` method is obsolete'
187
+ return false if @ad_account_id.nil?
188
+ return false if @ad_account_id !~ Regexp.new(/^act_[0-9]+$/)
189
+ return false if @business_id.nil?
190
+ return false if @connection_updated.nil?
191
+ return false if @payment_method_required.nil?
192
+ return false if @ads_manager_url.nil?
193
+ return false if @next_steps.nil?
194
+ return false if @warnings.nil?
195
+ true
196
+ end
197
+
198
+ # Custom attribute writer method with validation
199
+ # @param [Object] ad_account_id Value to be assigned
200
+ def ad_account_id=(ad_account_id)
201
+ if ad_account_id.nil?
202
+ fail ArgumentError, 'ad_account_id cannot be nil'
203
+ end
204
+
205
+ pattern = Regexp.new(/^act_[0-9]+$/)
206
+ if ad_account_id !~ pattern
207
+ fail ArgumentError, "invalid value for \"ad_account_id\", must conform to the pattern #{pattern}."
208
+ end
209
+
210
+ @ad_account_id = ad_account_id
211
+ end
212
+
213
+ # Custom attribute writer method with validation
214
+ # @param [Object] business_id Value to be assigned
215
+ def business_id=(business_id)
216
+ if business_id.nil?
217
+ fail ArgumentError, 'business_id cannot be nil'
218
+ end
219
+
220
+ @business_id = business_id
221
+ end
222
+
223
+ # Custom attribute writer method with validation
224
+ # @param [Object] connection_updated Value to be assigned
225
+ def connection_updated=(connection_updated)
226
+ if connection_updated.nil?
227
+ fail ArgumentError, 'connection_updated cannot be nil'
228
+ end
229
+
230
+ @connection_updated = connection_updated
231
+ end
232
+
233
+ # Custom attribute writer method with validation
234
+ # @param [Object] payment_method_required Value to be assigned
235
+ def payment_method_required=(payment_method_required)
236
+ if payment_method_required.nil?
237
+ fail ArgumentError, 'payment_method_required cannot be nil'
238
+ end
239
+
240
+ @payment_method_required = payment_method_required
241
+ end
242
+
243
+ # Custom attribute writer method with validation
244
+ # @param [Object] ads_manager_url Value to be assigned
245
+ def ads_manager_url=(ads_manager_url)
246
+ if ads_manager_url.nil?
247
+ fail ArgumentError, 'ads_manager_url cannot be nil'
248
+ end
249
+
250
+ @ads_manager_url = ads_manager_url
251
+ end
252
+
253
+ # Custom attribute writer method with validation
254
+ # @param [Object] next_steps Value to be assigned
255
+ def next_steps=(next_steps)
256
+ if next_steps.nil?
257
+ fail ArgumentError, 'next_steps cannot be nil'
258
+ end
259
+
260
+ @next_steps = next_steps
261
+ end
262
+
263
+ # Custom attribute writer method with validation
264
+ # @param [Object] warnings Value to be assigned
265
+ def warnings=(warnings)
266
+ if warnings.nil?
267
+ fail ArgumentError, 'warnings cannot be nil'
268
+ end
269
+
270
+ @warnings = warnings
271
+ end
272
+
273
+ # Checks equality by comparing each attribute.
274
+ # @param [Object] Object to be compared
275
+ def ==(o)
276
+ return true if self.equal?(o)
277
+ self.class == o.class &&
278
+ ad_account_id == o.ad_account_id &&
279
+ business_id == o.business_id &&
280
+ connection_updated == o.connection_updated &&
281
+ payment_method_required == o.payment_method_required &&
282
+ ads_manager_url == o.ads_manager_url &&
283
+ next_steps == o.next_steps &&
284
+ warnings == o.warnings
285
+ end
286
+
287
+ # @see the `==` method
288
+ # @param [Object] Object to be compared
289
+ def eql?(o)
290
+ self == o
291
+ end
292
+
293
+ # Calculates hash code according to all attributes.
294
+ # @return [Integer] Hash code
295
+ def hash
296
+ [ad_account_id, business_id, connection_updated, payment_method_required, ads_manager_url, next_steps, warnings].hash
297
+ end
298
+
299
+ # Builds the object from hash
300
+ # @param [Hash] attributes Model attributes in the form of hash
301
+ # @return [Object] Returns the model itself
302
+ def self.build_from_hash(attributes)
303
+ return nil unless attributes.is_a?(Hash)
304
+ attributes = attributes.transform_keys(&:to_sym)
305
+ transformed_hash = {}
306
+ openapi_types.each_pair do |key, type|
307
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
308
+ transformed_hash["#{key}"] = nil
309
+ elsif type =~ /\AArray<(.*)>/i
310
+ # check to ensure the input is an array given that the attribute
311
+ # is documented as an array but the input is not
312
+ if attributes[attribute_map[key]].is_a?(Array)
313
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
314
+ end
315
+ elsif !attributes[attribute_map[key]].nil?
316
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
317
+ end
318
+ end
319
+ new(transformed_hash)
320
+ end
321
+
322
+ # Returns the object in the form of hash
323
+ # @return [Hash] Returns the object in the form of hash
324
+ def to_hash
325
+ hash = {}
326
+ self.class.attribute_map.each_pair do |attr, param|
327
+ value = self.send(attr)
328
+ if value.nil?
329
+ is_nullable = self.class.openapi_nullable.include?(attr)
330
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
331
+ end
332
+
333
+ hash[param] = _to_hash(value)
334
+ end
335
+ hash
336
+ end
337
+
338
+ end
339
+
340
+ end