Class: ApolloDeploySignalSdkRails::DnsRecordResponse

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

Overview

Schema type: DnsRecordResponse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, type:, value:, priority: nil, optional: nil, status: nil) ⇒ DnsRecordResponse

Returns a new instance of DnsRecordResponse.

Parameters:

  • name (String)

    , type [String], value [String], priority [Integer, nil], optional [Boolean, nil], status [String, nil]



4459
4460
4461
4462
4463
4464
4465
4466
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 4459

def initialize(name: , type: , value: , priority: nil, optional: nil, status: nil)
  @name = name
  @type = type
  @value = value
  @priority = priority
  @optional = optional
  @status = status
end

Instance Attribute Details

#nameString

Returns:

  • (String)


4446
4447
4448
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 4446

def name
  @name
end

#optionalBoolean?

Returns:

  • (Boolean, nil)


4454
4455
4456
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 4454

def optional
  @optional
end

#priorityInteger?

Returns:

  • (Integer, nil)


4452
4453
4454
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 4452

def priority
  @priority
end

#statusString?

Returns:

  • (String, nil)


4456
4457
4458
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 4456

def status
  @status
end

#typeString

Returns:

  • (String)


4448
4449
4450
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 4448

def type
  @type
end

#valueString

Returns:

  • (String)


4450
4451
4452
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 4450

def value
  @value
end

Class Method Details

.from_json(attributes) ⇒ DnsRecordResponse

Create an instance from a parsed JSON hash.

Parameters:

  • attributes (Hash)

Returns:



4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 4483

def self.from_json(attributes)
  return nil unless attributes.is_a?(Hash)

  new(
    name: attributes.key?("name") ? attributes["name"] : attributes[:name],
    type: attributes.key?("type") ? attributes["type"] : attributes[:type],
    value: attributes.key?("value") ? attributes["value"] : attributes[:value],
    priority: attributes.key?("priority") ? attributes["priority"] : attributes[:priority],
    optional: attributes.key?("optional") ? attributes["optional"] : attributes[:optional],
    status: attributes.key?("status") ? attributes["status"] : attributes[:status],
  )
end

Instance Method Details

#to_hHash

Returns a hash representation of this object.

Returns:

  • (Hash)

    a hash representation of this object



4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 4469

def to_h
  {
    name: @name,
    type: @type,
    value: @value,
    priority: @priority,
    optional: @optional,
    status: @status,
  }.compact
end