Sha256: dd644c46dc765fd9d684def77cc7bbcfea678fbe0fbfcbbf69c166c76f06c568

Contents?: true

Size: 1.6 KB

Versions: 77

Compression:

Stored size: 1.6 KB

Contents

# encoding: UTF-8
#
# Copyright (c) 2010-2017 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

77 entries across 77 versions & 1 rubygems

Version Path
gooddata-2.3.1-java lib/gooddata/models/invitation.rb
gooddata-2.3.1 lib/gooddata/models/invitation.rb
gooddata-2.3.0-java lib/gooddata/models/invitation.rb
gooddata-2.3.0 lib/gooddata/models/invitation.rb
gooddata-2.2.0-java lib/gooddata/models/invitation.rb
gooddata-2.2.0 lib/gooddata/models/invitation.rb
gooddata-2.1.19-java lib/gooddata/models/invitation.rb
gooddata-2.1.19 lib/gooddata/models/invitation.rb
gooddata-2.1.17-java lib/gooddata/models/invitation.rb
gooddata-2.1.17 lib/gooddata/models/invitation.rb
gooddata-2.1.15-java lib/gooddata/models/invitation.rb
gooddata-2.1.15 lib/gooddata/models/invitation.rb
gooddata-2.1.14-java lib/gooddata/models/invitation.rb
gooddata-2.1.14 lib/gooddata/models/invitation.rb
gooddata-2.1.13-java lib/gooddata/models/invitation.rb
gooddata-2.1.13 lib/gooddata/models/invitation.rb
gooddata-2.1.12-java lib/gooddata/models/invitation.rb
gooddata-2.1.12 lib/gooddata/models/invitation.rb
gooddata-2.1.11-java lib/gooddata/models/invitation.rb
gooddata-2.1.11 lib/gooddata/models/invitation.rb