Method: FeratelCheckApiClient::ServiceUsage#initialize

Defined in:
lib/feratel-check-api-client/models/service_usage.rb

#initialize(attributes = {}) ⇒ ServiceUsage

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# File 'lib/feratel-check-api-client/models/service_usage.rb', line 105

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `FeratelCheckApiClient::ServiceUsage` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `FeratelCheckApiClient::ServiceUsage`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'auto_exit')
    self.auto_exit = attributes[:'auto_exit']
  end

  if attributes.key?(:'auto_exit_interval')
    self.auto_exit_interval = attributes[:'auto_exit_interval']
  end

  if attributes.key?(:'count_n')
    self.count_n = attributes[:'count_n']
  end

  if attributes.key?(:'count_m')
    self.count_m = attributes[:'count_m']
  end

  if attributes.key?(:'double_use_timeout')
    self.double_use_timeout = attributes[:'double_use_timeout']
  end

  if attributes.key?(:'from_date')
    self.from_date = attributes[:'from_date']
  end

  if attributes.key?(:'not_usable_on_first_or_last_day')
    self.not_usable_on_first_or_last_day = attributes[:'not_usable_on_first_or_last_day']
  end

  if attributes.key?(:'to_date')
    self.to_date = attributes[:'to_date']
  end

  if attributes.key?(:'type')
    self.type = attributes[:'type']
  end

  if attributes.key?(:'week')
    self.week = attributes[:'week']
  end
end