Sha256: dc8536d811c134b275b5d878068460071967ea32452282240e8e3ae554f3fa69

Contents?: true

Size: 1.15 KB

Versions: 53

Compression:

Stored size: 1.15 KB

Contents

class Ey::Core::Client::SslCertificate < Ey::Core::Model
  extend Ey::Core::Associations

  identity :id

  attribute :created_at, type: :time
  attribute :deleted_at, type: :time

  attribute :name
  attribute :public_certificate
  attribute :private_key
  attribute :certificate_chain
  attribute :self_signed

  has_one :account

  attr_accessor :self_sign

  def save!
    params = {
      "url"             => self.collection.url,
      "account"         => self.account_id,
      "ssl_certificate" => {
        "name"               => self.name,
        "public_certificate" => self.public_certificate,
        "private_key"        => self.private_key,
        "certificate_chain"  => self.certificate_chain,
      }
    }

    params["ssl_certificate"].merge!("self_sign" => self.self_sign.nil? ? self.self_signed : self.self_sign) if new_record?

    if new_record?
      connection.requests.new(self.connection.create_ssl_certificate(params).body["request"])
    else
      params["id"] = self.id
      self.connection.update_ssl_certificate(params).body["request"]
    end
  end

  def destroy!
    self.connection.destroy_ssl_certificate("id" => self.id)
  end
end

Version data entries

53 entries across 53 versions & 3 rubygems

Version Path
ey-core-3.6.4 lib/ey-core/models/ssl_certificate.rb
ey-core-3.6.3 lib/ey-core/models/ssl_certificate.rb
ey-core-3.6.1 lib/ey-core/models/ssl_certificate.rb
groove-ey-core-3.6.3 lib/ey-core/models/ssl_certificate.rb
groove-ey-core-3.6.2 lib/ey-core/models/ssl_certificate.rb
groove-ey-core-3.6.1 lib/ey-core/models/ssl_certificate.rb
ey-core-3.5.0 lib/ey-core/models/ssl_certificate.rb
ey-core-3.4.4 lib/ey-core/models/ssl_certificate.rb
ey-core-3.4.2 lib/ey-core/models/ssl_certificate.rb
ey-core-3.4.1 lib/ey-core/models/ssl_certificate.rb
ey-core-3.4.0 lib/ey-core/models/ssl_certificate.rb
ey-core-3.3.1 lib/ey-core/models/ssl_certificate.rb
ey-core-3.3.0 lib/ey-core/models/ssl_certificate.rb
ey-core-3.2.6 lib/ey-core/models/ssl_certificate.rb
ey-core-3.2.5 lib/ey-core/models/ssl_certificate.rb
ey-core-3.2.4 lib/ey-core/models/ssl_certificate.rb
ey-core-3.2.3 lib/ey-core/models/ssl_certificate.rb
ey-core-3.2.2 lib/ey-core/models/ssl_certificate.rb
ey-core-3.2.1 lib/ey-core/models/ssl_certificate.rb
ey-core-3.2.0 lib/ey-core/models/ssl_certificate.rb