fastly 4.1.0 → 4.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +37 -0
- data/Gemfile.lock +1 -1
- data/README.md +93 -11
- data/docs/Backend.md +1 -1
- data/docs/BackendApi.md +4 -4
- data/docs/BackendResponse.md +1 -1
- data/docs/DomainOwnershipsApi.md +47 -0
- data/docs/EnabledProductResponse.md +12 -0
- data/docs/EnabledProductResponseLinks.md +11 -0
- data/docs/{EnabledProductProduct.md → EnabledProductResponseProduct.md} +3 -3
- data/docs/EnabledProductResponseService.md +11 -0
- data/docs/EnabledProductsApi.md +7 -7
- data/docs/EventsApi.md +2 -0
- data/docs/HistoricalApi.md +10 -10
- data/docs/{EnabledProductLinks.md → InlineResponse2002.md} +2 -3
- data/docs/{GetStoresResponse.md → InlineResponse2003.md} +2 -2
- data/docs/{GetStoresResponseMeta.md → InlineResponse2003Meta.md} +1 -1
- data/docs/{KeyResponse.md → InlineResponse2004.md} +2 -2
- data/docs/{ResourceCreateAllOf.md → InlineResponse2004Meta.md} +3 -2
- data/docs/ObjectStoreApi.md +3 -166
- data/docs/ObjectStoreItemApi.md +177 -0
- data/docs/Pop.md +7 -4
- data/docs/PopCoordinates.md +2 -4
- data/docs/RealtimeMeasurements.md +10 -2
- data/docs/Resource.md +2 -1
- data/docs/ResourceApi.md +34 -32
- data/docs/ResourceResponse.md +3 -3
- data/docs/ResourceResponseAllOf.md +1 -1
- data/docs/Results.md +11 -3
- data/docs/TlsSubscriptionResponseAttributes.md +1 -1
- data/docs/TlsSubscriptionResponseAttributesAllOf.md +1 -1
- data/docs/TlsSubscriptionsApi.md +3 -3
- data/lib/fastly/api/backend_api.rb +4 -4
- data/lib/fastly/api/domain_ownerships_api.rb +76 -0
- data/lib/fastly/api/enabled_products_api.rb +12 -12
- data/lib/fastly/api/events_api.rb +3 -0
- data/lib/fastly/api/historical_api.rb +10 -10
- data/lib/fastly/api/object_store_api.rb +5 -289
- data/lib/fastly/api/object_store_item_api.rb +304 -0
- data/lib/fastly/api/purge_api.rb +2 -2
- data/lib/fastly/api/resource_api.rb +51 -48
- data/lib/fastly/api/tls_subscriptions_api.rb +4 -4
- data/lib/fastly/models/backend.rb +1 -1
- data/lib/fastly/models/backend_response.rb +1 -1
- data/lib/fastly/models/{enabled_product.rb → enabled_product_response.rb} +6 -6
- data/lib/fastly/models/{enabled_product_links.rb → enabled_product_response_links.rb} +5 -3
- data/lib/fastly/models/{enabled_product_product.rb → enabled_product_response_product.rb} +5 -3
- data/lib/fastly/models/enabled_product_response_service.rb +227 -0
- data/lib/fastly/models/{resource_create_all_of.rb → inline_response2002.rb} +11 -11
- data/lib/fastly/models/{get_stores_response.rb → inline_response2003.rb} +4 -4
- data/lib/fastly/models/{get_stores_response_meta.rb → inline_response2003_meta.rb} +3 -3
- data/lib/fastly/models/{key_response.rb → inline_response2004.rb} +4 -4
- data/lib/fastly/models/inline_response2004_meta.rb +225 -0
- data/lib/fastly/models/pop.rb +121 -1
- data/lib/fastly/models/pop_coordinates.rb +12 -19
- data/lib/fastly/models/realtime_measurements.rb +86 -6
- data/lib/fastly/models/resource.rb +12 -2
- data/lib/fastly/models/resource_response.rb +23 -23
- data/lib/fastly/models/resource_response_all_of.rb +1 -1
- data/lib/fastly/models/results.rb +87 -7
- data/lib/fastly/models/tls_subscription_response_attributes.rb +2 -2
- data/lib/fastly/models/tls_subscription_response_attributes_all_of.rb +2 -2
- data/lib/fastly/models/type_resource.rb +2 -0
- data/lib/fastly/version.rb +1 -1
- data/lib/fastly.rb +11 -8
- data/sig.json +1 -1
- metadata +24 -18
- data/docs/EnabledProduct.md +0 -12
- data/docs/ResourceCreate.md +0 -11
- data/lib/fastly/models/resource_create.rb +0 -235
data/lib/fastly.rb
CHANGED
@@ -86,9 +86,10 @@ require 'fastly/models/director_response'
|
|
86
86
|
require 'fastly/models/domain'
|
87
87
|
require 'fastly/models/domain_check_item'
|
88
88
|
require 'fastly/models/domain_response'
|
89
|
-
require 'fastly/models/
|
90
|
-
require 'fastly/models/
|
91
|
-
require 'fastly/models/
|
89
|
+
require 'fastly/models/enabled_product_response'
|
90
|
+
require 'fastly/models/enabled_product_response_links'
|
91
|
+
require 'fastly/models/enabled_product_response_product'
|
92
|
+
require 'fastly/models/enabled_product_response_service'
|
92
93
|
require 'fastly/models/error_response'
|
93
94
|
require 'fastly/models/error_response_data'
|
94
95
|
require 'fastly/models/event'
|
@@ -97,8 +98,6 @@ require 'fastly/models/event_response'
|
|
97
98
|
require 'fastly/models/events_response'
|
98
99
|
require 'fastly/models/events_response_all_of'
|
99
100
|
require 'fastly/models/generic_token_error'
|
100
|
-
require 'fastly/models/get_stores_response'
|
101
|
-
require 'fastly/models/get_stores_response_meta'
|
102
101
|
require 'fastly/models/gzip'
|
103
102
|
require 'fastly/models/gzip_response'
|
104
103
|
require 'fastly/models/header'
|
@@ -143,6 +142,11 @@ require 'fastly/models/inline_object'
|
|
143
142
|
require 'fastly/models/inline_object1'
|
144
143
|
require 'fastly/models/inline_response200'
|
145
144
|
require 'fastly/models/inline_response2001'
|
145
|
+
require 'fastly/models/inline_response2002'
|
146
|
+
require 'fastly/models/inline_response2003'
|
147
|
+
require 'fastly/models/inline_response2003_meta'
|
148
|
+
require 'fastly/models/inline_response2004'
|
149
|
+
require 'fastly/models/inline_response2004_meta'
|
146
150
|
require 'fastly/models/invitation'
|
147
151
|
require 'fastly/models/invitation_data'
|
148
152
|
require 'fastly/models/invitation_data_attributes'
|
@@ -152,7 +156,6 @@ require 'fastly/models/invitation_response_data'
|
|
152
156
|
require 'fastly/models/invitation_response_data_all_of'
|
153
157
|
require 'fastly/models/invitations_response'
|
154
158
|
require 'fastly/models/invitations_response_all_of'
|
155
|
-
require 'fastly/models/key_response'
|
156
159
|
require 'fastly/models/logging_address_and_port'
|
157
160
|
require 'fastly/models/logging_azureblob'
|
158
161
|
require 'fastly/models/logging_azureblob_all_of'
|
@@ -370,8 +373,6 @@ require 'fastly/models/relationships_for_waf_rule'
|
|
370
373
|
require 'fastly/models/request_settings'
|
371
374
|
require 'fastly/models/request_settings_response'
|
372
375
|
require 'fastly/models/resource'
|
373
|
-
require 'fastly/models/resource_create'
|
374
|
-
require 'fastly/models/resource_create_all_of'
|
375
376
|
require 'fastly/models/resource_response'
|
376
377
|
require 'fastly/models/resource_response_all_of'
|
377
378
|
require 'fastly/models/response_object'
|
@@ -633,6 +634,7 @@ require 'fastly/api/diff_api'
|
|
633
634
|
require 'fastly/api/director_api'
|
634
635
|
require 'fastly/api/director_backend_api'
|
635
636
|
require 'fastly/api/domain_api'
|
637
|
+
require 'fastly/api/domain_ownerships_api'
|
636
638
|
require 'fastly/api/enabled_products_api'
|
637
639
|
require 'fastly/api/events_api'
|
638
640
|
require 'fastly/api/gzip_api'
|
@@ -673,6 +675,7 @@ require 'fastly/api/logging_sumologic_api'
|
|
673
675
|
require 'fastly/api/logging_syslog_api'
|
674
676
|
require 'fastly/api/mutual_authentication_api'
|
675
677
|
require 'fastly/api/object_store_api'
|
678
|
+
require 'fastly/api/object_store_item_api'
|
676
679
|
require 'fastly/api/package_api'
|
677
680
|
require 'fastly/api/pool_api'
|
678
681
|
require 'fastly/api/pop_api'
|
data/sig.json
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"G": "
|
1
|
+
{"G": "1fa5122c", "D": "93752003"}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fastly
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -140,10 +140,12 @@ files:
|
|
140
140
|
- docs/Domain.md
|
141
141
|
- docs/DomainApi.md
|
142
142
|
- docs/DomainCheckItem.md
|
143
|
+
- docs/DomainOwnershipsApi.md
|
143
144
|
- docs/DomainResponse.md
|
144
|
-
- docs/
|
145
|
-
- docs/
|
146
|
-
- docs/
|
145
|
+
- docs/EnabledProductResponse.md
|
146
|
+
- docs/EnabledProductResponseLinks.md
|
147
|
+
- docs/EnabledProductResponseProduct.md
|
148
|
+
- docs/EnabledProductResponseService.md
|
147
149
|
- docs/EnabledProductsApi.md
|
148
150
|
- docs/ErrorResponse.md
|
149
151
|
- docs/ErrorResponseData.md
|
@@ -154,8 +156,6 @@ files:
|
|
154
156
|
- docs/EventsResponse.md
|
155
157
|
- docs/EventsResponseAllOf.md
|
156
158
|
- docs/GenericTokenError.md
|
157
|
-
- docs/GetStoresResponse.md
|
158
|
-
- docs/GetStoresResponseMeta.md
|
159
159
|
- docs/Gzip.md
|
160
160
|
- docs/GzipApi.md
|
161
161
|
- docs/GzipResponse.md
|
@@ -209,6 +209,11 @@ files:
|
|
209
209
|
- docs/InlineObject1.md
|
210
210
|
- docs/InlineResponse200.md
|
211
211
|
- docs/InlineResponse2001.md
|
212
|
+
- docs/InlineResponse2002.md
|
213
|
+
- docs/InlineResponse2003.md
|
214
|
+
- docs/InlineResponse2003Meta.md
|
215
|
+
- docs/InlineResponse2004.md
|
216
|
+
- docs/InlineResponse2004Meta.md
|
212
217
|
- docs/Invitation.md
|
213
218
|
- docs/InvitationData.md
|
214
219
|
- docs/InvitationDataAttributes.md
|
@@ -219,7 +224,6 @@ files:
|
|
219
224
|
- docs/InvitationsApi.md
|
220
225
|
- docs/InvitationsResponse.md
|
221
226
|
- docs/InvitationsResponseAllOf.md
|
222
|
-
- docs/KeyResponse.md
|
223
227
|
- docs/LoggingAddressAndPort.md
|
224
228
|
- docs/LoggingAzureblob.md
|
225
229
|
- docs/LoggingAzureblobAllOf.md
|
@@ -344,6 +348,7 @@ files:
|
|
344
348
|
- docs/MutualAuthenticationsResponse.md
|
345
349
|
- docs/MutualAuthenticationsResponseAllOf.md
|
346
350
|
- docs/ObjectStoreApi.md
|
351
|
+
- docs/ObjectStoreItemApi.md
|
347
352
|
- docs/Package.md
|
348
353
|
- docs/PackageApi.md
|
349
354
|
- docs/PackageMetadata.md
|
@@ -475,8 +480,6 @@ files:
|
|
475
480
|
- docs/RequestSettingsResponse.md
|
476
481
|
- docs/Resource.md
|
477
482
|
- docs/ResourceApi.md
|
478
|
-
- docs/ResourceCreate.md
|
479
|
-
- docs/ResourceCreateAllOf.md
|
480
483
|
- docs/ResourceResponse.md
|
481
484
|
- docs/ResourceResponseAllOf.md
|
482
485
|
- docs/ResponseObject.md
|
@@ -766,6 +769,7 @@ files:
|
|
766
769
|
- lib/fastly/api/director_api.rb
|
767
770
|
- lib/fastly/api/director_backend_api.rb
|
768
771
|
- lib/fastly/api/domain_api.rb
|
772
|
+
- lib/fastly/api/domain_ownerships_api.rb
|
769
773
|
- lib/fastly/api/enabled_products_api.rb
|
770
774
|
- lib/fastly/api/events_api.rb
|
771
775
|
- lib/fastly/api/gzip_api.rb
|
@@ -806,6 +810,7 @@ files:
|
|
806
810
|
- lib/fastly/api/logging_syslog_api.rb
|
807
811
|
- lib/fastly/api/mutual_authentication_api.rb
|
808
812
|
- lib/fastly/api/object_store_api.rb
|
813
|
+
- lib/fastly/api/object_store_item_api.rb
|
809
814
|
- lib/fastly/api/package_api.rb
|
810
815
|
- lib/fastly/api/pool_api.rb
|
811
816
|
- lib/fastly/api/pop_api.rb
|
@@ -918,9 +923,10 @@ files:
|
|
918
923
|
- lib/fastly/models/domain.rb
|
919
924
|
- lib/fastly/models/domain_check_item.rb
|
920
925
|
- lib/fastly/models/domain_response.rb
|
921
|
-
- lib/fastly/models/
|
922
|
-
- lib/fastly/models/
|
923
|
-
- lib/fastly/models/
|
926
|
+
- lib/fastly/models/enabled_product_response.rb
|
927
|
+
- lib/fastly/models/enabled_product_response_links.rb
|
928
|
+
- lib/fastly/models/enabled_product_response_product.rb
|
929
|
+
- lib/fastly/models/enabled_product_response_service.rb
|
924
930
|
- lib/fastly/models/error_response.rb
|
925
931
|
- lib/fastly/models/error_response_data.rb
|
926
932
|
- lib/fastly/models/event.rb
|
@@ -929,8 +935,6 @@ files:
|
|
929
935
|
- lib/fastly/models/events_response.rb
|
930
936
|
- lib/fastly/models/events_response_all_of.rb
|
931
937
|
- lib/fastly/models/generic_token_error.rb
|
932
|
-
- lib/fastly/models/get_stores_response.rb
|
933
|
-
- lib/fastly/models/get_stores_response_meta.rb
|
934
938
|
- lib/fastly/models/gzip.rb
|
935
939
|
- lib/fastly/models/gzip_response.rb
|
936
940
|
- lib/fastly/models/header.rb
|
@@ -975,6 +979,11 @@ files:
|
|
975
979
|
- lib/fastly/models/inline_object1.rb
|
976
980
|
- lib/fastly/models/inline_response200.rb
|
977
981
|
- lib/fastly/models/inline_response2001.rb
|
982
|
+
- lib/fastly/models/inline_response2002.rb
|
983
|
+
- lib/fastly/models/inline_response2003.rb
|
984
|
+
- lib/fastly/models/inline_response2003_meta.rb
|
985
|
+
- lib/fastly/models/inline_response2004.rb
|
986
|
+
- lib/fastly/models/inline_response2004_meta.rb
|
978
987
|
- lib/fastly/models/invitation.rb
|
979
988
|
- lib/fastly/models/invitation_data.rb
|
980
989
|
- lib/fastly/models/invitation_data_attributes.rb
|
@@ -984,7 +993,6 @@ files:
|
|
984
993
|
- lib/fastly/models/invitation_response_data_all_of.rb
|
985
994
|
- lib/fastly/models/invitations_response.rb
|
986
995
|
- lib/fastly/models/invitations_response_all_of.rb
|
987
|
-
- lib/fastly/models/key_response.rb
|
988
996
|
- lib/fastly/models/logging_address_and_port.rb
|
989
997
|
- lib/fastly/models/logging_azureblob.rb
|
990
998
|
- lib/fastly/models/logging_azureblob_all_of.rb
|
@@ -1202,8 +1210,6 @@ files:
|
|
1202
1210
|
- lib/fastly/models/request_settings.rb
|
1203
1211
|
- lib/fastly/models/request_settings_response.rb
|
1204
1212
|
- lib/fastly/models/resource.rb
|
1205
|
-
- lib/fastly/models/resource_create.rb
|
1206
|
-
- lib/fastly/models/resource_create_all_of.rb
|
1207
1213
|
- lib/fastly/models/resource_response.rb
|
1208
1214
|
- lib/fastly/models/resource_response_all_of.rb
|
1209
1215
|
- lib/fastly/models/response_object.rb
|
data/docs/EnabledProduct.md
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
# Fastly::EnabledProduct
|
2
|
-
|
3
|
-
## Properties
|
4
|
-
|
5
|
-
| Name | Type | Description | Notes |
|
6
|
-
| ---- | ---- | ----------- | ----- |
|
7
|
-
| **product** | [**EnabledProductProduct**](EnabledProductProduct.md) | | [optional] |
|
8
|
-
| **service** | [**EnabledProductProduct**](EnabledProductProduct.md) | | [optional] |
|
9
|
-
| **_links** | [**EnabledProductLinks**](EnabledProductLinks.md) | | [optional] |
|
10
|
-
|
11
|
-
[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
|
12
|
-
|
data/docs/ResourceCreate.md
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
# Fastly::ResourceCreate
|
2
|
-
|
3
|
-
## Properties
|
4
|
-
|
5
|
-
| Name | Type | Description | Notes |
|
6
|
-
| ---- | ---- | ----------- | ----- |
|
7
|
-
| **name** | **String** | The name of the resource. | [optional] |
|
8
|
-
| **resource_id** | **String** | The ID of the linked resource. | [optional] |
|
9
|
-
|
10
|
-
[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
|
11
|
-
|
@@ -1,235 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#Fastly API
|
3
|
-
|
4
|
-
#Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://developer.fastly.com/reference/api/)
|
5
|
-
|
6
|
-
The version of the OpenAPI document: 1.0.0
|
7
|
-
Contact: oss@fastly.com
|
8
|
-
|
9
|
-
=end
|
10
|
-
|
11
|
-
require 'date'
|
12
|
-
require 'time'
|
13
|
-
|
14
|
-
module Fastly
|
15
|
-
class ResourceCreate
|
16
|
-
# The name of the resource.
|
17
|
-
attr_accessor :name
|
18
|
-
|
19
|
-
# The ID of the linked resource.
|
20
|
-
attr_accessor :resource_id
|
21
|
-
|
22
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
23
|
-
def self.attribute_map
|
24
|
-
{
|
25
|
-
:'name' => :'name',
|
26
|
-
:'resource_id' => :'resource_id'
|
27
|
-
}
|
28
|
-
end
|
29
|
-
|
30
|
-
# Returns all the JSON keys this model knows about
|
31
|
-
def self.acceptable_attributes
|
32
|
-
attribute_map.values
|
33
|
-
end
|
34
|
-
|
35
|
-
# Attribute type mapping.
|
36
|
-
def self.fastly_types
|
37
|
-
{
|
38
|
-
:'name' => :'String',
|
39
|
-
:'resource_id' => :'String'
|
40
|
-
}
|
41
|
-
end
|
42
|
-
|
43
|
-
# List of attributes with nullable: true
|
44
|
-
def self.fastly_nullable
|
45
|
-
Set.new([
|
46
|
-
])
|
47
|
-
end
|
48
|
-
|
49
|
-
# List of class defined in allOf (OpenAPI v3)
|
50
|
-
def self.fastly_all_of
|
51
|
-
[
|
52
|
-
:'Resource',
|
53
|
-
:'ResourceCreateAllOf'
|
54
|
-
]
|
55
|
-
end
|
56
|
-
|
57
|
-
# Initializes the object
|
58
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
59
|
-
def initialize(attributes = {})
|
60
|
-
if (!attributes.is_a?(Hash))
|
61
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::ResourceCreate` initialize method"
|
62
|
-
end
|
63
|
-
|
64
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
65
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
66
|
-
if (!self.class.attribute_map.key?(k.to_sym))
|
67
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::ResourceCreate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
68
|
-
end
|
69
|
-
h[k.to_sym] = v
|
70
|
-
}
|
71
|
-
|
72
|
-
if attributes.key?(:'name')
|
73
|
-
self.name = attributes[:'name']
|
74
|
-
end
|
75
|
-
|
76
|
-
if attributes.key?(:'resource_id')
|
77
|
-
self.resource_id = attributes[:'resource_id']
|
78
|
-
end
|
79
|
-
end
|
80
|
-
|
81
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
82
|
-
# @return Array for valid properties with the reasons
|
83
|
-
def list_invalid_properties
|
84
|
-
invalid_properties = Array.new
|
85
|
-
invalid_properties
|
86
|
-
end
|
87
|
-
|
88
|
-
# Check to see if the all the properties in the model are valid
|
89
|
-
# @return true if the model is valid
|
90
|
-
def valid?
|
91
|
-
true
|
92
|
-
end
|
93
|
-
|
94
|
-
# Checks equality by comparing each attribute.
|
95
|
-
# @param [Object] Object to be compared
|
96
|
-
def ==(o)
|
97
|
-
return true if self.equal?(o)
|
98
|
-
self.class == o.class &&
|
99
|
-
name == o.name &&
|
100
|
-
resource_id == o.resource_id
|
101
|
-
end
|
102
|
-
|
103
|
-
# @see the `==` method
|
104
|
-
# @param [Object] Object to be compared
|
105
|
-
def eql?(o)
|
106
|
-
self == o
|
107
|
-
end
|
108
|
-
|
109
|
-
# Calculates hash code according to all attributes.
|
110
|
-
# @return [Integer] Hash code
|
111
|
-
def hash
|
112
|
-
[name, resource_id].hash
|
113
|
-
end
|
114
|
-
|
115
|
-
# Builds the object from hash
|
116
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
117
|
-
# @return [Object] Returns the model itself
|
118
|
-
def self.build_from_hash(attributes)
|
119
|
-
new.build_from_hash(attributes)
|
120
|
-
end
|
121
|
-
|
122
|
-
# Builds the object from hash
|
123
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
124
|
-
# @return [Object] Returns the model itself
|
125
|
-
def build_from_hash(attributes)
|
126
|
-
return nil unless attributes.is_a?(Hash)
|
127
|
-
self.class.fastly_types.each_pair do |key, type|
|
128
|
-
if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
|
129
|
-
self.send("#{key}=", nil)
|
130
|
-
elsif type =~ /\AArray<(.*)>/i
|
131
|
-
# check to ensure the input is an array given that the attribute
|
132
|
-
# is documented as an array but the input is not
|
133
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
134
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
135
|
-
end
|
136
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
137
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
138
|
-
end
|
139
|
-
end
|
140
|
-
|
141
|
-
self
|
142
|
-
end
|
143
|
-
|
144
|
-
# Deserializes the data based on type
|
145
|
-
# @param string type Data type
|
146
|
-
# @param string value Value to be deserialized
|
147
|
-
# @return [Object] Deserialized data
|
148
|
-
def _deserialize(type, value)
|
149
|
-
case type.to_sym
|
150
|
-
when :Time
|
151
|
-
Time.parse(value)
|
152
|
-
when :Date
|
153
|
-
Date.parse(value)
|
154
|
-
when :String
|
155
|
-
value.to_s
|
156
|
-
when :Integer
|
157
|
-
value.to_i
|
158
|
-
when :Float
|
159
|
-
value.to_f
|
160
|
-
when :Boolean
|
161
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
162
|
-
true
|
163
|
-
else
|
164
|
-
false
|
165
|
-
end
|
166
|
-
when :Object
|
167
|
-
# generic object (usually a Hash), return directly
|
168
|
-
value
|
169
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
170
|
-
inner_type = Regexp.last_match[:inner_type]
|
171
|
-
value.map { |v| _deserialize(inner_type, v) }
|
172
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
173
|
-
k_type = Regexp.last_match[:k_type]
|
174
|
-
v_type = Regexp.last_match[:v_type]
|
175
|
-
{}.tap do |hash|
|
176
|
-
value.each do |k, v|
|
177
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
178
|
-
end
|
179
|
-
end
|
180
|
-
else # model
|
181
|
-
# models (e.g. Pet) or oneOf
|
182
|
-
klass = Fastly.const_get(type)
|
183
|
-
klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
184
|
-
end
|
185
|
-
end
|
186
|
-
|
187
|
-
# Returns the string representation of the object
|
188
|
-
# @return [String] String presentation of the object
|
189
|
-
def to_s
|
190
|
-
to_hash.to_s
|
191
|
-
end
|
192
|
-
|
193
|
-
# to_body is an alias to to_hash (backward compatibility)
|
194
|
-
# @return [Hash] Returns the object in the form of hash
|
195
|
-
def to_body
|
196
|
-
to_hash
|
197
|
-
end
|
198
|
-
|
199
|
-
# Returns the object in the form of hash
|
200
|
-
# @return [Hash] Returns the object in the form of hash
|
201
|
-
def to_hash
|
202
|
-
hash = {}
|
203
|
-
self.class.attribute_map.each_pair do |attr, param|
|
204
|
-
value = self.send(attr)
|
205
|
-
if value.nil?
|
206
|
-
is_nullable = self.class.fastly_nullable.include?(attr)
|
207
|
-
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
208
|
-
end
|
209
|
-
|
210
|
-
hash[param] = _to_hash(value)
|
211
|
-
end
|
212
|
-
hash
|
213
|
-
end
|
214
|
-
|
215
|
-
# Outputs non-array value in the form of hash
|
216
|
-
# For object, use to_hash. Otherwise, just return the value
|
217
|
-
# @param [Object] value Any valid value
|
218
|
-
# @return [Hash] Returns the value in the form of hash
|
219
|
-
def _to_hash(value)
|
220
|
-
if value.is_a?(Array)
|
221
|
-
value.compact.map { |v| _to_hash(v) }
|
222
|
-
elsif value.is_a?(Hash)
|
223
|
-
{}.tap do |hash|
|
224
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
225
|
-
end
|
226
|
-
elsif value.respond_to? :to_hash
|
227
|
-
value.to_hash
|
228
|
-
else
|
229
|
-
value
|
230
|
-
end
|
231
|
-
end
|
232
|
-
|
233
|
-
end
|
234
|
-
|
235
|
-
end
|