contentful-management 3.10.1 → 3.12.0

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 (41) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/codeql.yml +32 -0
  3. data/CHANGELOG.md +6 -0
  4. data/README.md +127 -1
  5. data/lib/contentful/management/client.rb +27 -0
  6. data/lib/contentful/management/client_taxonomy_concept_methods_factory.rb +34 -0
  7. data/lib/contentful/management/client_taxonomy_concept_scheme_methods_factory.rb +34 -0
  8. data/lib/contentful/management/content_type.rb +3 -0
  9. data/lib/contentful/management/editor_interface.rb +7 -2
  10. data/lib/contentful/management/resource/metadata.rb +8 -1
  11. data/lib/contentful/management/resource_builder.rb +5 -1
  12. data/lib/contentful/management/resource_requester.rb +11 -0
  13. data/lib/contentful/management/taxonomy_concept.rb +144 -0
  14. data/lib/contentful/management/taxonomy_concept_scheme.rb +108 -0
  15. data/lib/contentful/management/version.rb +1 -1
  16. data/spec/fixtures/vcr_cassettes/asset/update_with_concepts.yml +137 -0
  17. data/spec/fixtures/vcr_cassettes/content_type/update_with_metadata.yml +171 -0
  18. data/spec/fixtures/vcr_cassettes/editor_interfaces/all.yml +85 -0
  19. data/spec/fixtures/vcr_cassettes/entry/update_with_concepts.yml +182 -0
  20. data/spec/fixtures/vcr_cassettes/taxonomy_concept/all.yml +83 -0
  21. data/spec/fixtures/vcr_cassettes/taxonomy_concept/ancestors.yml +155 -0
  22. data/spec/fixtures/vcr_cassettes/taxonomy_concept/create.yml +77 -0
  23. data/spec/fixtures/vcr_cassettes/taxonomy_concept/create_with_id.yml +78 -0
  24. data/spec/fixtures/vcr_cassettes/taxonomy_concept/descendants.yml +153 -0
  25. data/spec/fixtures/vcr_cassettes/taxonomy_concept/destroy.yml +152 -0
  26. data/spec/fixtures/vcr_cassettes/taxonomy_concept/find.yml +79 -0
  27. data/spec/fixtures/vcr_cassettes/taxonomy_concept/total.yml +77 -0
  28. data/spec/fixtures/vcr_cassettes/taxonomy_concept/update.yml +158 -0
  29. data/spec/fixtures/vcr_cassettes/taxonomy_concept_scheme/all.yml +80 -0
  30. data/spec/fixtures/vcr_cassettes/taxonomy_concept_scheme/create.yml +78 -0
  31. data/spec/fixtures/vcr_cassettes/taxonomy_concept_scheme/destroy.yml +150 -0
  32. data/spec/fixtures/vcr_cassettes/taxonomy_concept_scheme/find.yml +78 -0
  33. data/spec/fixtures/vcr_cassettes/taxonomy_concept_scheme/total.yml +77 -0
  34. data/spec/fixtures/vcr_cassettes/taxonomy_concept_scheme/update.yml +155 -0
  35. data/spec/lib/contentful/management/asset_spec.rb +20 -0
  36. data/spec/lib/contentful/management/content_type_spec.rb +22 -0
  37. data/spec/lib/contentful/management/editor_interface_spec.rb +9 -0
  38. data/spec/lib/contentful/management/entry_spec.rb +22 -1
  39. data/spec/lib/contentful/management/taxonomy_concept_scheme_spec.rb +85 -0
  40. data/spec/lib/contentful/management/taxonomy_concept_spec.rb +116 -0
  41. metadata +48 -1
