Class: Verizon::V3ChangeCampaignDatesRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- Verizon::V3ChangeCampaignDatesRequest
- Defined in:
- lib/verizon/models/v3_change_campaign_dates_request.rb
Overview
Campaign dates and time windows.
Instance Attribute Summary collapse
-
#campaign_time_window_list ⇒ Array[V3TimeWindow]
List of allowed campaign time windows.
-
#end_date ⇒ Date
Campaign end date.
-
#start_date ⇒ Date
Campaign start date.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(start_date = nil, end_date = nil, campaign_time_window_list = SKIP) ⇒ V3ChangeCampaignDatesRequest
constructor
A new instance of V3ChangeCampaignDatesRequest.
Methods inherited from BaseModel
Constructor Details
#initialize(start_date = nil, end_date = nil, campaign_time_window_list = SKIP) ⇒ V3ChangeCampaignDatesRequest
Returns a new instance of V3ChangeCampaignDatesRequest.
45 46 47 48 49 50 51 52 53 |
# File 'lib/verizon/models/v3_change_campaign_dates_request.rb', line 45 def initialize(start_date = nil, end_date = nil, campaign_time_window_list = SKIP) @start_date = start_date @end_date = end_date unless campaign_time_window_list == SKIP @campaign_time_window_list = campaign_time_window_list end end |
Instance Attribute Details
#campaign_time_window_list ⇒ Array[V3TimeWindow]
List of allowed campaign time windows.
22 23 24 |
# File 'lib/verizon/models/v3_change_campaign_dates_request.rb', line 22 def campaign_time_window_list @campaign_time_window_list end |
#end_date ⇒ Date
Campaign end date.
18 19 20 |
# File 'lib/verizon/models/v3_change_campaign_dates_request.rb', line 18 def end_date @end_date end |
#start_date ⇒ Date
Campaign start date.
14 15 16 |
# File 'lib/verizon/models/v3_change_campaign_dates_request.rb', line 14 def start_date @start_date end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/verizon/models/v3_change_campaign_dates_request.rb', line 56 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. start_date = hash.key?('startDate') ? hash['startDate'] : nil end_date = hash.key?('endDate') ? hash['endDate'] : nil # Parameter is an array, so we need to iterate through it campaign_time_window_list = nil unless hash['campaignTimeWindowList'].nil? campaign_time_window_list = [] hash['campaignTimeWindowList'].each do |structure| campaign_time_window_list << (V3TimeWindow.from_hash(structure) if structure) end end campaign_time_window_list = SKIP unless hash.key?('campaignTimeWindowList') # Create object from extracted values. V3ChangeCampaignDatesRequest.new(start_date, end_date, campaign_time_window_list) end |
.names ⇒ Object
A mapping from model property names to API property names.
25 26 27 28 29 30 31 |
# File 'lib/verizon/models/v3_change_campaign_dates_request.rb', line 25 def self.names @_hash = {} if @_hash.nil? @_hash['start_date'] = 'startDate' @_hash['end_date'] = 'endDate' @_hash['campaign_time_window_list'] = 'campaignTimeWindowList' @_hash end |
.nullables ⇒ Object
An array for nullable fields
41 42 43 |
# File 'lib/verizon/models/v3_change_campaign_dates_request.rb', line 41 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
34 35 36 37 38 |
# File 'lib/verizon/models/v3_change_campaign_dates_request.rb', line 34 def self.optionals %w[ campaign_time_window_list ] end |