Sha256: 9751380c2ac8258dc55ad4d884784af2919f367181de82e02a26fc2e9ddebd20

Contents?: true

Size: 798 Bytes

Versions: 63

Compression:

Stored size: 798 Bytes

Contents

require 'pry'

access_token = 'access token'
organization = 'organization id'

require 'contentful/management'

client = Contentful::Management::Client.new(access_token)

spaces = Contentful::Management::Space.all

my_space = Contentful::Management::Space.create(name: 'MySpace', organization_id: organization)

my_space.update(name: 'MyNewSpace')

dat_space = Contentful::Management::Space.find(my_space.id)

dat_space.locales.create(name: 'English', code: 'en-US')

locales = dat_space.locales.all
# locales.map(&:destroy) # not implemented yet?

dat_space.destroy

# XXX: This does not set the organization_id when a space should be created
#
your_space = Contentful::Management::Space.new
your_space.organization = organization
your_space.name = 'YourSpace'
your_space.save

your_space.destroy

Version data entries

63 entries across 63 versions & 1 rubygems

Version Path
contentful-management-3.10.0 examples/create_space.rb
contentful-management-3.9.0 examples/create_space.rb
contentful-management-3.8.0 examples/create_space.rb
contentful-management-3.7.0 examples/create_space.rb
contentful-management-3.6.0 examples/create_space.rb
contentful-management-3.5.0 examples/create_space.rb
contentful-management-3.4.0 examples/create_space.rb
contentful-management-3.3.0 examples/create_space.rb
contentful-management-3.2.0 examples/create_space.rb
contentful-management-3.1.0 examples/create_space.rb
contentful-management-3.0.0 examples/create_space.rb
contentful-management-2.13.1 examples/create_space.rb
contentful-management-2.13.0 examples/create_space.rb
contentful-management-2.12.1 examples/create_space.rb
contentful-management-2.12.0 examples/create_space.rb
contentful-management-2.11.0 examples/create_space.rb
contentful-management-2.10.0 examples/create_space.rb
contentful-management-2.9.1 examples/create_space.rb
contentful-management-2.9.0 examples/create_space.rb
contentful-management-2.8.2 examples/create_space.rb