@@ -0,0 +1,150 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.contentful.com/organizations/4kQeJmhUWIKtNNmMkketza/taxonomy/concept-schemes/2hNivoHTKM4MbTM4519T5E
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ X-Contentful-User-Agent:
11
+ - sdk contentful-management.rb/3.11.0; platform ruby/3.4.3; os macOS/24;
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/5.0.1
22
+ response:
23
+ status:
24
+ code: 200
25
+ message: OK
26
+ headers:
27
+ Connection:
28
+ - close
29
+ Content-Length:
30
+ - '619'
31
+ Content-Type:
32
+ - application/json; charset=utf-8
33
+ X-Contentful-Ratelimit-Hour-Remaining:
34
+ - '35999'
35
+ X-Contentful-Ratelimit-Second-Remaining:
36
+ - '9'
37
+ X-Contentful-Ratelimit-Hour-Limit:
38
+ - '36000'
39
+ X-Contentful-Ratelimit-Second-Limit:
40
+ - '10'
41
+ X-Contentful-Ratelimit-Reset:
42
+ - '0'
43
+ X-Contentful-Route:
44
+ - "/organizations/:organizationId/taxonomy/concept-schemes/:id"
45
+ Cache-Control:
46
+ - no-cache
47
+ Accept-Ranges:
48
+ - bytes
49
+ X-Content-Type-Options:
50
+ - nosniff
51
+ Server:
52
+ - Contentful
53
+ Contentful-Api:
54
+ - cma
55
+ Contentful-Upstream:
56
+ - taxonomy-service
57
+ Access-Control-Allow-Origin:
58
+ - "*"
59
+ Access-Control-Allow-Headers:
60
+ - Accept,Accept-Language,Authorization,Cache-Control,CF-Context,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-Tag-Visibility,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,X-Contentful-Comment-Body-Format,X-Contentful-Parent-Entity-Reference,X-Contentful-Include-Invocation-Metadata,X-Contentful-Async-Ai-Action,x-contentful-ai-actions-platform
61
+ Access-Control-Expose-Headers:
62
+ - Etag,x-contentful-request-id,x-contentful-ai-actions-ratelimit-reset
63
+ Access-Control-Allow-Methods:
64
+ - DELETE,GET,HEAD,POST,PUT,PATCH,OPTIONS
65
+ Access-Control-Max-Age:
66
+ - '1728000'
67
+ Date:
68
+ - Wed, 22 Oct 2025 13:12:46 GMT
69
+ X-Contentful-Request-Id:
70
+ - 5ce15cb2-4712-4964-8418-fc7c021ab50a
71
+ Strict-Transport-Security:
72
+ - max-age=15768000
73
+ body:
74
+ encoding: UTF-8
75
+ string: '{"sys":{"id":"2hNivoHTKM4MbTM4519T5E","type":"TaxonomyConceptScheme","createdAt":"2025-09-14T06:37:32.431Z","updatedAt":"2025-10-22T13:10:46.957Z","organization":{"sys":{"id":"4kQeJmhUWIKtNNmMkketza","type":"Link","linkType":"Organization"}},"createdBy":{"sys":{"id":"59Erm8D1JuuD273aXNb65T","type":"Link","linkType":"User"}},"updatedBy":{"sys":{"id":"59Erm8D1JuuD273aXNb65T","type":"Link","linkType":"User"}},"version":4},"uri":null,"topConcepts":[],"concepts":[{"sys":{"id":"greenSofas","type":"Link","linkType":"TaxonomyConcept"}}],"totalConcepts":1,"prefLabel":{"en-US":"New
76
+ Scheme Name"},"definition":{"en-US":""}}'
77
+ recorded_at: Wed, 22 Oct 2025 13:12:46 GMT
78
+ - request:
79
+ method: delete
80
+ uri: https://api.contentful.com/organizations/4kQeJmhUWIKtNNmMkketza/taxonomy/concept-schemes/2hNivoHTKM4MbTM4519T5E
81
+ body:
82
+ encoding: UTF-8
83
+ string: ''
84
+ headers:
85
+ X-Contentful-User-Agent:
86
+ - sdk contentful-management.rb/3.11.0; platform ruby/3.4.3; os macOS/24;
87
+ Authorization:
88
+ - Bearer <ACCESS_TOKEN>
89
+ Content-Type:
90
+ - application/vnd.contentful.management.v1+json
91
+ X-Contentful-Version:
92
+ - '4'
93
+ Connection:
94
+ - close
95
+ Host:
96
+ - api.contentful.com
97
+ User-Agent:
98
+ - http.rb/5.0.1
99
+ response:
100
+ status:
101
+ code: 204
102
+ message: No Content
103
+ headers:
104
+ Connection:
105
+ - close
106
+ X-Contentful-Ratelimit-Hour-Remaining:
107
+ - '35998'
108
+ X-Contentful-Ratelimit-Second-Remaining:
109
+ - '8'
110
+ X-Contentful-Ratelimit-Hour-Limit:
111
+ - '36000'
112
+ X-Contentful-Ratelimit-Second-Limit:
113
+ - '10'
114
+ X-Contentful-Ratelimit-Reset:
115
+ - '0'
116
+ X-Contentful-Route:
117
+ - "/organizations/:organizationId/taxonomy/concept-schemes/:id"
118
+ Cache-Control:
119
+ - no-cache
120
+ X-Content-Type-Options:
121
+ - nosniff
122
+ Server:
123
+ - Contentful
124
+ Contentful-Api:
125
+ - cma
126
+ Contentful-Upstream:
127
+ - taxonomy-service
128
+ Access-Control-Allow-Origin:
129
+ - "*"
130
+ Access-Control-Allow-Headers:
131
+ - Accept,Accept-Language,Authorization,Cache-Control,CF-Context,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-Tag-Visibility,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,X-Contentful-Comment-Body-Format,X-Contentful-Parent-Entity-Reference,X-Contentful-Include-Invocation-Metadata,X-Contentful-Async-Ai-Action,x-contentful-ai-actions-platform
132
+ Access-Control-Expose-Headers:
133
+ - Etag,x-contentful-request-id,x-contentful-ai-actions-ratelimit-reset
134
+ Access-Control-Allow-Methods:
135
+ - DELETE,GET,HEAD,POST,PUT,PATCH,OPTIONS
136
+ Access-Control-Max-Age:
137
+ - '1728000'
138
+ Accept-Ranges:
139
+ - bytes
140
+ Date:
141
+ - Wed, 22 Oct 2025 13:12:47 GMT
142
+ X-Contentful-Request-Id:
143
+ - 07f62c10-6f6e-4b5e-91da-a9cf1a5454ea
144
+ Strict-Transport-Security:
145
+ - max-age=15768000
146
+ body:
147
+ encoding: ASCII-8BIT
148
+ string: ''
149
+ recorded_at: Wed, 22 Oct 2025 13:12:47 GMT
150
+ recorded_with: VCR 6.2.0
@@ -0,0 +1,78 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.contentful.com/organizations/4kQeJmhUWIKtNNmMkketza/taxonomy/concept-schemes/2hNivoHTKM4MbTM4519T5E
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ X-Contentful-User-Agent:
11
+ - sdk contentful-management.rb/3.11.0; platform ruby/3.4.3; os macOS/24;
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/5.0.1
22
+ response:
23
+ status:
24
+ code: 200
25
+ message: OK
26
+ headers:
27
+ Connection:
28
+ - close
29
+ Content-Length:
30
+ - '617'
31
+ Content-Type:
32
+ - application/json; charset=utf-8
33
+ X-Contentful-Ratelimit-Hour-Limit:
34
+ - '36000'
35
+ X-Contentful-Ratelimit-Second-Limit:
36
+ - '10'
37
+ X-Contentful-Ratelimit-Reset:
38
+ - '0'
39
+ X-Contentful-Ratelimit-Hour-Remaining:
40
+ - '35999'
41
+ X-Contentful-Ratelimit-Second-Remaining:
42
+ - '9'
43
+ X-Contentful-Route:
44
+ - "/organizations/:organizationId/taxonomy/concept-schemes/:id"
45
+ Cache-Control:
46
+ - no-cache
47
+ Accept-Ranges:
48
+ - bytes
49
+ X-Content-Type-Options:
50
+ - nosniff
51
+ Server:
52
+ - Contentful
53
+ Contentful-Api:
54
+ - cma
55
+ Contentful-Upstream:
56
+ - taxonomy-service
57
+ Access-Control-Allow-Origin:
58
+ - "*"
59
+ Access-Control-Allow-Headers:
60
+ - Accept,Accept-Language,Authorization,Cache-Control,CF-Context,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-Tag-Visibility,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,X-Contentful-Comment-Body-Format,X-Contentful-Parent-Entity-Reference,X-Contentful-Include-Invocation-Metadata,X-Contentful-Async-Ai-Action,x-contentful-ai-actions-platform
61
+ Access-Control-Expose-Headers:
62
+ - Etag,x-contentful-request-id,x-contentful-ai-actions-ratelimit-reset
63
+ Access-Control-Allow-Methods:
64
+ - DELETE,GET,HEAD,POST,PUT,PATCH,OPTIONS
65
+ Access-Control-Max-Age:
66
+ - '1728000'
67
+ Date:
68
+ - Wed, 22 Oct 2025 13:07:06 GMT
69
+ X-Contentful-Request-Id:
70
+ - ffe98bdc-198d-4b52-8d3f-e276895ba69a
71
+ Strict-Transport-Security:
72
+ - max-age=15768000
73
+ body:
74
+ encoding: UTF-8
75
+ string: '{"sys":{"id":"2hNivoHTKM4MbTM4519T5E","type":"TaxonomyConceptScheme","createdAt":"2025-09-14T06:37:32.431Z","updatedAt":"2025-09-15T12:42:23.839Z","organization":{"sys":{"id":"4kQeJmhUWIKtNNmMkketza","type":"Link","linkType":"Organization"}},"createdBy":{"sys":{"id":"59Erm8D1JuuD273aXNb65T","type":"Link","linkType":"User"}},"updatedBy":{"sys":{"id":"59Erm8D1JuuD273aXNb65T","type":"Link","linkType":"User"}},"version":3},"uri":null,"topConcepts":[],"concepts":[{"sys":{"id":"greenSofas","type":"Link","linkType":"TaxonomyConcept"}}],"totalConcepts":1,"prefLabel":{"en-US":"Home
76
+ Products"},"definition":{"en-US":""}}'
77
+ recorded_at: Wed, 22 Oct 2025 13:07:06 GMT
78
+ recorded_with: VCR 6.2.0
@@ -0,0 +1,77 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.contentful.com/organizations/4kQeJmhUWIKtNNmMkketza/taxonomy/concept-schemes/total
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ X-Contentful-User-Agent:
11
+ - sdk contentful-management.rb/3.11.0; platform ruby/3.4.3; os macOS/24;
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/5.0.1
22
+ response:
23
+ status:
24
+ code: 200
25
+ message: OK
26
+ headers:
27
+ Connection:
28
+ - close
29
+ Content-Length:
30
+ - '11'
31
+ Content-Type:
32
+ - application/json; charset=utf-8
33
+ X-Contentful-Ratelimit-Second-Limit:
34
+ - '10'
35
+ X-Contentful-Ratelimit-Reset:
36
+ - '0'
37
+ X-Contentful-Ratelimit-Hour-Remaining:
38
+ - '35999'
39
+ X-Contentful-Ratelimit-Second-Remaining:
40
+ - '9'
41
+ X-Contentful-Ratelimit-Hour-Limit:
42
+ - '36000'
43
+ X-Contentful-Route:
44
+ - "/organizations/:organizationId/taxonomy/concept-schemes/total"
45
+ Cache-Control:
46
+ - no-cache
47
+ Accept-Ranges:
48
+ - bytes
49
+ X-Content-Type-Options:
50
+ - nosniff
51
+ Server:
52
+ - Contentful
53
+ Contentful-Api:
54
+ - cma
55
+ Contentful-Upstream:
56
+ - taxonomy-service
57
+ Access-Control-Allow-Origin:
58
+ - "*"
59
+ Access-Control-Allow-Headers:
60
+ - Accept,Accept-Language,Authorization,Cache-Control,CF-Context,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-Tag-Visibility,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,X-Contentful-Comment-Body-Format,X-Contentful-Parent-Entity-Reference,X-Contentful-Include-Invocation-Metadata,X-Contentful-Async-Ai-Action,x-contentful-ai-actions-platform,X-Contentful-User-Id
61
+ Access-Control-Expose-Headers:
62
+ - Etag,x-contentful-request-id,x-contentful-ai-actions-ratelimit-reset
63
+ Access-Control-Allow-Methods:
64
+ - DELETE,GET,HEAD,POST,PUT,PATCH,OPTIONS
65
+ Access-Control-Max-Age:
66
+ - '1728000'
67
+ Date:
68
+ - Fri, 24 Oct 2025 08:29:42 GMT
69
+ X-Contentful-Request-Id:
70
+ - 5c6509d2-b4bb-41d4-b838-dc210807805d
71
+ Strict-Transport-Security:
72
+ - max-age=15768000
73
+ body:
74
+ encoding: UTF-8
75
+ string: '{"total":2}'
76
+ recorded_at: Fri, 24 Oct 2025 08:29:42 GMT
77
+ recorded_with: VCR 6.2.0
@@ -0,0 +1,155 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.contentful.com/organizations/4kQeJmhUWIKtNNmMkketza/taxonomy/concept-schemes/2hNivoHTKM4MbTM4519T5E
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ X-Contentful-User-Agent:
11
+ - sdk contentful-management.rb/3.11.0; platform ruby/3.4.3; os macOS/24;
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/5.0.1
22
+ response:
23
+ status:
24
+ code: 200
25
+ message: OK
26
+ headers:
27
+ Connection:
28
+ - close
29
+ Content-Length:
30
+ - '617'
31
+ Content-Type:
32
+ - application/json; charset=utf-8
33
+ X-Contentful-Ratelimit-Hour-Remaining:
34
+ - '35999'
35
+ X-Contentful-Ratelimit-Second-Remaining:
36
+ - '9'
37
+ X-Contentful-Ratelimit-Hour-Limit:
38
+ - '36000'
39
+ X-Contentful-Ratelimit-Second-Limit:
40
+ - '10'
41
+ X-Contentful-Ratelimit-Reset:
42
+ - '0'
43
+ X-Contentful-Route:
44
+ - "/organizations/:organizationId/taxonomy/concept-schemes/:id"
45
+ Cache-Control:
46
+ - no-cache
47
+ Accept-Ranges:
48
+ - bytes
49
+ X-Content-Type-Options:
50
+ - nosniff
51
+ Server:
52
+ - Contentful
53
+ Contentful-Api:
54
+ - cma
55
+ Contentful-Upstream:
56
+ - taxonomy-service
57
+ Access-Control-Allow-Origin:
58
+ - "*"
59
+ Access-Control-Allow-Headers:
60
+ - Accept,Accept-Language,Authorization,Cache-Control,CF-Context,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-Tag-Visibility,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,X-Contentful-Comment-Body-Format,X-Contentful-Parent-Entity-Reference,X-Contentful-Include-Invocation-Metadata,X-Contentful-Async-Ai-Action,x-contentful-ai-actions-platform
61
+ Access-Control-Expose-Headers:
62
+ - Etag,x-contentful-request-id,x-contentful-ai-actions-ratelimit-reset
63
+ Access-Control-Allow-Methods:
64
+ - DELETE,GET,HEAD,POST,PUT,PATCH,OPTIONS
65
+ Access-Control-Max-Age:
66
+ - '1728000'
67
+ Date:
68
+ - Wed, 22 Oct 2025 13:10:46 GMT
69
+ X-Contentful-Request-Id:
70
+ - 333db422-2961-49d0-a52d-34b1a7578a10
71
+ Strict-Transport-Security:
72
+ - max-age=15768000
73
+ body:
74
+ encoding: UTF-8
75
+ string: '{"sys":{"id":"2hNivoHTKM4MbTM4519T5E","type":"TaxonomyConceptScheme","createdAt":"2025-09-14T06:37:32.431Z","updatedAt":"2025-09-15T12:42:23.839Z","organization":{"sys":{"id":"4kQeJmhUWIKtNNmMkketza","type":"Link","linkType":"Organization"}},"createdBy":{"sys":{"id":"59Erm8D1JuuD273aXNb65T","type":"Link","linkType":"User"}},"updatedBy":{"sys":{"id":"59Erm8D1JuuD273aXNb65T","type":"Link","linkType":"User"}},"version":3},"uri":null,"topConcepts":[],"concepts":[{"sys":{"id":"greenSofas","type":"Link","linkType":"TaxonomyConcept"}}],"totalConcepts":1,"prefLabel":{"en-US":"Home
76
+ Products"},"definition":{"en-US":""}}'
77
+ recorded_at: Wed, 22 Oct 2025 13:10:46 GMT
78
+ - request:
79
+ method: patch
80
+ uri: https://api.contentful.com/organizations/4kQeJmhUWIKtNNmMkketza/taxonomy/concept-schemes/2hNivoHTKM4MbTM4519T5E
81
+ body:
82
+ encoding: UTF-8
83
+ string: '[{"op":"add","path":"/prefLabel/en-US","value":"New Scheme Name"}]'
84
+ headers:
85
+ X-Contentful-User-Agent:
86
+ - sdk contentful-management.rb/3.11.0; platform ruby/3.4.3; os macOS/24;
87
+ Authorization:
88
+ - Bearer <ACCESS_TOKEN>
89
+ Content-Type:
90
+ - application/json-patch+json
91
+ X-Contentful-Version:
92
+ - '3'
93
+ Connection:
94
+ - close
95
+ Host:
96
+ - api.contentful.com
97
+ User-Agent:
98
+ - http.rb/5.0.1
99
+ response:
100
+ status:
101
+ code: 200
102
+ message: OK
103
+ headers:
104
+ Connection:
105
+ - close
106
+ Content-Length:
107
+ - '619'
108
+ Content-Type:
109
+ - application/json; charset=utf-8
110
+ X-Contentful-Ratelimit-Hour-Remaining:
111
+ - '35998'
112
+ X-Contentful-Ratelimit-Second-Remaining:
113
+ - '8'
114
+ X-Contentful-Ratelimit-Hour-Limit:
115
+ - '36000'
116
+ X-Contentful-Ratelimit-Second-Limit:
117
+ - '10'
118
+ X-Contentful-Ratelimit-Reset:
119
+ - '0'
120
+ X-Contentful-Route:
121
+ - "/organizations/:organizationId/taxonomy/concept-schemes/:id"
122
+ Cache-Control:
123
+ - no-cache
124
+ X-Content-Type-Options:
125
+ - nosniff
126
+ Server:
127
+ - Contentful
128
+ Contentful-Api:
129
+ - cma
130
+ Contentful-Upstream:
131
+ - taxonomy-service
132
+ Access-Control-Allow-Origin:
133
+ - "*"
134
+ Access-Control-Allow-Headers:
135
+ - Accept,Accept-Language,Authorization,Cache-Control,CF-Context,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-Tag-Visibility,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,X-Contentful-Comment-Body-Format,X-Contentful-Parent-Entity-Reference,X-Contentful-Include-Invocation-Metadata,X-Contentful-Async-Ai-Action,x-contentful-ai-actions-platform
136
+ Access-Control-Expose-Headers:
137
+ - Etag,x-contentful-request-id,x-contentful-ai-actions-ratelimit-reset
138
+ Access-Control-Allow-Methods:
139
+ - DELETE,GET,HEAD,POST,PUT,PATCH,OPTIONS
140
+ Access-Control-Max-Age:
141
+ - '1728000'
142
+ Accept-Ranges:
143
+ - bytes
144
+ Date:
145
+ - Wed, 22 Oct 2025 13:10:47 GMT
146
+ X-Contentful-Request-Id:
147
+ - 9ad5db54-aac3-4541-8ab9-e36b1c4a2f99
148
+ Strict-Transport-Security:
149
+ - max-age=15768000
150
+ body:
151
+ encoding: UTF-8
152
+ string: '{"sys":{"id":"2hNivoHTKM4MbTM4519T5E","type":"TaxonomyConceptScheme","createdAt":"2025-09-14T06:37:32.431Z","updatedAt":"2025-10-22T13:10:46.957Z","organization":{"sys":{"id":"4kQeJmhUWIKtNNmMkketza","type":"Link","linkType":"Organization"}},"createdBy":{"sys":{"id":"59Erm8D1JuuD273aXNb65T","type":"Link","linkType":"User"}},"updatedBy":{"sys":{"id":"59Erm8D1JuuD273aXNb65T","type":"Link","linkType":"User"}},"version":4},"uri":null,"topConcepts":[],"concepts":[{"sys":{"id":"greenSofas","type":"Link","linkType":"TaxonomyConcept"}}],"totalConcepts":1,"prefLabel":{"en-US":"New
153
+ Scheme Name"},"definition":{"en-US":""}}'
154
+ recorded_at: Wed, 22 Oct 2025 13:10:47 GMT
155
+ recorded_with: VCR 6.2.0
@@ -370,6 +370,26 @@ module Contentful
370
370
  expect(asset.file.properties[:fileName]).to eq 'codequest.jpg'
