contentful-management 2.12.1 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 713c97cfc5294398f42d62da51db32197d2117fff66bc2161741b463593a56f0
4
- data.tar.gz: 78627973b71ab35edf5239e2d5c08ec90c752ff11fcf76966585715849a77d60
3
+ metadata.gz: caefa93b06c479fb9b2d87a27e7d360b7c7cbd87fd4d849f083486df39bb43de
4
+ data.tar.gz: '029cebff0c301345930e183480a6e24d54e4a778ad5b8afda88cd15a3abef9d2'
5
5
  SHA512:
6
- metadata.gz: '019005f468ed53914a758a7853e5f59535ec03c29a726d6fa8a678418cd42da3de6539d11db3426c03cf26d5cdd6c63bffbb3cd0b61aa4497466f82a5920c63d'
7
- data.tar.gz: 5f65e0d107b4b909ad7678bbd7e108f3a101e39daa9b5e698335ca9efc09860ff16a500fbf7dfd52e398d70c4d5fc745c059c0f1a5921fe0a5499a7c9c9f11a3
6
+ metadata.gz: 838ee33007dd1b5caa7777e08aaafc1fc0f4a5869772dcf7e7eaab781e41e45454f8a91d78799e283d028ad4ad290f4d989c450d293171fcc41b1b8b28f38fc4
7
+ data.tar.gz: 6986a8b83df08cbb573634c5c35697c8ecfee5e27bc4e759ab90335ce88dacbf14ba5303eed081cc00aaedffc30546ca7751de122ab17239b84a7d404d49678a
data/CHANGELOG.md CHANGED
@@ -2,6 +2,33 @@
2
2
 
3
3
  ## Master
4
4
 
