Method: Fastly::LoggingLogshuttle#initialize

Defined in:
lib/fastly/models/logging_logshuttle.rb

#initialize(attributes = {}) ⇒ LoggingLogshuttle

Initializes the object



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
# File 'lib/fastly/models/logging_logshuttle.rb', line 109

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::LoggingLogshuttle` 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 `Fastly::LoggingLogshuttle`. 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?(:'name')
    self.name = attributes[:'name']
  end

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

  if attributes.key?(:'format_version')
    self.format_version = attributes[:'format_version']
  else
    self.format_version = FORMAT_VERSION::v2
  end

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

  if attributes.key?(:'format')
    self.format = attributes[:'format']
  else
    self.format = '%h %l %u %t \"%r\" %>s %b'
  end

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

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