Class: GoodData::DataSource::S3ConnectionInfo

Inherits:
ConnectionInfo show all
Defined in:
lib/gooddata/models/data_source.rb

Instance Attribute Summary

Attributes inherited from Rest::Object

#client, #json, #project

Instance Method Summary collapse

Methods inherited from ConnectionInfo

#connection_info, #connection_info=

Methods included from Mixin::ObjId

#obj_id

Methods inherited from Rest::Object

client, default_client, #saved?

Methods included from Mixin::DataPropertyReader

#data_property_reader

Methods included from Mixin::DataPropertyWriter

#data_property_writer

Methods included from Mixin::MetaPropertyReader

#metadata_property_reader

Methods included from Mixin::MetaPropertyWriter

#metadata_property_writer

Methods included from Mixin::MetaGetter

#meta

Methods included from Mixin::DataGetter

#data

Methods included from Mixin::RootKeyGetter

#root_key

Methods included from Mixin::ContentGetter

#content

Constructor Details

#initialize(connection_info_json) ⇒ S3ConnectionInfo

Returns a new instance of S3ConnectionInfo.



580
581
582
# File 'lib/gooddata/models/data_source.rb', line 580

def initialize(connection_info_json)
  @json = connection_info_json[GoodData::DataSource::S3]
end

Instance Method Details

#access_keyObject



592
593
594
# File 'lib/gooddata/models/data_source.rb', line 592

def access_key
  @json['accessKey']
end

#access_key=(new_access_key) ⇒ Object



596
597
598
# File 'lib/gooddata/models/data_source.rb', line 596

def access_key=(new_access_key)
  @json['accessKey'] = new_access_key
end

#bucketObject



584
585
586
# File 'lib/gooddata/models/data_source.rb', line 584

def bucket
  @json['bucket']
end

#bucket=(new_bucket) ⇒ Object



588
589
590
# File 'lib/gooddata/models/data_source.rb', line 588

def bucket=(new_bucket)
  @json['bucket'] = new_bucket
end

#secret_keyObject



600
601
602
# File 'lib/gooddata/models/data_source.rb', line 600

def secret_key
  @json['secretKey']
end

#secret_key=(new_secret_key) ⇒ Object



604
605
606
# File 'lib/gooddata/models/data_source.rb', line 604

def secret_key=(new_secret_key)
  @json['secretKey'] = new_secret_key
end

#server_side_encryptionObject



608
609
610
# File 'lib/gooddata/models/data_source.rb', line 608

def server_side_encryption
  @json['serverSideEncryption']
end

#server_side_encryption=(new_server_side_encryption) ⇒ Object



612
613
614
# File 'lib/gooddata/models/data_source.rb', line 612

def server_side_encryption=(new_server_side_encryption)
  @json['serverSideEncryption'] = new_server_side_encryption
end

#to_update_payloadObject



616
617
618
619
620
621
622
623
624
625
# File 'lib/gooddata/models/data_source.rb', line 616

def to_update_payload
  {
    's3' => {
      'bucket' => bucket,
      'accessKey' => access_key,
      'secretKey' => secret_key,
      'serverSideEncryption' => server_side_encryption
    }
  }
end

#validateObject



627
628
629
630
# File 'lib/gooddata/models/data_source.rb', line 627

def validate
  fail 'S3 bucket has to be provided' if bucket.nil? || bucket.blank?
  fail 'S3 access key has to be provided' if access_key.nil? || access_key.blank?
end