5
+ ## 3.2.0
6
+ * Added support for parameters on Users API. [#227](https://github.com/contentful/contentful-management.rb/pull/227)
7
+
8
+ ## 3.1.0
9
+ ### Added
10
+ * Added read support for Users API.
11
+
12
+ ## 3.0.0
13
+ ### Fixed
14
+ * Added support for Tags metadata
15
+
16
+ ### Changed
17
+
18
+ **BREAKING CHANGES**:
19
+ * Introduction of new top-level tags `metadata` property in api response.
20
+
21
+ ## 2.13.1
22
+ ### Fixed
23
+ * Fixed an issue when loading entries or assets that included tags. [#219](https://github.com/contentful/contentful-management.rb/issues/219)
24
+
25
+ ## 2.13.0
26
+ ### Fixed
27
+ * Fixed a possible validation error when submitting a content type. [#218](https://github.com/contentful/contentful-management.rb/pull/218)
28
+
29
+ ### Added
30
+ * Added support for Users API. [#217](https://github.com/contentful/contentful-management.rb/pull/217)
31
+
5
32
  ## 2.12.1
6
33
 
7
34
  ### Fixed
data/README.md CHANGED
@@ -877,6 +877,30 @@ Retrieving current user details:
877
877
  user = client.users.me
878
878
  ```
879
879
 
880
+ Retrieving all users in organization:
881
+
882
+ ```ruby
883
+ user = organization.users.all
884
+ ```
885
+
886
+ Retrieving one user by ID from an organization:
887
+
888
+ ```ruby
889
+ user = organization.users.find('user_id')
890
+ ```
891
+
892
+ Retrieving all users in a space:
893
+
894
+ ```ruby
895
+ user = blog_space.users.all
896
+ ```
897
+
898
+ Retrieving one user by ID from the space:
899
+
900
+ ```ruby
901
+ user = blog_space.users.find('user_id')
902
+ ```
903
+
880
904
  ### UI Extensions
881
905
 
882
906
  Retrieving all UI extensions from the environment:
@@ -1,6 +1,7 @@
1
1
  require_relative 'resource'
2
2
  require_relative 'resource/fields'
3
3
  require_relative 'resource/archiver'
4
+ require_relative 'resource/metadata'
4
5
  require_relative 'resource/publisher'
5
6
  require_relative 'resource/asset_fields'
6
7
  require_relative 'resource/environment_aware'
@@ -15,6 +16,7 @@ module Contentful
15
16
  include Contentful::Management::Resource
16
17
  include Contentful::Management::Resource::Fields
17
18
  include Contentful::Management::Resource::Archiver
19
+ include Contentful::Management::Resource::Metadata
18
20
  include Contentful::Management::Resource::Refresher
19
21
  include Contentful::Management::Resource::Publisher
20
22
  include Contentful::Management::Resource::SystemProperties
@@ -1,6 +1,7 @@
1
1
  require_relative 'resource'
2
2
  require_relative 'resource/fields'
3
3
  require_relative 'resource/archiver'
4
+ require_relative 'resource/metadata'
4
5
  require_relative 'resource/publisher'
5
6
  require_relative 'resource_requester'
6
7
  require_relative 'resource/field_aware'
@@ -15,6 +16,7 @@ module Contentful
15
16
  # @see _ https://www.contentful.com/developers/documentation/content-management-api/#resources-entries
16
17
  class Entry
17
18
  include Contentful::Management::Resource
19
+ include Contentful::Management::Resource::Metadata
18
20
  extend Contentful::Management::Resource::EntryFields
19
21
  include Contentful::Management::Resource::SystemProperties
20
22
 
@@ -87,7 +87,9 @@ module Contentful
87
87
 
88
88
  def validations_to_hash(validations)
89
89
  validations.each_with_object([]) do |validation, results|
90
- results << validation.properties_to_hash
90
+ validation_hash = validation.properties_to_hash
91
+
92
+ results << validation.properties_to_hash if Field.value_exists?(validation_hash)
91
93
  end
92
94
  end
93
95
  end
@@ -1,4 +1,5 @@
1
1
  require_relative 'resource'
2
+ require 'contentful/management/organization_user_methods_factory'
2
3
 
3
4
  module Contentful
4
5
  module Management
@@ -31,6 +32,15 @@ module Contentful
31
32
  def space_periodic_usages
32
33
  ClientSpacePeriodicUsageMethodsFactory.new(client, id)
33
34
  end
35
+
36
+ # Allows viewing of users in context of an organization
37
+ # Allows listing all users for an organization, and finding one by ID.
38
+ # @see _ README for details.
39
+ #
40
+ # @return [Contentful::Management::OrganizationUserMethodsFactory]
41
+ def users
42
+ OrganizationUserMethodsFactory.new(client, id)
43
+ end
34
44
  end
35
45
  end
36
46
  end
@@ -0,0 +1,22 @@
1
+ module Contentful
2
+ module Management
3
+ # Wrapper for Users API for usage from within Organization
4
+ # @private
5
+ class OrganizationUserMethodsFactory
6
+ attr_reader :client
7
+
8
+ def initialize(client, organization_id)
9
+ @client = client
10
+ @organization_id = organization_id
11
+ end
12
+
13
+ def find(id)
14
+ User.find(client, nil, nil, id, @organization_id)
15
+ end
16
+
17
+ def all(params = {})
18
+ User.all(client, nil, nil, params, @organization_id)
19
+ end
20
+ end
21
+ end
22
+ end
@@ -226,8 +226,10 @@ module Contentful
226
226
  # @see _ For complete option list: https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters
227
227
  #
228
228
  # @return [Contentful::Management::Array<Contentful::Management::Resource>]
229
- def all(client, space_id, environment_id = nil, parameters = {})
230
- ResourceRequester.new(client, self).all({ space_id: space_id, environment_id: environment_id }, parameters)
229
+ def all(client, space_id, environment_id = nil, parameters = {}, organization_id = nil)
230
+ ResourceRequester.new(client, self).all(
231
+ { space_id: space_id, environment_id: environment_id, organization_id: organization_id }, parameters
232
+ )
231
233
  end
232
234
 
233
235
  # Gets a specific resource.
@@ -237,8 +239,9 @@ module Contentful
237
239
  # @param [String] resource_id
238
240
  #
239
241
  # @return [Contentful::Management::Resource]
240
- def find(client, space_id, environment_id = nil, resource_id = nil)
241
- ResourceRequester.new(client, self).find(space_id: space_id, environment_id: environment_id, resource_id: resource_id)
242
+ def find(client, space_id, environment_id = nil, resource_id = nil, organization_id = nil)
243
+ ResourceRequester.new(client, self).find(space_id: space_id, environment_id: environment_id,
244
+ resource_id: resource_id, organization_id: organization_id)
242
245
  end
243
246
 
244
247
  # Creates a resource.
@@ -0,0 +1,44 @@
1
+ module Contentful
2
+ module Management
3
+ module Resource
4
+ # Adds metadata logic for [Resource] classes
5
+ module Metadata
6
+ # Returns the metadata hash
7
+ attr_reader :_metadata
8
+
9
+ # @private
10
+ def initialize(object = nil, *)
11
+ super
12
+ @_metadata = {}
13
+ extract_metadata_from_object! object if object
14
+ end
15
+
16
+ # @private
17
+ def inspect(info = nil)
18
+ if _metadata.empty?
19
+ super(info)
20
+ else
21
+ super("#{info} @_metadata=#{_metadata.inspect}")
22
+ end
23
+ end
24
+
25
+ private
26
+
27
+ def extract_metadata_from_object!(object)
28
+ return unless object.key?('metadata')
29
+ object['metadata'].each do |key, value|
30
+ @_metadata[key.to_sym] = if key == 'tags'
31
+ coerce_tags(value)
32
+ else
33
+ value
34
+ end
35
+ end
36
+ end
37
+
38
+ def coerce_tags(tags)
39
+ tags.map { |tag| Contentful::Management::Link.new(tag) }
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
@@ -1,3 +1,4 @@
1
+ require_relative 'tag'
1
2
  require_relative 'link'
2
3
  require_relative 'user'
3
4
  require_relative 'role'
@@ -58,7 +59,8 @@ module Contentful
58
59
  'Extension' => Contentful::Management::UIExtension,
59
60
  'EditorInterface' => Contentful::Management::EditorInterface,
60
61
  'Snapshot' => Contentful::Management::Snapshot,
61
- 'Upload' => Contentful::Management::Upload
62
+ 'Upload' => Contentful::Management::Upload,
63
+ 'Tag' => Contentful::Management::Tag
62
64
  }.freeze
63
65
 
64
66
  # Default Entry Mapping
@@ -214,7 +216,7 @@ module Contentful
214
216
  detect_child_objects(potential_objects).each do |child_name, child_object|
215
217
  res.public_send(name)[child_name.to_sym] = create_resource(child_object)
216
218
  end
217
- next if name == 'includes'
219
+ next if %w[includes metadata].include?(name)
218
220
  detect_child_arrays(potential_objects).each do |child_name, _child_array|
219
221
  replace_child_array res.public_send(name)[child_name.to_sym]
220
222
  end
@@ -6,6 +6,7 @@ require_relative 'resource'
6
6
  require_relative 'environment'
7
7
  require_relative 'space_membership'
8
8
  require_relative 'space_role_methods_factory'
9
+ require_relative 'space_user_methods_factory'
9
10
  require_relative 'space_webhook_methods_factory'
10
11
  require_relative 'space_api_key_methods_factory'
11
12
  require_relative 'space_environment_methods_factory'
@@ -155,6 +156,15 @@ module Contentful
155
156
  SpaceRoleMethodsFactory.new(self)
156
157
  end
157
158
 
159
+ # Allows viewing of users in context of the current space
160
+ # Allows listing all users of space, and finding one by ID.
161
+ # @see _ README for details.
162
+ #
163
+ # @return [Contentful::Management::SpaceUserMethodsFactory]
164
+ def users
165
+ SpaceUserMethodsFactory.new(self)
166
+ end
167
+
158
168
  # Allows manipulation of webhooks in context of the current space
159
169
  # Allows listing all webhooks for space and finding one by ID.
160
170
  # @see _ README for details.
@@ -0,0 +1,23 @@
1
+ require_relative 'space_association_methods_factory'
2
+
3
+ module Contentful
4
+ module Management
5
+ # Wrapper for User API for usage from within Space
6
+ # @private
7
+ class SpaceUserMethodsFactory
8
+ attr_reader :space
9
+
10
+ def initialize(space)
11
+ @space = space
12
+ end
13
+
14
+ def find(id)
15
+ User.find(space.client, space.id, nil, id)
16
+ end
17
+
18
+ def all(params = {})
19
+ User.all(space.client, space.id, nil, params, nil)
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,14 @@
1
+ require_relative 'resource'
2
+
3
+ module Contentful
4
+ module Management
5
+ # Resource Class for Tags
6
+ # https://www.contentful.com/developers/docs/references/content-management-api/#/reference/content-tags
7
+ class Tag
8
+ include Contentful::Management::Resource
9
+ include Contentful::Management::Resource::SystemProperties
10
+
11
+ property :name
12
+ end
13
+ end
14
+ end
@@ -19,7 +19,13 @@ module Contentful
19
19
 
20
20
  # @private
21
21
  def self.build_endpoint(endpoint_options)
22
- endpoint = 'users'
22
+ endpoint = if endpoint_options[:space_id]
23
+ "spaces/#{endpoint_options[:space_id]}/users"
24
+ elsif endpoint_options[:organization_id]
25
+ "organizations/#{endpoint_options[:organization_id]}/users"
26
+ else
27
+ 'users'
28
+ end
23
29
  endpoint = "#{endpoint}/#{endpoint_options[:resource_id]}" if endpoint_options[:resource_id]
24
30
  endpoint
25
31
  end
@@ -3,6 +3,6 @@ module Contentful
3
3
  # Management Namespace
4
4
  module Management
5
5
  # Gem Version
6
- VERSION = '2.12.1'.freeze
6
+ VERSION = '3.2.0'.freeze
7
7
  end
8
8
  end
@@ -0,0 +1,442 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.contentful.com/spaces/2l3j7k267g9k
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ X-Contentful-User-Agent:
11
+ - sdk contentful-management.rb/2.13.0; platform ruby/2.6.3; os macOS/18;
12
+ Authorization:
13
+ - Bearer <ACCESS_TOKEN>
14
+ Content-Type:
15
+ - application/vnd.contentful.management.v1+json
16
+ Connection:
17
+ - close
18
+ Host:
19
+ - api.contentful.com
20
+ User-Agent:
21
+ - http.rb/4.4.1
22
+ response:
23
+ status:
24
+ code: 200
25
+ message: OK
26
+ headers:
27
+ Accept-Ranges:
28
+ - bytes
29
+ Access-Control-Allow-Headers:
30
+ - Accept,Accept-Language,Authorization,Cache-Control,Content-Length,Content-Range,Content-Type,DNT,Destination,Expires,If-Match,If-Modified-Since,If-None-Match,Keep-Alive,Last-Modified,Origin,Pragma,Range,User-Agent,X-Http-Method-Override,X-Mx-ReqToken,X-Requested-With,X-Contentful-Version,X-Contentful-Content-Type,X-Contentful-Organization,X-Contentful-Skip-Transformation,X-Contentful-User-Agent,X-Contentful-Enable-Alpha-Feature,X-Contentful-Source-Environment,X-Contentful-Team,X-Contentful-Parent-Id,x-contentful-validate-only,X-Contentful-Skip-UI-Draft-Validation,X-Contentful-Marketplace,X-Contentful-UI-Content-Auto-Save,cf-trace
31
+ Access-Control-Allow-Methods:
32
+ - DELETE,GET,HEAD,POST,PUT,PATCH,OPTIONS
33
+ Access-Control-Allow-Origin:
34
+ - "*"
35
+ Access-Control-Expose-Headers:
36
+ - Etag
37
+ Access-Control-Max-Age:
38
+ - '1728000'
39
+ Cache-Control:
40
+ - no-store
41
+ Cf-Organization-Id:
42
+ - 1VcAE6naLx3WZBNNUIMMZE
43
+ Cf-Space-Id:
44
+ - 2l3j7k267g9k
45
+ Content-Type:
46
+ - application/vnd.contentful.management.v1+json
47
+ Contentful-Api:
48
+ - cma
49
+ Date:
50
+ - Thu, 07 Jan 2021 11:06:34 GMT
51
+ Etag:
52
+ - W/"659d95ef36a17e58e2737034fa6383c8"
53
+ Referrer-Policy:
54
+ - strict-origin-when-cross-origin
55
+ Server:
56
+ - Contentful
57
+ Strict-Transport-Security:
58
+ - max-age=15768000
59
+ X-Content-Type-Options:
60
+ - nosniff
61
+ X-Contentful-Ratelimit-Hour-Limit:
62
+ - '36000'
63
+ X-Contentful-Ratelimit-Hour-Remaining:
64
+ - '35999'
65
+ X-Contentful-Ratelimit-Reset:
66
+ - '0'
67
+ X-Contentful-Ratelimit-Second-Limit:
68
+ - '10'
69
+ X-Contentful-Ratelimit-Second-Remaining:
70
+ - '9'
71
+ X-Contentful-Request-Id:
72
+ - ec8d18ce16f490826aa9fad2da805fab
73
+ X-Contentful-Route:
74
+ - "/spaces/:id"
75
+ X-Download-Options:
76
+ - noopen
77
+ X-Frame-Options:
78
+ - ALLOWALL
79
+ X-Permitted-Cross-Domain-Policies:
80
+ - none
81
+ X-Xss-Protection:
82
+ - 1; mode=block
83
+ Content-Length:
84
+ - '615'
85
+ Connection:
86
+ - Close
87
+ Set-Cookie:
88
+ - incap_ses_1209_673446=YVZmXgaaL1nUoYajdzvHEDnr9l8AAAAA9AANvTqheZgll2XY47/SVw==;
89
+ path=/; Domain=.contentful.com
90
+ - nlbi_673446=TEfpMs2gcV4tuBwBKsJtVwAAAADqY9XHcdiGX3TdLGbT6y5/; path=/; Domain=.contentful.com
91
+ - visid_incap_673446=Tu9GqOaLRImlZ3thm9+RNznr9l8AAAAAQUIPAAAAAAA1c9Y1VFXr0Jkj3riEyjEx;
92
+ expires=Fri, 07 Jan 2022 10:05:00 GMT; HttpOnly; path=/; Domain=.contentful.com
93
+ X-Cdn:
94
+ - Incapsula
95
+ X-Iinfo:
96
+ - 6-1974143-1974145 NNNN CT(159 160 0) RT(1610017593403 47) q(0 0 3 -1) r(5
97
+ 5) U5
98
+ body:
99
+ encoding: ASCII-8BIT
100
+ string: |+
101
+ {
102
+ "name":"Colorful-Demo-Dev-workflow",
103
+ "sys":{
104
+ "type":"Space",
105
+ "id":"2l3j7k267g9k",
106
+ "version":3,
107
+ "createdBy":{
108
+ "sys":{
109
+ "type":"Link",
110
+ "linkType":"User",
111
+ "id":"0PCYk22mt1xD7gTKZhHycN"
112
+ }
113
+ },
114
+ "createdAt":"2019-09-09T14:37:05Z",
115
+ "updatedBy":{
116
+ "sys":{
117
+ "type":"Link",
118
+ "linkType":"User",
119
+ "id":"0PCYk22mt1xD7gTKZhHycN"
120
+ }
121
+ },
122
+ "updatedAt":"2019-10-25T15:17:48Z",
123
+ "organization":{
124
+ "sys":{
125
+ "type":"Link",
126
+ "linkType":"Organization",
127
+ "id":"1VcAE6naLx3WZBNNUIMMZE"
128
+ }
129
+ }
130
+ }
131
+ }
132
+
133
+ http_version:
134
+ recorded_at: Thu, 07 Jan 2021 11:06:32 GMT
135
+ - request:
136
+ method: get
137
+ uri: https://api.contentful.com/spaces/2l3j7k267g9k/environments/master
138
+ body:
139
+ encoding: UTF-8
140
+ string: ''
141
+ headers:
142
+ X-Contentful-User-Agent:
143
+ - sdk contentful-management.rb/2.13.0; platform ruby/2.6.3; os macOS/18;
144
+ Authorization:
145
+ - Bearer <ACCESS_TOKEN>
146
+ Content-Type:
147
+ - application/vnd.contentful.management.v1+json
148
+ Connection:
149
+ - close
150
+ Host:
151
+ - api.contentful.com
152
+ User-Agent:
153
+ - http.rb/4.4.1
154
+ response:
155
+ status:
156
+ code: 200
157
+ message: OK
158
+ headers:
159
+ Accept-Ranges:
160
+ - bytes
161
+ Access-Control-Allow-Headers:
162
+ - Accept,Accept-Language,Authorization,Cache-Control,Content-Length,Content-Range,Content-Type,DNT,Destination,Expires,If-Match,If-Modified-Since,If-None-Match,Keep-Alive,Last-Modified,Origin,Pragma,Range,User-Agent,X-Http-Method-Override,X-Mx-ReqToken,X-Requested-With,X-Contentful-Version,X-Contentful-Content-Type,X-Contentful-Organization,X-Contentful-Skip-Transformation,X-Contentful-User-Agent,X-Contentful-Enable-Alpha-Feature,X-Contentful-Source-Environment,X-Contentful-Team,X-Contentful-Parent-Id,x-contentful-validate-only,X-Contentful-Skip-UI-Draft-Validation,X-Contentful-Marketplace,X-Contentful-UI-Content-Auto-Save,cf-trace
163
+ Access-Control-Allow-Methods:
164
+ - DELETE,GET,HEAD,POST,PUT,PATCH,OPTIONS
165
+ Access-Control-Allow-Origin:
166
+ - "*"
167
+ Access-Control-Expose-Headers:
168
+ - Etag
169
+ Access-Control-Max-Age:
170
+ - '1728000'
171
+ Cache-Control:
172
+ - no-store
173
+ Cf-Organization-Id:
174
+ - 1VcAE6naLx3WZBNNUIMMZE
175
+ Cf-Space-Id:
176
+ - 2l3j7k267g9k
177
+ Content-Type:
178
+ - application/vnd.contentful.management.v1+json
179
+ Contentful-Api:
180
+ - cma
181
+ Date:
182
+ - Thu, 07 Jan 2021 11:06:34 GMT
183
+ Etag:
184
+ - W/"901485ea9ca14612f2a5764df6b0fc04"
185
+ Referrer-Policy:
186
+ - strict-origin-when-cross-origin
187
+ Server:
188
+ - Contentful
189
+ Strict-Transport-Security:
190
+ - max-age=15768000
191
+ X-Content-Type-Options:
192
+ - nosniff
193
+ X-Contentful-Ratelimit-Hour-Limit:
194
+ - '36000'
195
+ X-Contentful-Ratelimit-Hour-Remaining:
196
+ - '35998'
197
+ X-Contentful-Ratelimit-Reset:
198
+ - '0'
199
+ X-Contentful-Ratelimit-Second-Limit:
200
+ - '10'
201
+ X-Contentful-Ratelimit-Second-Remaining:
202
+ - '8'
203
+ X-Contentful-Request-Id:
204
+ - 9b6794c810697dd6efc6303e4e8ef4d9
205
+ X-Contentful-Route:
206
+ - "/spaces/:space_id/environments/:id"
207
+ X-Download-Options:
208
+ - noopen
209
+ X-Frame-Options:
210
+ - ALLOWALL
211
+ X-Permitted-Cross-Domain-Policies:
212
+ - none
213
+ X-Xss-Protection:
214
+ - 1; mode=block
215
+ Content-Length:
216
+ - '827'
217
+ Connection:
218
+ - Close
219
+ Set-Cookie:
220
+ - incap_ses_1209_673446=Y2ykEEBgTnreoYajdzvHEDrr9l8AAAAAkviSHB+2OK8NcHzKUeC0Wg==;
221
+ path=/; Domain=.contentful.com
222
+ - nlbi_673446=t9IxdbWZoBXar3EkKsJtVwAAAACJnZFzX6lnLUI0ElgfMeWH; path=/; Domain=.contentful.com
223
+ - visid_incap_673446=CY/ac4UKQqSGiRg3sUKObDrr9l8AAAAAQUIPAAAAAADMHW0fGxjNQm6BtzVzbNhH;
224
+ expires=Fri, 07 Jan 2022 10:05:05 GMT; HttpOnly; path=/; Domain=.contentful.com
225
+ X-Cdn:
226
+ - Incapsula
227
+ X-Iinfo:
228
+ - 2-1495637-1495638 NNNY CT(0 0 0) RT(1610017594007 44) q(0 0 0 -1) r(2 2) U5
229
+ body:
230
+ encoding: ASCII-8BIT
231
+ string: |+
232
+ {
233
+ "name":"backup-1",
234
+ "sys":{
235
+ "type":"Environment",
236
+ "id":"master",
237
+ "aliasedEnvironment":{
238
+ "sys":{
239
+ "type":"Link",
240
+ "linkType":"Environment",
241
+ "id":"backup-1"
242
+ }
243
+ },
244
+ "version":3,
245
+ "space":{
246
+ "sys":{
247
+ "type":"Link",
248
+ "linkType":"Space",
249
+ "id":"2l3j7k267g9k"
250
+ }
251
+ },
252
+ "status":{
253
+ "sys":{
254
+ "type":"Link",
255
+ "linkType":"Status",
256
+ "id":"ready"
257
+ }
258
+ },
259
+ "createdBy":{
260
+ "sys":{
261
+ "type":"Link",
262
+ "linkType":"User",
263
+ "id":"6c10tlsIDlE3qvnNoTwYa5"
264
+ }
265
+ },
266
+ "createdAt":"2020-10-05T14:36:26Z",
267
+ "updatedBy":{
268
+ "sys":{
269
+ "type":"Link",
270
+ "linkType":"User",
271
+ "id":"6c10tlsIDlE3qvnNoTwYa5"
272
+ }
273
+ },
274
+ "updatedAt":"2020-10-05T14:36:30Z"
275
+ }
276
+ }
277
+
278
+ http_version:
279
+ recorded_at: Thu, 07 Jan 2021 11:06:32 GMT
280
+ - request:
281
+ method: get
282
+ uri: https://api.contentful.com/spaces/2l3j7k267g9k/environments/master/assets/2lxYoWv3LWHe0yhO3w2Yid
283
+ body:
284
+ encoding: UTF-8
285
+ string: ''
286
+ headers:
287
+ X-Contentful-User-Agent:
288
+ - sdk contentful-management.rb/2.13.0; platform ruby/2.6.3; os macOS/18;
289
+ Authorization:
290
+ - Bearer <ACCESS_TOKEN>
291
+ Content-Type:
292
+ - application/vnd.contentful.management.v1+json
293
+ Connection:
294
+ - close
295
+ Host:
296
+ - api.contentful.com
297
+ User-Agent:
298
+ - http.rb/4.4.1
299
+ response:
300
+ status:
301
+ code: 200
302
+ message: OK
303
+ headers:
304
+ Access-Control-Allow-Headers:
305
+ - Accept,Accept-Language,Authorization,Cache-Control,Content-Length,Content-Range,Content-Type,DNT,Destination,Expires,If-Match,If-Modified-Since,If-None-Match,Keep-Alive,Last-Modified,Origin,Pragma,Range,User-Agent,X-Http-Method-Override,X-Mx-ReqToken,X-Requested-With,X-Contentful-Version,X-Contentful-Content-Type,X-Contentful-Organization,X-Contentful-Skip-Transformation,X-Contentful-User-Agent,X-Contentful-Enable-Alpha-Feature,X-Contentful-Source-Environment,X-Contentful-Team,X-Contentful-Parent-Id,x-contentful-validate-only,X-Contentful-Skip-UI-Draft-Validation,X-Contentful-Marketplace,X-Contentful-UI-Content-Auto-Save,cf-trace
306
+ Access-Control-Allow-Methods:
307
+ - DELETE,GET,HEAD,POST,PUT,PATCH,OPTIONS
308
+ Access-Control-Allow-Origin:
309
+ - "*"
310
+ Access-Control-Expose-Headers:
311
+ - Etag
312
+ Access-Control-Max-Age:
313
+ - '1728000'
314
+ Cache-Control:
315
+ - no-store
316
+ Cf-Environment-Id:
317
+ - master
318
+ Cf-Environment-Uuid:
319
+ - master
320
+ Cf-Space-Id:
321
+ - 2l3j7k267g9k
322
+ Content-Type:
323
+ - application/vnd.contentful.management.v1+json
324
+ Contentful-Api:
325
+ - cma
326
+ Date:
327
+ - Thu, 07 Jan 2021 11:06:35 GMT
328
+ Etag:
329
+ - '"8117790482973496674"'
330
+ Server:
331
+ - Contentful
332
+ Strict-Transport-Security:
333
+ - max-age=15768000
334
+ X-Content-Type-Options:
335
+ - nosniff
336
+ X-Contentful-Ratelimit-Hour-Limit:
337
+ - '36000'
338
+ X-Contentful-Ratelimit-Hour-Remaining:
339
+ - '35997'
340
+ X-Contentful-Ratelimit-Reset:
341
+ - '0'
342
+ X-Contentful-Ratelimit-Second-Limit:
343
+ - '10'
344
+ X-Contentful-Ratelimit-Second-Remaining:
345
+ - '7'
346
+ X-Contentful-Request-Id:
347
+ - e9987a6feedac9d160825158388850fe
348
+ X-Contentful-Route:
349
+ - "/spaces/:space/environments/:environment/assets/:id"
350
+ Content-Length:
351
+ - '1517'
352
+ Connection:
353
+ - Close
354
+ Set-Cookie:
355
+ - incap_ses_1209_673446=dVwret9u1XPsoYajdzvHEDvr9l8AAAAATsuve5Yp0rNFifAENHDQWg==;
356
+ path=/; Domain=.contentful.com
357
+ - nlbi_673446=0tHYcaIMu2YAHvPnKsJtVwAAAAB0aM8FkVVYSdZiiR9Cm87x; path=/; Domain=.contentful.com
358
+ - visid_incap_673446=q/YtdCgUTpKLYpGlrXXQ/Tvr9l8AAAAAQUIPAAAAAADMMMF1cxU9/9X4djNOAm0R;
359
+ expires=Fri, 07 Jan 2022 10:05:05 GMT; HttpOnly; path=/; Domain=.contentful.com
360
+ X-Cdn:
361
+ - Incapsula
362
+ X-Iinfo:
363
+ - 5-4907447-4907449 NNNN CT(164 163 0) RT(1610017594299 46) q(0 0 3 -1) r(7
364
+ 7) U5
365
+ body:
366
+ encoding: ASCII-8BIT
367
+ string: |
368
+ {
369
+ "metadata": {
370
+ "tags": [
371
+ {
372
+ "sys": {
373
+ "type": "Link",
374
+ "linkType": "Tag",
375
+ "id": "mobQa"
376
+ }
377
+ }
378
+ ]
379
+ },
380
+ "sys": {
381
+ "space": {
382
+ "sys": {
383
+ "type": "Link",
384
+ "linkType": "Space",
385
+ "id": "2l3j7k267g9k"
386
+ }
387
+ },
388
+ "id": "2lxYoWv3LWHe0yhO3w2Yid",
389
+ "type": "Asset",
390
+ "createdAt": "2019-09-09T14:43:26.287Z",
391
+ "updatedAt": "2020-11-23T14:38:46.698Z",
392
+ "environment": {
393
+ "sys": {
394
+ "id": "master",
395
+ "type": "Link",
396
+ "linkType": "Environment"
397
+ }
398
+ },
399
+ "firstPublishedAt": "2019-09-09T14:52:29.719Z",
400
+ "createdBy": {
401
+ "sys": {
402
+ "type": "Link",
403
+ "linkType": "User",
404
+ "id": "0PCYk22mt1xD7gTKZhHycN"
405
+ }
406
+ },
407
+ "updatedBy": {
408
+ "sys": {
409
+ "type": "Link",
410
+ "linkType": "User",
411
+ "id": "2tk1qOdVUXzixfz5dsanLT"
412
+ }
413
+ },
414
+ "publishedCounter": 4,
415
+ "version": 14
416
+ },
417
+ "fields": {
418
+ "title": {
419
+ "en-US": "Berlin skyline"
420
+ },
421
+ "description": {
422
+ "en-US": "changed"
423
+ },
424
+ "file": {
425
+ "en-US": {
426
+ "url": "//images.ctfassets.net/2l3j7k267g9k/2lxYoWv3LWHe0yhO3w2Yid/c6df694a8607018926bfd2fe32fe9b88/photo-1532978794596-d56d649a0493",
427
+ "details": {
428
+ "size": 571480,
429
+ "image": {
430
+ "width": 2550,
431
+ "height": 1700
432
+ }
433
+ },
434
+ "fileName": "photo-1532978794596-d56d649a0493",
435
+ "contentType": "image/jpeg"
436
+ }
437
+ }
438
+ }
439
+ }
440
+ http_version:
441
+ recorded_at: Thu, 07 Jan 2021 11:06:33 GMT
442
+ recorded_with: VCR 4.0.0