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

Returns a new instance of Service.



16347
16348
16349
16350
16351
16352
16353
16354
16355
16356
16357
16358
16359
# File 'lib/models/porcelain.rb', line 16347

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



16337
16338
16339
# File 'lib/models/porcelain.rb', line 16337

def created_at
  @created_at
end

#idObject

Unique identifier of the Service.



16339
16340
16341
# File 'lib/models/porcelain.rb', line 16339

def id
  @id
end

#nameObject

Unique human-readable name of the Service.



16341
16342
16343
# File 'lib/models/porcelain.rb', line 16341

def name
  @name
end

#suspendedObject

The Service's suspended state.



16343
16344
16345
# File 'lib/models/porcelain.rb', line 16343

def suspended
  @suspended
end

#tagsObject

Tags is a map of key, value pairs.



16345
16346
16347
# File 'lib/models/porcelain.rb', line 16345

def tags
  @tags
end

Instance Method Details

#to_json(options = {}) ⇒ Object



16361
16362
16363
16364
16365
16366
16367
# File 'lib/models/porcelain.rb', line 16361

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