Class: Cadenya::Types::AccountSpec

Inherits:
Object
  • Object
show all
Defined in:
lib/cadenya/types.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(description: nil, domain: nil, billing_email: nil, workspaces: nil) ⇒ AccountSpec

Returns a new instance of AccountSpec.



285
286
287
288
289
290
# File 'lib/cadenya/types.rb', line 285

def initialize(description: nil, domain: nil, billing_email: nil, workspaces: nil)
  @description = description
  @domain = domain
  @billing_email = billing_email
  @workspaces = workspaces
end

Instance Attribute Details

#billing_emailObject (readonly)

Returns the value of attribute billing_email.



283
284
285
# File 'lib/cadenya/types.rb', line 283

def billing_email
  @billing_email
end

#descriptionObject (readonly)

Returns the value of attribute description.



283
284
285
# File 'lib/cadenya/types.rb', line 283

def description
  @description
end

#domainObject (readonly)

Returns the value of attribute domain.



283
284
285
# File 'lib/cadenya/types.rb', line 283

def domain
  @domain
end

#workspacesObject (readonly)

Returns the value of attribute workspaces.



283
284
285
# File 'lib/cadenya/types.rb', line 283

def workspaces
  @workspaces
end

Class Method Details

.from_json(data) ⇒ Object



292
293
294
295
296
297
298
299
# File 'lib/cadenya/types.rb', line 292

def self.from_json(data)
  new(
    description: data["description"],
    domain: data["domain"],
    billing_email: data["billingEmail"],
    workspaces: data["workspaces"].nil? ? nil : (data["workspaces"]).map { |item| Types::Workspace.from_json(item) },
  )
end

Instance Method Details

#to_hObject



301
302
303
304
305
306
307
308
# File 'lib/cadenya/types.rb', line 301

def to_h
  {
    description: Util.plain(@description),
    domain: Util.plain(@domain),
    billing_email: Util.plain(@billing_email),
    workspaces: Util.plain(@workspaces),
  }.reject { |_k, v| v.nil? }
end