Class: ApolloDeploySignalSdkRails::DeliveryWindowRequest

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

Overview

Schema type: DeliveryWindowRequest

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(start:, end_:) ⇒ DeliveryWindowRequest

Returns a new instance of DeliveryWindowRequest.

Parameters:

  • start (String)

    , end_ [String]



61
62
63
64
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 61

def initialize(start: , end_: )
  @start = start
  @end_ = end_
end

Instance Attribute Details

#end_String

Returns:

  • (String)


58
59
60
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 58

def end_
  @end_
end

#startString

Returns:

  • (String)


56
57
58
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 56

def start
  @start
end

Class Method Details

.from_json(attributes) ⇒ DeliveryWindowRequest

Create an instance from a parsed JSON hash.

Parameters:

  • attributes (Hash)

Returns:



77
78
79
80
81
82
83
84
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 77

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

  new(
    start: attributes.key?("start") ? attributes["start"] : attributes[:start],
    end_: attributes.key?("end") ? attributes["end"] : attributes[:end_],
  )
end

Instance Method Details

#to_hHash

Returns a hash representation of this object.

Returns:

  • (Hash)

    a hash representation of this object



67
68
69
70
71
72
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 67

def to_h
  {
    start: @start,
    end_: @end_,
  }.compact
end