Class: ApolloDeploySignalSdk::SegmentResponse
- Inherits:
-
Object
- Object
- ApolloDeploySignalSdk::SegmentResponse
- Defined in:
- lib/apollo_deploy_signal_sdk/types.rb
Overview
Schema type: SegmentResponse
Instance Attribute Summary collapse
- #contact_count ⇒ Integer
- #created_at ⇒ String
- #id ⇒ String
- #name ⇒ String
- #object ⇒ String
- #project_id ⇒ String
- #unsubscribed_count ⇒ Integer
Class Method Summary collapse
-
.from_json(attributes) ⇒ SegmentResponse
Create an instance from a parsed JSON hash.
Instance Method Summary collapse
-
#initialize(object: nil, id:, name:, project_id:, created_at:, contact_count: nil, unsubscribed_count: nil) ⇒ SegmentResponse
constructor
A new instance of SegmentResponse.
-
#to_h ⇒ Hash
A hash representation of this object.
Constructor Details
#initialize(object: nil, id:, name:, project_id:, created_at:, contact_count: nil, unsubscribed_count: nil) ⇒ SegmentResponse
Returns a new instance of SegmentResponse.
1929 1930 1931 1932 1933 1934 1935 1936 1937 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 1929 def initialize(object: nil, id: , name: , project_id: , created_at: , contact_count: nil, unsubscribed_count: nil) @object = object @id = id @name = name @project_id = project_id @created_at = created_at @contact_count = contact_count @unsubscribed_count = unsubscribed_count end |
Instance Attribute Details
#contact_count ⇒ Integer
1924 1925 1926 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 1924 def contact_count @contact_count end |
#created_at ⇒ String
1922 1923 1924 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 1922 def created_at @created_at end |
#id ⇒ String
1916 1917 1918 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 1916 def id @id end |
#name ⇒ String
1918 1919 1920 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 1918 def name @name end |
#object ⇒ String
1914 1915 1916 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 1914 def object @object end |
#project_id ⇒ String
1920 1921 1922 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 1920 def project_id @project_id end |
#unsubscribed_count ⇒ Integer
1926 1927 1928 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 1926 def unsubscribed_count @unsubscribed_count end |
Class Method Details
.from_json(attributes) ⇒ SegmentResponse
Create an instance from a parsed JSON hash.
1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 1955 def self.from_json(attributes) return nil unless attributes.is_a?(Hash) new( object: attributes.key?("object") ? attributes["object"] : attributes[:object], id: attributes.key?("id") ? attributes["id"] : attributes[:id], name: attributes.key?("name") ? attributes["name"] : attributes[:name], project_id: attributes.key?("projectId") ? attributes["projectId"] : attributes[:project_id], created_at: attributes.key?("createdAt") ? attributes["createdAt"] : attributes[:created_at], contact_count: attributes.key?("contactCount") ? attributes["contactCount"] : attributes[:contact_count], unsubscribed_count: attributes.key?("unsubscribedCount") ? attributes["unsubscribedCount"] : attributes[:unsubscribed_count], ) end |
Instance Method Details
#to_h ⇒ Hash
Returns a hash representation of this object.
1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 1940 def to_h { object: @object, id: @id, name: @name, project_id: @project_id, created_at: @created_at, contact_count: @contact_count, unsubscribed_count: @unsubscribed_count, }.compact end |