371
371
  end
372
372
  end
373
+
374
+ it 'updates asset with concepts' do
375
+ vcr('asset/update_with_concepts') do
376
+ asset = subject.find('56PfMcxCLyzuXP3k7k0yL5')
377
+ concepts = [
378
+ {
379
+ 'sys' => {
380
+ 'type' => 'Link',
381
+ 'linkType' => 'TaxonomyConcept',
382
+ 'id' => 'livingRoom'
383
+ }
384
+ }
385
+ ]
386
+ asset.update(_metadata: { concepts: concepts, tags: [] })
387
+ expect(asset._metadata[:concepts]).to be_a(::Array)
388
+ expect(asset._metadata[:concepts].first).to be_a(Contentful::Management::Link)
389
+ expect(asset._metadata[:concepts].first.id).to eq('livingRoom')
390
+ expect(asset._metadata[:concepts].first.link_type).to eq('TaxonomyConcept')
391
+ end
392
+ end
373
393
  end
374
394
  describe '#save' do
375
395
  it 'updated' do
@@ -6,6 +6,7 @@ module Contentful
6
6
  module Management
7
7
  describe ContentType do
8
8
  let(:token) { ENV.fetch('CF_TEST_CMA_TOKEN', '<ACCESS_TOKEN>') }
9
+
9
10
  let(:space_id) { 'yr5m0jky5hsh' }
