Class: SDM::Service

Inherits:
Object
  • Object
show all
Defined in:
lib/models/porcelain.rb

Overview

A Service is a service account that can connect to resources they are granted directly, or granted via roles. Services are typically automated jobs.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(created_at: nil, id: nil, name: nil, suspended: nil, tags: nil) ⇒ Service



15783
15784
15785
15786
15787
15788
15789
15790
15791
15792
15793
15794
15795
# File 'lib/models/porcelain.rb', line 15783

def initialize(
  created_at: nil,
  id: nil,
  name: nil,
  suspended: nil,
  tags: nil
)
  @created_at = created_at == nil ? nil : created_at
  @id = id == nil ? "" : id
  @name = name == nil ? "" : name
  @suspended = suspended == nil ? false : suspended
  @tags = tags == nil ? SDM::_porcelain_zero_value_tags() : tags
end

Instance Attribute Details

#created_atObject

CreatedAt is the timestamp when the service was created



15773
15774
15775
# File 'lib/models/porcelain.rb', line 15773

def created_at
  @created_at
end

#idObject

Unique identifier of the Service.



15775
15776
15777
# File 'lib/models/porcelain.rb', line 15775

def id
  @id
end

#nameObject

Unique human-readable name of the Service.



15777
15778
15779
# File 'lib/models/porcelain.rb', line 15777

def name
  @name
end

#suspendedObject

The Service's suspended state.



15779
15780
15781
# File 'lib/models/porcelain.rb', line 15779

def suspended
  @suspended
end

#tagsObject

Tags is a map of key, value pairs.



15781
15782
15783
# File 'lib/models/porcelain.rb', line 15781

def tags
  @tags
end

Instance Method Details

#to_json(options = {}) ⇒ Object



15797
15798
15799
15800
15801
15802
15803
# File 'lib/models/porcelain.rb', line 15797

def to_json(options = {})
  hash = {}
  self.instance_variables.each do |var|
    hash[var.id2name.delete_prefix("@")] = self.instance_variable_get var
  end
  hash.to_json
end