late-sdk 0.0.900 → 0.0.902

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +60 -6
  3. data/docs/AdAccountsApi.md +657 -19
  4. data/docs/AdCampaignsApi.md +521 -9
  5. data/docs/AdCreative.md +6 -0
  6. data/docs/AddAccountCalloutsRequest.md +3 -3
  7. data/docs/AddAccountSitelinks201Response.md +20 -0
  8. data/docs/AddAccountSitelinks201ResponseSitelinksInner.md +26 -0
  9. data/docs/AddAccountSitelinksRequest.md +22 -0
  10. data/docs/AddAccountStructuredSnippets201Response.md +20 -0
  11. data/docs/AddAccountStructuredSnippets201ResponseStructuredSnippetsInner.md +22 -0
  12. data/docs/AddAccountStructuredSnippetsRequest.md +22 -0
  13. data/docs/AttachAdGroupAssets201Response.md +24 -0
  14. data/docs/AttachCampaignAssetsRequest.md +4 -4
  15. data/docs/CreateStandaloneAdRequest.md +4 -4
  16. data/docs/CreateStandaloneAdRequestAdditionalDescriptionsInner.md +49 -0
  17. data/docs/CreateStandaloneAdRequestAdditionalHeadlinesInner.md +49 -0
  18. data/docs/GetAd200Response.md +5 -1
  19. data/docs/GoogleAssetUpdate.md +26 -0
  20. data/docs/GoogleRsaDescription.md +20 -0
  21. data/docs/GoogleRsaHeadline.md +20 -0
  22. data/docs/{AttachCampaignAssetsRequestSitelinksInner.md → GoogleSitelink.md} +2 -2
  23. data/docs/{AttachCampaignAssetsRequestStructuredSnippetsInner.md → GoogleStructuredSnippet.md} +2 -2
  24. data/docs/ListAccountCallouts200Response.md +2 -2
  25. data/docs/ListAccountCallouts200ResponseCalloutsInner.md +3 -3
  26. data/docs/ListAccountSitelinks200Response.md +24 -0
  27. data/docs/ListAccountSitelinks200ResponseSitelinksInner.md +32 -0
  28. data/docs/ListAccountStructuredSnippets200Response.md +24 -0
  29. data/docs/ListAccountStructuredSnippets200ResponseStructuredSnippetsInner.md +28 -0
  30. data/docs/ListAdGroupAssets200Response.md +28 -0
  31. data/docs/ListAdGroupAssets200ResponseCalloutsInner.md +22 -0
  32. data/docs/ListAdGroupAssets200ResponseSitelinksInner.md +28 -0
  33. data/docs/ListAdGroupAssets200ResponseStructuredSnippetsInner.md +24 -0
  34. data/docs/ListCampaignAssets200Response.md +28 -0
  35. data/docs/ListCampaignAssets200ResponseCalloutsInner.md +22 -0
  36. data/docs/ListCampaignAssets200ResponseSitelinksInner.md +28 -0
  37. data/docs/ListCampaignAssets200ResponseStructuredSnippetsInner.md +24 -0
  38. data/docs/RemoveAccountCalloutRequest.md +3 -3
  39. data/docs/RemoveAdGroupAssetsRequest.md +24 -0
  40. data/docs/RemoveCampaignAssets200Response.md +18 -0
  41. data/docs/RemoveCampaignAssetsRequest.md +24 -0
  42. data/docs/UpdateAccountCallouts200Response.md +20 -0
  43. data/docs/UpdateAccountCalloutsRequest.md +22 -0
  44. data/docs/UpdateAccountCalloutsRequestUpdatesInner.md +20 -0
  45. data/docs/UpdateAccountCalloutsRequestUpdatesInnerCalloutAsset.md +18 -0
  46. data/docs/UpdateAccountSitelinksRequest.md +22 -0
  47. data/docs/UpdateAccountSitelinksRequestUpdatesInner.md +22 -0
  48. data/docs/UpdateAccountSitelinksRequestUpdatesInnerSitelinkAsset.md +24 -0
  49. data/docs/UpdateAccountStructuredSnippetsRequest.md +22 -0
  50. data/docs/UpdateAccountStructuredSnippetsRequestUpdatesInner.md +20 -0
  51. data/docs/UpdateAdRequest.md +6 -0
  52. data/docs/UpdateCampaignAssets200Response.md +18 -0
  53. data/docs/UpdateCampaignAssetsRequest.md +22 -0
  54. data/docs/WebhookEventsApi.md +2 -2
  55. data/lib/zernio-sdk/api/ad_accounts_api.rb +656 -16
  56. data/lib/zernio-sdk/api/ad_campaigns_api.rb +586 -10
  57. data/lib/zernio-sdk/api/webhook_events_api.rb +4 -4
  58. data/lib/zernio-sdk/models/ad_creative.rb +112 -1
  59. data/lib/zernio-sdk/models/add_account_callouts_request.rb +34 -3
  60. data/lib/zernio-sdk/models/add_account_sitelinks201_response.rb +158 -0
  61. data/lib/zernio-sdk/models/add_account_sitelinks201_response_sitelinks_inner.rb +267 -0
  62. data/lib/zernio-sdk/models/add_account_sitelinks_request.rb +253 -0
  63. data/lib/zernio-sdk/models/add_account_structured_snippets201_response.rb +158 -0
  64. data/lib/zernio-sdk/models/add_account_structured_snippets201_response_structured_snippets_inner.rb +229 -0
  65. data/lib/zernio-sdk/models/add_account_structured_snippets_request.rb +253 -0
  66. data/lib/zernio-sdk/models/attach_ad_group_assets201_response.rb +180 -0
  67. data/lib/zernio-sdk/models/attach_campaign_assets_request.rb +37 -5
  68. data/lib/zernio-sdk/models/create_standalone_ad_request.rb +4 -4
  69. data/lib/zernio-sdk/models/create_standalone_ad_request_additional_descriptions_inner.rb +104 -0
  70. data/lib/zernio-sdk/models/create_standalone_ad_request_additional_headlines_inner.rb +104 -0
  71. data/lib/zernio-sdk/models/get_ad200_response.rb +25 -4
  72. data/lib/zernio-sdk/models/google_asset_update.rb +234 -0
  73. data/lib/zernio-sdk/models/google_rsa_description.rb +226 -0
  74. data/lib/zernio-sdk/models/google_rsa_headline.rb +226 -0
  75. data/lib/zernio-sdk/models/{attach_campaign_assets_request_sitelinks_inner.rb → google_sitelink.rb} +3 -3
  76. data/lib/zernio-sdk/models/{attach_campaign_assets_request_structured_snippets_inner.rb → google_structured_snippet.rb} +3 -3
  77. data/lib/zernio-sdk/models/list_account_callouts200_response.rb +2 -2
  78. data/lib/zernio-sdk/models/list_account_callouts200_response_callouts_inner.rb +13 -14
  79. data/lib/zernio-sdk/models/list_account_sitelinks200_response.rb +179 -0
  80. data/lib/zernio-sdk/models/list_account_sitelinks200_response_sitelinks_inner.rb +210 -0
  81. data/lib/zernio-sdk/models/list_account_structured_snippets200_response.rb +179 -0
  82. data/lib/zernio-sdk/models/list_account_structured_snippets200_response_structured_snippets_inner.rb +194 -0
  83. data/lib/zernio-sdk/models/list_ad_group_assets200_response.rb +201 -0
  84. data/lib/zernio-sdk/models/list_ad_group_assets200_response_callouts_inner.rb +165 -0
  85. data/lib/zernio-sdk/models/list_ad_group_assets200_response_sitelinks_inner.rb +192 -0
  86. data/lib/zernio-sdk/models/list_ad_group_assets200_response_structured_snippets_inner.rb +176 -0
  87. data/lib/zernio-sdk/models/list_campaign_assets200_response.rb +201 -0
  88. data/lib/zernio-sdk/models/list_campaign_assets200_response_callouts_inner.rb +165 -0
  89. data/lib/zernio-sdk/models/list_campaign_assets200_response_sitelinks_inner.rb +192 -0
  90. data/lib/zernio-sdk/models/list_campaign_assets200_response_structured_snippets_inner.rb +176 -0
  91. data/lib/zernio-sdk/models/remove_account_callout_request.rb +45 -3
  92. data/lib/zernio-sdk/models/remove_ad_group_assets_request.rb +281 -0
  93. data/lib/zernio-sdk/models/remove_campaign_assets200_response.rb +147 -0
  94. data/lib/zernio-sdk/models/remove_campaign_assets_request.rb +281 -0
  95. data/lib/zernio-sdk/models/update_account_callouts200_response.rb +156 -0
  96. data/lib/zernio-sdk/models/update_account_callouts_request.rb +253 -0
  97. data/lib/zernio-sdk/models/update_account_callouts_request_updates_inner.rb +186 -0
  98. data/lib/zernio-sdk/models/update_account_callouts_request_updates_inner_callout_asset.rb +182 -0
  99. data/lib/zernio-sdk/models/update_account_sitelinks_request.rb +253 -0
  100. data/lib/zernio-sdk/models/update_account_sitelinks_request_updates_inner.rb +216 -0
  101. data/lib/zernio-sdk/models/update_account_sitelinks_request_updates_inner_sitelink_asset.rb +241 -0
  102. data/lib/zernio-sdk/models/update_account_structured_snippets_request.rb +253 -0
  103. data/lib/zernio-sdk/models/update_account_structured_snippets_request_updates_inner.rb +186 -0
  104. data/lib/zernio-sdk/models/update_ad_request.rb +112 -1
  105. data/lib/zernio-sdk/models/update_campaign_assets200_response.rb +147 -0
  106. data/lib/zernio-sdk/models/update_campaign_assets_request.rb +253 -0
  107. data/lib/zernio-sdk/models/webhook_payload_post_platform.rb +1 -1
  108. data/lib/zernio-sdk/version.rb +1 -1
  109. data/lib/zernio-sdk.rb +40 -2
  110. data/openapi.yaml +2027 -329
  111. data/spec/api/ad_accounts_api_spec.rb +118 -8
  112. data/spec/api/ad_campaigns_api_spec.rb +98 -5
  113. data/spec/models/ad_creative_spec.rb +18 -0
  114. data/spec/models/add_account_sitelinks201_response_sitelinks_inner_spec.rb +60 -0
  115. data/spec/models/add_account_sitelinks201_response_spec.rb +42 -0
  116. data/spec/models/add_account_sitelinks_request_spec.rb +48 -0
  117. data/spec/models/add_account_structured_snippets201_response_spec.rb +42 -0
  118. data/spec/models/add_account_structured_snippets201_response_structured_snippets_inner_spec.rb +52 -0
  119. data/spec/models/add_account_structured_snippets_request_spec.rb +48 -0
  120. data/spec/models/attach_ad_group_assets201_response_spec.rb +54 -0
  121. data/spec/models/create_standalone_ad_request_additional_descriptions_inner_spec.rb +32 -0
  122. data/spec/models/create_standalone_ad_request_additional_headlines_inner_spec.rb +32 -0
  123. data/spec/models/get_ad200_response_spec.rb +12 -0
  124. data/spec/models/google_asset_update_spec.rb +60 -0
  125. data/spec/models/google_rsa_description_spec.rb +46 -0
  126. data/spec/models/google_rsa_headline_spec.rb +46 -0
  127. data/spec/models/{attach_campaign_assets_request_sitelinks_inner_spec.rb → google_sitelink_spec.rb} +6 -6
  128. data/spec/models/{attach_campaign_assets_request_structured_snippets_inner_spec.rb → google_structured_snippet_spec.rb} +6 -6
  129. data/spec/models/list_account_callouts200_response_callouts_inner_spec.rb +2 -2
  130. data/spec/models/list_account_sitelinks200_response_sitelinks_inner_spec.rb +78 -0
  131. data/spec/models/list_account_sitelinks200_response_spec.rb +54 -0
  132. data/spec/models/list_account_structured_snippets200_response_spec.rb +54 -0
  133. data/spec/models/list_account_structured_snippets200_response_structured_snippets_inner_spec.rb +66 -0
  134. data/spec/models/list_ad_group_assets200_response_callouts_inner_spec.rb +48 -0
  135. data/spec/models/list_ad_group_assets200_response_sitelinks_inner_spec.rb +66 -0
  136. data/spec/models/list_ad_group_assets200_response_spec.rb +66 -0
  137. data/spec/models/list_ad_group_assets200_response_structured_snippets_inner_spec.rb +54 -0
  138. data/spec/models/list_campaign_assets200_response_callouts_inner_spec.rb +48 -0
  139. data/spec/models/list_campaign_assets200_response_sitelinks_inner_spec.rb +66 -0
  140. data/spec/models/list_campaign_assets200_response_spec.rb +66 -0
  141. data/spec/models/list_campaign_assets200_response_structured_snippets_inner_spec.rb +54 -0
  142. data/spec/models/remove_ad_group_assets_request_spec.rb +54 -0
  143. data/spec/models/remove_campaign_assets200_response_spec.rb +36 -0
  144. data/spec/models/remove_campaign_assets_request_spec.rb +54 -0
  145. data/spec/models/update_account_callouts200_response_spec.rb +42 -0
  146. data/spec/models/update_account_callouts_request_spec.rb +48 -0
  147. data/spec/models/update_account_callouts_request_updates_inner_callout_asset_spec.rb +36 -0
  148. data/spec/models/update_account_callouts_request_updates_inner_spec.rb +42 -0
  149. data/spec/models/update_account_sitelinks_request_spec.rb +48 -0
  150. data/spec/models/update_account_sitelinks_request_updates_inner_sitelink_asset_spec.rb +54 -0
  151. data/spec/models/update_account_sitelinks_request_updates_inner_spec.rb +48 -0
  152. data/spec/models/update_account_structured_snippets_request_spec.rb +48 -0
  153. data/spec/models/update_account_structured_snippets_request_updates_inner_spec.rb +42 -0
  154. data/spec/models/update_ad_request_spec.rb +18 -0
  155. data/spec/models/update_campaign_assets200_response_spec.rb +36 -0
  156. data/spec/models/update_campaign_assets_request_spec.rb +48 -0
  157. data/zernio-sdk-0.0.902.gem +0 -0
  158. metadata +163 -11
  159. data/zernio-sdk-0.0.900.gem +0 -0
