Class: Uplink::EdgeCredential

Inherits:
Object
  • Object
show all
Defined in:
lib/uplink/edge_credential.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(edge_credentials_result, edge_credentials = nil) ⇒ EdgeCredential

Returns a new instance of EdgeCredential.



7
8
9
# File 'lib/uplink/edge_credential.rb', line 7

def initialize(edge_credentials_result, edge_credentials = nil)
  init_attributes(edge_credentials_result.nil? || edge_credentials_result.null? ? edge_credentials : edge_credentials_result[:credentials])
end

Instance Attribute Details

#access_key_idObject (readonly)

Returns the value of attribute access_key_id.



5
6
7
# File 'lib/uplink/edge_credential.rb', line 5

def access_key_id
  @access_key_id
end

#endpointObject (readonly)

Returns the value of attribute endpoint.



5
6
7
# File 'lib/uplink/edge_credential.rb', line 5

def endpoint
  @endpoint
end

#secret_keyObject (readonly)

Returns the value of attribute secret_key.



5
6
7
# File 'lib/uplink/edge_credential.rb', line 5

def secret_key
  @secret_key
end

Instance Method Details

#join_share_url(base_url, bucket, key, options = nil) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/uplink/edge_credential.rb', line 11

def join_share_url(base_url, bucket, key, options = nil)
  share_url_options = nil
  if options && !options.empty?
    share_url_options = UplinkLib::EdgeShareURLOptions.new
    share_url_options[:raw] = options[:raw]
  end

  result = UplinkLib.edge_join_share_url(base_url, @access_key_id, bucket, key, share_url_options)
  ErrorUtil.handle_result_error(result)

  result[:string]
ensure
  UplinkLib.uplink_free_string_result(result) if result
end