10
11
  let!(:client) { Client.new(token) }
11
12
  let(:content_type_id) { '5DSpuKrl04eMAGQoQckeIq' }
@@ -353,6 +354,27 @@ module Contentful
353
354
  end
354
355
  end
355
356
 
357
+ it 'updates content_type with metadata' do
358
+ vcr('content_type/update_with_metadata') do
359
+ content_type = subject.find('author')
360
+ metadata = {
361
+ taxonomy: [
362
+ {
363
+ 'sys' => {
364
+ 'type' => 'Link',
365
+ 'linkType' => 'TaxonomyConcept',
366
+ 'id' => 'newConcept'
367
+ }
368
+ }
369
+ ]
370
+ }
371
+ content_type.update(_metadata: metadata)
372
+ expect(content_type._metadata[:taxonomy]).to be_truthy
373
+ expect(content_type._metadata[:taxonomy].first['sys']['id']).to eq 'newConcept'
374
+ expect(content_type._metadata[:taxonomy].first['sys']['linkType']).to eq 'TaxonomyConcept'
375
+ end
376
+ end
377
+
356
378
  it 'update with multiple locales' do
357
379
  vcr('content_type/entry/update_only_with_localized_fields') do
358
380
  space = client.spaces.find('v2umtz8ths9v')