@@ -0,0 +1,216 @@
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
+ # Provide at least one field belonging to this asset type.
18
+ class UpdateAccountSitelinksRequestUpdatesInner < ApiModelBase
19
+ # Asset resource name returned by a list operation. Must belong to the selected customer.
20
+ attr_accessor :asset_resource_name
21
+
22
+ attr_accessor :sitelink_asset
23
+
24
+ attr_accessor :final_urls
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'asset_resource_name' => :'assetResourceName',
30
+ :'sitelink_asset' => :'sitelinkAsset',
31
+ :'final_urls' => :'finalUrls'
32
+ }
33
+ end
34
+
35
+ # Returns attribute mapping this model knows about
36
+ def self.acceptable_attribute_map
37
+ attribute_map
38
+ end
39
+
40
+ # Returns all the JSON keys this model knows about
41
+ def self.acceptable_attributes
42
+ acceptable_attribute_map.values
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ def self.openapi_types
47
+ {
48
+ :'asset_resource_name' => :'String',
49
+ :'sitelink_asset' => :'UpdateAccountSitelinksRequestUpdatesInnerSitelinkAsset',
50
+ :'final_urls' => :'Array<String>'
51
+ }
52
+ end
53
+
54
+ # List of attributes with nullable: true
55
+ def self.openapi_nullable
56
+ Set.new([
57
+ ])
58
+ end
59
+
60
+ # Initializes the object
61
+ # @param [Hash] attributes Model attributes in the form of hash
62
+ def initialize(attributes = {})
63
+ if (!attributes.is_a?(Hash))
64
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::UpdateAccountSitelinksRequestUpdatesInner` initialize method"
65
+ end
66
+
67
+ # check to see if the attribute exists and convert string to symbol for hash key
68
+ acceptable_attribute_map = self.class.acceptable_attribute_map
69
+ attributes = attributes.each_with_object({}) { |(k, v), h|
70
+ if (!acceptable_attribute_map.key?(k.to_sym))
71
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::UpdateAccountSitelinksRequestUpdatesInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
72
+ end
73
+ h[k.to_sym] = v
74
+ }
75
+
76
+ if attributes.key?(:'asset_resource_name')
77
+ self.asset_resource_name = attributes[:'asset_resource_name']
78
+ else
79
+ self.asset_resource_name = nil
80
+ end
81
+
82
+ if attributes.key?(:'sitelink_asset')
83
+ self.sitelink_asset = attributes[:'sitelink_asset']
84
+ end
85
+
86
+ if attributes.key?(:'final_urls')
87
+ if (value = attributes[:'final_urls']).is_a?(Array)
88
+ self.final_urls = value
89
+ end
90
+ end
91
+ end
92
+
93
+ # Show invalid properties with the reasons. Usually used together with valid?
94
+ # @return Array for valid properties with the reasons
95
+ def list_invalid_properties
96
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
97
+ invalid_properties = Array.new
98
+ if @asset_resource_name.nil?
99
+ invalid_properties.push('invalid value for "asset_resource_name", asset_resource_name cannot be nil.')
100
+ end
101
+
102
+ pattern = Regexp.new(/^customers\/\d+\/assets\/\d+$/)
103
+ if @asset_resource_name !~ pattern
104
+ invalid_properties.push("invalid value for \"asset_resource_name\", must conform to the pattern #{pattern}.")
105
+ end
106
+
107
+ if !@final_urls.nil? && @final_urls.length < 1
108
+ invalid_properties.push('invalid value for "final_urls", number of items must be greater than or equal to 1.')
109
+ end
110
+
111
+ invalid_properties
112
+ end
113
+
114
+ # Check to see if the all the properties in the model are valid
115
+ # @return true if the model is valid
116
+ def valid?
117
+ warn '[DEPRECATED] the `valid?` method is obsolete'
118
+ return false if @asset_resource_name.nil?
119
+ return false if @asset_resource_name !~ Regexp.new(/^customers\/\d+\/assets\/\d+$/)
120
+ return false if !@final_urls.nil? && @final_urls.length < 1
121
+ true
122
+ end
123
+
124
+ # Custom attribute writer method with validation
125
+ # @param [Object] asset_resource_name Value to be assigned
126
+ def asset_resource_name=(asset_resource_name)
127
+ if asset_resource_name.nil?
128
+ fail ArgumentError, 'asset_resource_name cannot be nil'
129
+ end
130
+
131
+ pattern = Regexp.new(/^customers\/\d+\/assets\/\d+$/)
132
+ if asset_resource_name !~ pattern
133
+ fail ArgumentError, "invalid value for \"asset_resource_name\", must conform to the pattern #{pattern}."
134
+ end
135
+
136
+ @asset_resource_name = asset_resource_name
137
+ end
138
+
139
+ # Custom attribute writer method with validation
140
+ # @param [Object] final_urls Value to be assigned
141
+ def final_urls=(final_urls)
142
+ if final_urls.nil?
143
+ fail ArgumentError, 'final_urls cannot be nil'
144
+ end
145
+
146
+ if final_urls.length < 1
147
+ fail ArgumentError, 'invalid value for "final_urls", number of items must be greater than or equal to 1.'
148
+ end
149
+
150
+ @final_urls = final_urls
151
+ end
152
+
153
+ # Checks equality by comparing each attribute.
154
+ # @param [Object] Object to be compared
155
+ def ==(o)
156
+ return true if self.equal?(o)
157
+ self.class == o.class &&
158
+ asset_resource_name == o.asset_resource_name &&
159
+ sitelink_asset == o.sitelink_asset &&
160
+ final_urls == o.final_urls
161
+ end
162
+
163
+ # @see the `==` method
164
+ # @param [Object] Object to be compared
165
+ def eql?(o)
166
+ self == o
167
+ end
168
+
169
+ # Calculates hash code according to all attributes.
170
+ # @return [Integer] Hash code
171
+ def hash
172
+ [asset_resource_name, sitelink_asset, final_urls].hash
173
+ end
174
+
175
+ # Builds the object from hash
176
+ # @param [Hash] attributes Model attributes in the form of hash
177
+ # @return [Object] Returns the model itself
178
+ def self.build_from_hash(attributes)
179
+ return nil unless attributes.is_a?(Hash)
180
+ attributes = attributes.transform_keys(&:to_sym)
181
+ transformed_hash = {}
182
+ openapi_types.each_pair do |key, type|
183
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
184
+ transformed_hash["#{key}"] = nil
185
+ elsif type =~ /\AArray<(.*)>/i
186
+ # check to ensure the input is an array given that the attribute
187
+ # is documented as an array but the input is not
188
+ if attributes[attribute_map[key]].is_a?(Array)
189
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
190
+ end
191
+ elsif !attributes[attribute_map[key]].nil?
192
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
193
+ end
194
+ end
195
+ new(transformed_hash)
196
+ end
197
+
198
+ # Returns the object in the form of hash
199
+ # @return [Hash] Returns the object in the form of hash
200
+ def to_hash
201
+ hash = {}
202
+ self.class.attribute_map.each_pair do |attr, param|
203
+ value = self.send(attr)
204
+ if value.nil?
205
+ is_nullable = self.class.openapi_nullable.include?(attr)
206
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
207
+ end
208
+
209
+ hash[param] = _to_hash(value)
210
+ end
211
+ hash
212
+ end
213
+
214
+ end
215
+
216
+ end
@@ -0,0 +1,241 @@
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 UpdateAccountSitelinksRequestUpdatesInnerSitelinkAsset < ApiModelBase
18
+ attr_accessor :link_text
19
+
20
+ attr_accessor :description1
21
+
22
+ attr_accessor :description2
23
+
24
+ # Alias for finalUrls with one URL. Do not supply both.
25
+ attr_accessor :link_url
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'link_text' => :'linkText',
31
+ :'description1' => :'description1',
32
+ :'description2' => :'description2',
33
+ :'link_url' => :'linkUrl'
34
+ }
35
+ end
36
+
37
+ # Returns attribute mapping this model knows about
38
+ def self.acceptable_attribute_map
39
+ attribute_map
40
+ end
41
+
42
+ # Returns all the JSON keys this model knows about
43
+ def self.acceptable_attributes
44
+ acceptable_attribute_map.values
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.openapi_types
49
+ {
50
+ :'link_text' => :'String',
51
+ :'description1' => :'String',
52
+ :'description2' => :'String',
53
+ :'link_url' => :'String'
54
+ }
55
+ end
56
+
57
+ # List of attributes with nullable: true
58
+ def self.openapi_nullable
59
+ Set.new([
60
+ ])
61
+ end
62
+
63
+ # Initializes the object
64
+ # @param [Hash] attributes Model attributes in the form of hash
65
+ def initialize(attributes = {})
66
+ if (!attributes.is_a?(Hash))
67
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::UpdateAccountSitelinksRequestUpdatesInnerSitelinkAsset` initialize method"
68
+ end
69
+
70
+ # check to see if the attribute exists and convert string to symbol for hash key
71
+ acceptable_attribute_map = self.class.acceptable_attribute_map
72
+ attributes = attributes.each_with_object({}) { |(k, v), h|
73
+ if (!acceptable_attribute_map.key?(k.to_sym))
74
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::UpdateAccountSitelinksRequestUpdatesInnerSitelinkAsset`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
75
+ end
76
+ h[k.to_sym] = v
77
+ }
78
+
79
+ if attributes.key?(:'link_text')
80
+ self.link_text = attributes[:'link_text']
81
+ end
82
+
83
+ if attributes.key?(:'description1')
84
+ self.description1 = attributes[:'description1']
85
+ end
86
+
87
+ if attributes.key?(:'description2')
88
+ self.description2 = attributes[:'description2']
89
+ end
90
+
91
+ if attributes.key?(:'link_url')
92
+ self.link_url = attributes[:'link_url']
93
+ end
94
+ end
95
+
96
+ # Show invalid properties with the reasons. Usually used together with valid?
97
+ # @return Array for valid properties with the reasons
98
+ def list_invalid_properties
99
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
100
+ invalid_properties = Array.new
101
+ if !@link_text.nil? && @link_text.to_s.length > 25
102
+ invalid_properties.push('invalid value for "link_text", the character length must be smaller than or equal to 25.')
103
+ end
104
+
105
+ if !@link_text.nil? && @link_text.to_s.length < 1
106
+ invalid_properties.push('invalid value for "link_text", the character length must be greater than or equal to 1.')
107
+ end
108
+
109
+ if !@description1.nil? && @description1.to_s.length > 35
110
+ invalid_properties.push('invalid value for "description1", the character length must be smaller than or equal to 35.')
111
+ end
112
+
113
+ if !@description2.nil? && @description2.to_s.length > 35
114
+ invalid_properties.push('invalid value for "description2", the character length must be smaller than or equal to 35.')
115
+ end
116
+
117
+ invalid_properties
118
+ end
119
+
120
+ # Check to see if the all the properties in the model are valid
121
+ # @return true if the model is valid
122
+ def valid?
123
+ warn '[DEPRECATED] the `valid?` method is obsolete'
124
+ return false if !@link_text.nil? && @link_text.to_s.length > 25
125
+ return false if !@link_text.nil? && @link_text.to_s.length < 1
126
+ return false if !@description1.nil? && @description1.to_s.length > 35
127
+ return false if !@description2.nil? && @description2.to_s.length > 35
128
+ true
129
+ end
130
+
131
+ # Custom attribute writer method with validation
132
+ # @param [Object] link_text Value to be assigned
133
+ def link_text=(link_text)
134
+ if link_text.nil?
135
+ fail ArgumentError, 'link_text cannot be nil'
136
+ end
137
+
138
+ if link_text.to_s.length > 25
139
+ fail ArgumentError, 'invalid value for "link_text", the character length must be smaller than or equal to 25.'
140
+ end
141
+
142
+ if link_text.to_s.length < 1
143
+ fail ArgumentError, 'invalid value for "link_text", the character length must be greater than or equal to 1.'
144
+ end
145
+
146
+ @link_text = link_text
147
+ end
148
+
149
+ # Custom attribute writer method with validation
150
+ # @param [Object] description1 Value to be assigned
151
+ def description1=(description1)
152
+ if description1.nil?
153
+ fail ArgumentError, 'description1 cannot be nil'
154
+ end
155
+
156
+ if description1.to_s.length > 35
157
+ fail ArgumentError, 'invalid value for "description1", the character length must be smaller than or equal to 35.'
158
+ end
159
+
160
+ @description1 = description1
161
+ end
162
+
163
+ # Custom attribute writer method with validation
164
+ # @param [Object] description2 Value to be assigned
165
+ def description2=(description2)
166
+ if description2.nil?
167
+ fail ArgumentError, 'description2 cannot be nil'
168
+ end
169
+
170
+ if description2.to_s.length > 35
171
+ fail ArgumentError, 'invalid value for "description2", the character length must be smaller than or equal to 35.'
172
+ end
173
+
174
+ @description2 = description2
175
+ end
176
+
177
+ # Checks equality by comparing each attribute.
178
+ # @param [Object] Object to be compared
179
+ def ==(o)
180
+ return true if self.equal?(o)
181
+ self.class == o.class &&
182
+ link_text == o.link_text &&
183
+ description1 == o.description1 &&
184
+ description2 == o.description2 &&
185
+ link_url == o.link_url
186
+ end
187
+
188
+ # @see the `==` method
189
+ # @param [Object] Object to be compared
190
+ def eql?(o)
191
+ self == o
192
+ end
193
+
194
+ # Calculates hash code according to all attributes.
195
+ # @return [Integer] Hash code
196
+ def hash
197
+ [link_text, description1, description2, link_url].hash
198
+ end
199
+
200
+ # Builds the object from hash
201
+ # @param [Hash] attributes Model attributes in the form of hash
202
+ # @return [Object] Returns the model itself
203
+ def self.build_from_hash(attributes)
204
+ return nil unless attributes.is_a?(Hash)
205
+ attributes = attributes.transform_keys(&:to_sym)
206
+ transformed_hash = {}
207
+ openapi_types.each_pair do |key, type|
208
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
209
+ transformed_hash["#{key}"] = nil
210
+ elsif type =~ /\AArray<(.*)>/i
211
+ # check to ensure the input is an array given that the attribute
212
+ # is documented as an array but the input is not
213
+ if attributes[attribute_map[key]].is_a?(Array)
214
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
215
+ end
216
+ elsif !attributes[attribute_map[key]].nil?
217
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
218
+ end
219
+ end
220
+ new(transformed_hash)
221
+ end
222
+
223
+ # Returns the object in the form of hash
224
+ # @return [Hash] Returns the object in the form of hash
225
+ def to_hash
226
+ hash = {}
227
+ self.class.attribute_map.each_pair do |attr, param|
228
+ value = self.send(attr)
229
+ if value.nil?
230
+ is_nullable = self.class.openapi_nullable.include?(attr)
231
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
232
+ end
233
+
234
+ hash[param] = _to_hash(value)
235
+ end
236
+ hash
237
+ end
238
+
239
+ end
240
+
241
+ end