You are viewing documentation for version 3 of the AWS SDK for Ruby. Version 2 documentation can be found here.

Class: Aws::RDS::Certificate

Inherits:
Object
  • Object
show all
Defined in:
gems/aws-sdk-rds/lib/aws-sdk-rds/certificate.rb

Defined Under Namespace

Classes: Collection

Read-Only Attributes collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, options = {}) ⇒ Certificate #initialize(options = {}) ⇒ Certificate

Returns a new instance of Certificate

Overloads:

  • #initialize(id, options = {}) ⇒ Certificate

    Parameters:

    • id (String)

    Options Hash (options):

  • #initialize(options = {}) ⇒ Certificate

    Options Hash (options):

    • :id (required, String)
    • :client (Client)


19
20
21
22
23
24
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/certificate.rb', line 19

def initialize(*args)
  options = Hash === args.last ? args.pop.dup : {}
  @id = extract_id(args, options)
  @data = options.delete(:data)
  @client = options.delete(:client) || Client.new(options)
end

Instance Method Details

#certificate_arnString

The Amazon Resource Name (ARN) for the certificate.

Returns:

  • (String)


60
61
62
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/certificate.rb', line 60

def certificate_arn
  data.certificate_arn
end

#certificate_typeString

The type of the certificate.

Returns:

  • (String)


36
37
38
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/certificate.rb', line 36

def certificate_type
  data.certificate_type
end

#clientClient

Returns:



67
68
69
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/certificate.rb', line 67

def client
  @client
end

#dataTypes::Certificate

Returns the data for this Aws::RDS::Certificate. Calls Aws::RDS::Client#describe_certificates if #data_loaded? is false.

Returns:



87
88
89
90
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/certificate.rb', line 87

def data
  load unless @data
  @data
end

#data_loaded?Boolean

Returns true if this resource is loaded. Accessing attributes or #data on an unloaded resource will trigger a call to #load.

Returns:

  • (Boolean)

    Returns true if this resource is loaded. Accessing attributes or #data on an unloaded resource will trigger a call to #load.



95
96
97
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/certificate.rb', line 95

def data_loaded?
  !!@data
end

#idString Also known as: certificate_identifier

Returns:

  • (String)


29
30
31
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/certificate.rb', line 29

def id
  @id
end

#loadself Also known as: reload

Loads, or reloads #data for the current Aws::RDS::Certificate. Returns self making it possible to chain methods.

certificate.reload.data

Returns:

  • (self)


77
78
79
80
81
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/certificate.rb', line 77

def load
  resp = @client.describe_certificates(certificate_identifier: @id)
  @data = resp.certificates[0]
  self
end

#thumbprintString

The thumbprint of the certificate.

Returns:

  • (String)


42
43
44
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/certificate.rb', line 42

def thumbprint
  data.thumbprint
end

#valid_fromTime

The starting date from which the certificate is valid.

Returns:

  • (Time)


48
49
50
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/certificate.rb', line 48

def valid_from
  data.valid_from
end

#valid_tillTime

The final date that the certificate continues to be valid.

Returns:

  • (Time)


54
55
56
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/certificate.rb', line 54

def valid_till
  data.valid_till
end