@@ -25,6 +25,15 @@ module Contentful
25
25
 
26
26
  subject { client.editor_interfaces(space_id, 'master', content_type_id) }
27
27
 
28
+ describe '.all' do
29
+ it 'class method also works' do
30
+ vcr('editor_interfaces/all') { expect(Contentful::Management::EditorInterface.all(client, space_id, 'master')).to be_kind_of Contentful::Management::Array }
31
+ end
32
+ it 'builds a Contentful::Management::Entry object' do
33
+ vcr('editor_interfaces/all') { expect(Contentful::Management::EditorInterface.all(client, space_id, 'master').first).to be_kind_of Contentful::Management::EditorInterface }
34
+ end
35
+ end
36
+
28
37
  describe '.default' do
29
38
  it 'class method also works' do
30
39
  vcr('editor_interfaces/default_for_space') { expect(Contentful::Management::EditorInterface.default(client, space_id, 'master', content_type_id)).to be_kind_of Contentful::Management::EditorInterface }
@@ -555,6 +555,27 @@ describe Contentful::Management::Entry do
555
555
  expect(p.fields).to match(expected)
556
556
  end
557
557
  end
558
+
559
+ it 'can update entry with concepts' do
560
+ vcr('entry/update_with_concepts') do
561
+ entry = subject.find('2aJVtypYfQajNbNN9TvEfd')
562
+ concepts = [
563
+ {
564
+ 'sys' => {
565
+ 'type' => 'Link',
566
+ 'linkType' => 'TaxonomyConcept',
567
+ 'id' => 'livingRoom'
568
+ }
569
+ }
570
+ ]
571
+ entry.update(_metadata: { concepts: concepts, tags: [] })
572
+ expect(entry._metadata[:concepts]).to be_a(::Array)
573
+ expect(entry._metadata[:concepts].first).to be_a(Contentful::Management::Link)
574
+ expect(entry._metadata[:concepts].first.id).to eq('livingRoom')
575
+ expect(entry._metadata[:concepts].first.link_type).to eq('TaxonomyConcept')
576
+ end
577
+ end
578
+
558
579
  end
