Class: DatadogAPIClient::V1::ImageWidgetDefinition

Inherits:
Object
  • Object
show all
Defined in:
lib/datadog_api_client/v1/models/image_widget_definition.rb

Overview

The image widget allows you to embed an image on your dashboard. An image can be a PNG, JPG, or animated GIF. Only available on FREE layout dashboards.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ImageWidgetDefinition

Initializes the object

Parameters:

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

    attributes Model attributes in the form of hash



95
96
97
98
99
100
101
102
103
104
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
# File 'lib/datadog_api_client/v1/models/image_widget_definition.rb', line 95

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

  if attributes.key?(:'has_border')
    self.has_border = attributes[:'has_border']
  else
    self.has_border = true
  end

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

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

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

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

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

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

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

Instance Attribute Details

#has_backgroundObject

Whether to display a background or not.



27
28
29
# File 'lib/datadog_api_client/v1/models/image_widget_definition.rb', line 27

def has_background
  @has_background
end

#has_borderObject

Whether to display a border or not.



30
31
32
# File 'lib/datadog_api_client/v1/models/image_widget_definition.rb', line 30

def has_border
  @has_border
end

#horizontal_alignObject

Returns the value of attribute horizontal_align.



32
33
34
# File 'lib/datadog_api_client/v1/models/image_widget_definition.rb', line 32

def horizontal_align
  @horizontal_align
end

#marginObject

Returns the value of attribute margin.



34
35
36
# File 'lib/datadog_api_client/v1/models/image_widget_definition.rb', line 34

def margin
  @margin
end

#sizingObject

Returns the value of attribute sizing.



36
37
38
# File 'lib/datadog_api_client/v1/models/image_widget_definition.rb', line 36

def sizing
  @sizing
end

#typeObject

Returns the value of attribute type.



38
39
40
# File 'lib/datadog_api_client/v1/models/image_widget_definition.rb', line 38

def type
  @type
end

#urlObject

URL of the image.



41
42
43
# File 'lib/datadog_api_client/v1/models/image_widget_definition.rb', line 41

def url
  @url
end

#url_dark_themeObject

URL of the image in dark mode.



44
45
46
# File 'lib/datadog_api_client/v1/models/image_widget_definition.rb', line 44

def url_dark_theme
  @url_dark_theme
end

#vertical_alignObject

Returns the value of attribute vertical_align.



46
47
48
# File 'lib/datadog_api_client/v1/models/image_widget_definition.rb', line 46

def vertical_align
  @vertical_align
end