Class: ApolloDeploySignalSdkRails::ProjectResponse

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

Overview

Schema type: ProjectResponse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, name:, slug:, status:, suspension_reason:, region:, limits:, tracking_settings:, created_at:, updated_at:) ⇒ ProjectResponse

Returns a new instance of ProjectResponse.

Parameters:

  • id (String)

    , name [String], slug [String], status [String], suspension_reason [String, nil], region [String], limits [ProjectLimitsModel], tracking_settings [ProjectTrackingSettingsModel], created_at [String], updated_at [String]



4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 4056

def initialize(id: , name: , slug: , status: , suspension_reason: , region: , limits: , tracking_settings: , created_at: , updated_at: )
  @id = id
  @name = name
  @slug = slug
  @status = status
  @suspension_reason = suspension_reason
  @region = region
  @limits = limits
  @tracking_settings = tracking_settings
  @created_at = created_at
  @updated_at = updated_at
end

Instance Attribute Details

#created_atString

Returns:

  • (String)


4051
4052
4053
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 4051

def created_at
  @created_at
end

#idString

Returns:

  • (String)


4035
4036
4037
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 4035

def id
  @id
end

#limitsProjectLimitsModel

Returns:



4047
4048
4049
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 4047

def limits
  @limits
end

#nameString

Returns:

  • (String)


4037
4038
4039
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 4037

def name
  @name
end

#regionString

Returns:

  • (String)


4045
4046
4047
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 4045

def region
  @region
end

#slugString

Returns:

  • (String)


4039
4040
4041
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 4039

def slug
  @slug
end

#statusString

Returns:

  • (String)


4041
4042
4043
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 4041

def status
  @status
end

#suspension_reasonString?

Returns:

  • (String, nil)


4043
4044
4045
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 4043

def suspension_reason
  @suspension_reason
end

#tracking_settingsProjectTrackingSettingsModel



4049
4050
4051
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 4049

def tracking_settings
  @tracking_settings
end

#updated_atString

Returns:

  • (String)


4053
4054
4055
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 4053

def updated_at
  @updated_at
end

Class Method Details

.from_json(attributes) ⇒ ProjectResponse

Create an instance from a parsed JSON hash.

Parameters:

  • attributes (Hash)

Returns:



4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 4088

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

  new(
    id: attributes.key?("id") ? attributes["id"] : attributes[:id],
    name: attributes.key?("name") ? attributes["name"] : attributes[:name],
    slug: attributes.key?("slug") ? attributes["slug"] : attributes[:slug],
    status: attributes.key?("status") ? attributes["status"] : attributes[:status],
    suspension_reason: attributes.key?("suspensionReason") ? attributes["suspensionReason"] : attributes[:suspension_reason],
    region: attributes.key?("region") ? attributes["region"] : attributes[:region],
    limits: attributes.key?("limits") ? attributes["limits"] : attributes[:limits],
    tracking_settings: attributes.key?("trackingSettings") ? attributes["trackingSettings"] : attributes[:tracking_settings],
    created_at: attributes.key?("createdAt") ? attributes["createdAt"] : attributes[:created_at],
    updated_at: attributes.key?("updatedAt") ? attributes["updatedAt"] : attributes[:updated_at],
  )
end

Instance Method Details

#to_hHash

Returns a hash representation of this object.

Returns:

  • (Hash)

    a hash representation of this object



4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 4070

def to_h
  {
    id: @id,
    name: @name,
    slug: @slug,
    status: @status,
    suspension_reason: @suspension_reason,
    region: @region,
    limits: @limits,
    tracking_settings: @tracking_settings,
    created_at: @created_at,
    updated_at: @updated_at,
  }.compact
end