559
580
 
560
581
  describe '#save' do
@@ -1255,4 +1276,4 @@ describe Contentful::Management::Entry do
1255
1276
  end
1256
1277
  end
1257
1278
  end
1258
- end
1279
+ end
@@ -0,0 +1,85 @@
1
+ require 'spec_helper'
2
+ require 'contentful/management/taxonomy_concept_scheme'
3
+ require 'contentful/management/client'
4
+
5
+ module Contentful
6
+ module Management
7
+ describe TaxonomyConceptScheme do
8
+ let(:token) { ENV.fetch('CF_TEST_CMA_TOKEN', '<ACCESS_TOKEN>') }
9
+
10
+ let(:organization_id) { '4kQeJmhUWIKtNNmMkketza' }
11
+ let(:concept_scheme_id) { '2hNivoHTKM4MbTM4519T5E' }
12
+ let(:client) { Client.new(token, raise_errors: true) }
13
+
14
+ subject { client.taxonomy_concept_schemes(organization_id) }
15
+
16
+ describe '.find' do
17
+ it 'returns a Contentful::Management::TaxonomyConceptScheme' do
18
+ vcr('taxonomy_concept_scheme/find') do
19
+ concept_scheme = subject.find(concept_scheme_id)
20
+ expect(concept_scheme).to be_a Contentful::Management::TaxonomyConceptScheme
21
+ expect(concept_scheme.id).to eq concept_scheme_id
22
+ expect(concept_scheme.pref_label['en-US']).to eq 'Home Products'
23
+ end
24
+ end
25
+ end
26
+
27
+ describe '.all' do
28
+ it 'returns an array of taxonomy concept schemes' do
29
+ vcr('taxonomy_concept_scheme/all') do
30
+ schemes = subject.all
31
+ expect(schemes).to be_a(Contentful::Management::Array)
32
+ expect(schemes.first).to be_a(Contentful::Management::TaxonomyConceptScheme)
33
+ end
34
+ end
35
+ end
36
+
37
+ describe '.total' do
38
+ it 'returns the total number of concept schemes' do
39
+ vcr('taxonomy_concept_scheme/total') do
40
+ total = subject.total
41
+ expect(total).to be_a(Integer)
42
+ end
43
+ end
44
+ end
45
+
46
+ describe '.create' do
47
+ it 'creates a taxonomy concept scheme' do
48
+ vcr('taxonomy_concept_scheme/create') do
49
+ scheme = subject.create(
50
+ prefLabel: { 'en-US' => 'New Scheme' }
51
+ )
52
+ expect(scheme).to be_a(Contentful::Management::TaxonomyConceptScheme)
53
+ expect(scheme.pref_label['en-US']).to eq('New Scheme')
54
+ end
55
+ end
56
+ end
57
+
58
+ describe '#update' do
59
+ it 'updates a taxonomy concept scheme' do
60
+ vcr('taxonomy_concept_scheme/update') do
61
+ scheme = subject.find(concept_scheme_id)
62
+ updated_scheme = scheme.update([
63
+ { op: 'add', path: '/prefLabel/en-US', value: 'New Scheme Name' }
64
+ ])
65
+ expect(updated_scheme).to be_a(Contentful::Management::TaxonomyConceptScheme)
66
+ expect(updated_scheme.pref_label['en-US']).to eq('New Scheme Name')
67
+ end
68
+ end
69
+ end
70
+
71
+ describe '#destroy' do
72
+ it 'deletes a taxonomy concept scheme' do
73
+ vcr('taxonomy_concept_scheme/destroy') do
74
+ scheme = subject.find(concept_scheme_id)
75
+ result = scheme.destroy
76
+ expect(result).to be_truthy
77
+ end
78
+ end
79
+ end
80
+ end
81
+ end
82
+ end
83
+
84
+
85
+