Class: GoodData::DataSource::S3ConnectionInfo
Instance Attribute Summary
Attributes inherited from Rest::Object
#client, #json, #project
Instance Method Summary
collapse
#connection_info, #connection_info=
#obj_id
client, default_client, #saved?
#data_property_reader
#data_property_writer
#metadata_property_reader
#metadata_property_writer
#meta
#data
#root_key
#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_key ⇒ Object
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
|
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_key ⇒ Object
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_encryption ⇒ Object
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_payload ⇒ Object
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
|
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
|