Sha256: 29bec5e4a14e63ac69646ef06204a24f4d141bfff8738c5bed5fe16af069ccb0

Contents?: true

Size: 801 Bytes

Versions: 3

Compression:

Stored size: 801 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

3 entries across 3 versions & 1 rubygems

Version Path
contentful-management-0.0.3 examples/create_space.rb
contentful-management-0.0.2 examples/create_space.rb
contentful-management-0.0.1 examples/create_space.rb