Sha256: 302e3312e3208f42691aabbd232a21c6d1b671aa70083d53ee66a8eabeb82a46

Contents?: true

Size: 1.6 KB

Versions: 26

Compression:

Stored size: 1.6 KB

Contents

# encoding: UTF-8
#
# Copyright (c) 2010-2015 GoodData Corporation. All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

require_relative '../rest/rest'

module GoodData
  class Invitation < Rest::Resource
    def initialize(json)
      @json = json
    end

    def contributor
      data = client.get @json['invitation']['meta']['contributor']
      client.create GoodData::AccountSettings, data
    end

    def created
      DateTime.parse(@json['invitation']['meta']['created'])
    end

    def email
      @json['invitation']['content']['email']
    end

    def first_name
      @json['invitation']['content']['firstname']
    end

    def phone
      @json['invitation']['content']['phone']
    end

    def profile
      data = client.get @json['invitation']['links']['profile']
      client.create GoodData::AccountSettings, data
    end

    def project
      data = client.get @json['invitation']['links']['project']
      client.create GoodData::Project, data
    end

    def project_name
      @json['invitation']['content']['projectname']
    end

    def role
      # TODO: Return object instead
      @json['invitation']['content']['role']
    end

    def status
      @json['invitation']['content']['status']
    end

    def summary
      @json['invitation']['content']['summary']
    end

    def title
      @json['invitation']['content']['title']
    end

    def updated
      DateTime.parse(@json['invitation']['meta']['updated'])
    end

    def uri
      @json['invitation']['links']['self']
    end
  end
end

Version data entries

26 entries across 26 versions & 2 rubygems

Version Path
gooddata-edge-0.6.27.edge lib/gooddata/models/invitation.rb
gooddata-0.6.49 lib/gooddata/models/invitation.rb
gooddata-0.6.48 lib/gooddata/models/invitation.rb
gooddata-0.6.47 lib/gooddata/models/invitation.rb
gooddata-0.6.46 lib/gooddata/models/invitation.rb
gooddata-0.6.45 lib/gooddata/models/invitation.rb
gooddata-0.6.44 lib/gooddata/models/invitation.rb
gooddata-0.6.43 lib/gooddata/models/invitation.rb
gooddata-0.6.42 lib/gooddata/models/invitation.rb
gooddata-0.6.41 lib/gooddata/models/invitation.rb
gooddata-0.6.40 lib/gooddata/models/invitation.rb
gooddata-0.6.39 lib/gooddata/models/invitation.rb
gooddata-0.6.38 lib/gooddata/models/invitation.rb
gooddata-0.6.37 lib/gooddata/models/invitation.rb
gooddata-0.6.36 lib/gooddata/models/invitation.rb
gooddata-0.6.35 lib/gooddata/models/invitation.rb
gooddata-0.6.34 lib/gooddata/models/invitation.rb
gooddata-0.6.33 lib/gooddata/models/invitation.rb
gooddata-0.6.32 lib/gooddata/models/invitation.rb
gooddata-0.6.31 lib/gooddata/models/invitation.rb