Class: CloudReactorAPIClient::AwsEcsExecutionMethod

Inherits:
Object
  • Object
show all
Defined in:
lib/cloudreactor_api_client/models/aws_ecs_execution_method.rb

Overview

AwsEcsExecutionMethods contain configuration for running Tasks in AWS ECS.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ AwsEcsExecutionMethod

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
# File 'lib/cloudreactor_api_client/models/aws_ecs_execution_method.rb', line 128

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

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

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

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

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

  if attributes.key?(:'tags')
    if (value = attributes[:'tags']).is_a?(Hash)
      self.tags = value
    end
  end

  if attributes.key?(:'subnets')
    if (value = attributes[:'subnets']).is_a?(Array)
      self.subnets = value
    end
  end

  if attributes.key?(:'subnet_infrastructure_website_urls')
    if (value = attributes[:'subnet_infrastructure_website_urls']).is_a?(Array)
      self.subnet_infrastructure_website_urls = value
    end
  end

  if attributes.key?(:'security_groups')
    if (value = attributes[:'security_groups']).is_a?(Array)
      self.security_groups = value
    end
  end

  if attributes.key?(:'security_group_infrastructure_website_urls')
    if (value = attributes[:'security_group_infrastructure_website_urls']).is_a?(Array)
      self.security_group_infrastructure_website_urls = value
    end
  end

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#allocated_cpu_unitsObject

Returns the value of attribute allocated_cpu_units.



25
26
27
# File 'lib/cloudreactor_api_client/models/aws_ecs_execution_method.rb', line 25

def allocated_cpu_units
  @allocated_cpu_units
end

#allocated_memory_mbObject

Returns the value of attribute allocated_memory_mb.



27
28
29
# File 'lib/cloudreactor_api_client/models/aws_ecs_execution_method.rb', line 27

def allocated_memory_mb
  @allocated_memory_mb
end

#assign_public_ipObject

Returns the value of attribute assign_public_ip.



39
40
41
# File 'lib/cloudreactor_api_client/models/aws_ecs_execution_method.rb', line 39

def assign_public_ip
  @assign_public_ip
end

#cluster_arnObject

Returns the value of attribute cluster_arn.



45
46
47
# File 'lib/cloudreactor_api_client/models/aws_ecs_execution_method.rb', line 45

def cluster_arn
  @cluster_arn
end

#cluster_infrastructure_website_urlObject

Returns the value of attribute cluster_infrastructure_website_url.



47
48
49
# File 'lib/cloudreactor_api_client/models/aws_ecs_execution_method.rb', line 47

def cluster_infrastructure_website_url
  @cluster_infrastructure_website_url
end

#execution_roleObject

Returns the value of attribute execution_role.



49
50
51
# File 'lib/cloudreactor_api_client/models/aws_ecs_execution_method.rb', line 49

def execution_role
  @execution_role
end

#execution_role_infrastructure_website_urlObject

Returns the value of attribute execution_role_infrastructure_website_url.



51
52
53
# File 'lib/cloudreactor_api_client/models/aws_ecs_execution_method.rb', line 51

def execution_role_infrastructure_website_url
  @execution_role_infrastructure_website_url
end

#launch_typeObject

Returns the value of attribute launch_type.



43
44
45
# File 'lib/cloudreactor_api_client/models/aws_ecs_execution_method.rb', line 43

def launch_type
  @launch_type
end

#platform_versionObject

Returns the value of attribute platform_version.



57
58
59
# File 'lib/cloudreactor_api_client/models/aws_ecs_execution_method.rb', line 57

def platform_version
  @platform_version
end

#security_group_infrastructure_website_urlsObject

Returns the value of attribute security_group_infrastructure_website_urls.



37
38
39
# File 'lib/cloudreactor_api_client/models/aws_ecs_execution_method.rb', line 37

def security_group_infrastructure_website_urls
  @security_group_infrastructure_website_urls
end

#security_groupsObject

Returns the value of attribute security_groups.



35
36
37
# File 'lib/cloudreactor_api_client/models/aws_ecs_execution_method.rb', line 35

def security_groups
  @security_groups
end

#subnet_infrastructure_website_urlsObject

Returns the value of attribute subnet_infrastructure_website_urls.



33
34
35
# File 'lib/cloudreactor_api_client/models/aws_ecs_execution_method.rb', line 33

def subnet_infrastructure_website_urls
  @subnet_infrastructure_website_urls
end

#subnetsObject

Returns the value of attribute subnets.



31
32
33
# File 'lib/cloudreactor_api_client/models/aws_ecs_execution_method.rb', line 31

def subnets
  @subnets
end

#tagsObject

Returns the value of attribute tags.



29
30
31
# File 'lib/cloudreactor_api_client/models/aws_ecs_execution_method.rb', line 29

def tags
  @tags
end

#task_arnObject

Returns the value of attribute task_arn.



41
42
43
# File 'lib/cloudreactor_api_client/models/aws_ecs_execution_method.rb', line 41

def task_arn
  @task_arn
end

#task_definition_arnObject

Returns the value of attribute task_definition_arn.



21
22
23
# File 'lib/cloudreactor_api_client/models/aws_ecs_execution_method.rb', line 21

def task_definition_arn
  @task_definition_arn
end

#task_definition_infrastructure_website_urlObject

Returns the value of attribute task_definition_infrastructure_website_url.



23
24
25
# File 'lib/cloudreactor_api_client/models/aws_ecs_execution_method.rb', line 23

def task_definition_infrastructure_website_url
  @task_definition_infrastructure_website_url
end

#task_roleObject

Returns the value of attribute task_role.



53
54
55
# File 'lib/cloudreactor_api_client/models/aws_ecs_execution_method.rb', line 53

def task_role
  @task_role
end

#task_role_infrastructure_website_urlObject

Returns the value of attribute task_role_infrastructure_website_url.



55
56
57
# File 'lib/cloudreactor_api_client/models/aws_ecs_execution_method.rb', line 55

def task_role_infrastructure_website_url
  @task_role_infrastructure_website_url
end

#typeObject

Returns the value of attribute type.



19
20
21
# File 'lib/cloudreactor_api_client/models/aws_ecs_execution_method.rb', line 19

def type
  @type
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



86
87
88
# File 'lib/cloudreactor_api_client/models/aws_ecs_execution_method.rb', line 86

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/cloudreactor_api_client/models/aws_ecs_execution_method.rb', line 60

def self.attribute_map
  {
    :'type' => :'type',
    :'task_definition_arn' => :'task_definition_arn',
    :'task_definition_infrastructure_website_url' => :'task_definition_infrastructure_website_url',
    :'allocated_cpu_units' => :'allocated_cpu_units',
    :'allocated_memory_mb' => :'allocated_memory_mb',
    :'tags' => :'tags',
    :'subnets' => :'subnets',
    :'subnet_infrastructure_website_urls' => :'subnet_infrastructure_website_urls',
    :'security_groups' => :'security_groups',
    :'security_group_infrastructure_website_urls' => :'security_group_infrastructure_website_urls',
    :'assign_public_ip' => :'assign_public_ip',
    :'task_arn' => :'task_arn',
    :'launch_type' => :'launch_type',
    :'cluster_arn' => :'cluster_arn',
    :'cluster_infrastructure_website_url' => :'cluster_infrastructure_website_url',
    :'execution_role' => :'execution_role',
    :'execution_role_infrastructure_website_url' => :'execution_role_infrastructure_website_url',
    :'task_role' => :'task_role',
    :'task_role_infrastructure_website_url' => :'task_role_infrastructure_website_url',
    :'platform_version' => :'platform_version'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



377
378
379
# File 'lib/cloudreactor_api_client/models/aws_ecs_execution_method.rb', line 377

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_nullableObject

List of attributes with nullable: true



117
118
119
120
121
122
123
124
# File 'lib/cloudreactor_api_client/models/aws_ecs_execution_method.rb', line 117

def self.openapi_nullable
  Set.new([
    :'tags',
    :'subnet_infrastructure_website_urls',
    :'security_group_infrastructure_website_urls',
    :'launch_type',
  ])
end

.openapi_typesObject

Attribute type mapping.



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/cloudreactor_api_client/models/aws_ecs_execution_method.rb', line 91

def self.openapi_types
  {
    :'type' => :'String',
    :'task_definition_arn' => :'String',
    :'task_definition_infrastructure_website_url' => :'String',
    :'allocated_cpu_units' => :'Integer',
    :'allocated_memory_mb' => :'Integer',
    :'tags' => :'Hash<String, String>',
    :'subnets' => :'Array<String>',
    :'subnet_infrastructure_website_urls' => :'Array<String>',
    :'security_groups' => :'Array<String>',
    :'security_group_infrastructure_website_urls' => :'Array<String>',
    :'assign_public_ip' => :'Boolean',
    :'task_arn' => :'String',
    :'launch_type' => :'AwsEcsLaunchType',
    :'cluster_arn' => :'String',
    :'cluster_infrastructure_website_url' => :'String',
    :'execution_role' => :'String',
    :'execution_role_infrastructure_website_url' => :'String',
    :'task_role' => :'String',
    :'task_role_infrastructure_website_url' => :'String',
    :'platform_version' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
# File 'lib/cloudreactor_api_client/models/aws_ecs_execution_method.rb', line 337

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      type == o.type &&
      task_definition_arn == o.task_definition_arn &&
      task_definition_infrastructure_website_url == o.task_definition_infrastructure_website_url &&
      allocated_cpu_units == o.allocated_cpu_units &&
      allocated_memory_mb == o.allocated_memory_mb &&
      tags == o.tags &&
      subnets == o.subnets &&
      subnet_infrastructure_website_urls == o.subnet_infrastructure_website_urls &&
      security_groups == o.security_groups &&
      security_group_infrastructure_website_urls == o.security_group_infrastructure_website_urls &&
      assign_public_ip == o.assign_public_ip &&
      task_arn == o.task_arn &&
      launch_type == o.launch_type &&
      cluster_arn == o.cluster_arn &&
      cluster_infrastructure_website_url == o.cluster_infrastructure_website_url &&
      execution_role == o.execution_role &&
      execution_role_infrastructure_website_url == o.execution_role_infrastructure_website_url &&
      task_role == o.task_role &&
      task_role_infrastructure_website_url == o.task_role_infrastructure_website_url &&
      platform_version == o.platform_version
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
# File 'lib/cloudreactor_api_client/models/aws_ecs_execution_method.rb', line 407

def _deserialize(type, value)
  case type.to_sym
  when :Time
    Time.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    # models (e.g. Pet) or oneOf
    klass = CloudReactorAPIClient.const_get(type)
    klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



478
479
480
481
482
483
484
485
486
487
488
489
490
# File 'lib/cloudreactor_api_client/models/aws_ecs_execution_method.rb', line 478

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
# File 'lib/cloudreactor_api_client/models/aws_ecs_execution_method.rb', line 384

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.openapi_types.each_pair do |key, type|
    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
      self.send("#{key}=", nil)
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


364
365
366
# File 'lib/cloudreactor_api_client/models/aws_ecs_execution_method.rb', line 364

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



370
371
372
# File 'lib/cloudreactor_api_client/models/aws_ecs_execution_method.rb', line 370

def hash
  [type, task_definition_arn, task_definition_infrastructure_website_url, allocated_cpu_units, allocated_memory_mb, tags, subnets, subnet_infrastructure_website_urls, security_groups, security_group_infrastructure_website_urls, assign_public_ip, task_arn, launch_type, cluster_arn, cluster_infrastructure_website_url, execution_role, execution_role_infrastructure_website_url, task_role, task_role_infrastructure_website_url, platform_version].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
# File 'lib/cloudreactor_api_client/models/aws_ecs_execution_method.rb', line 234

def list_invalid_properties
  invalid_properties = Array.new
  if !@task_definition_arn.nil? && @task_definition_arn.to_s.length > 1000
    invalid_properties.push('invalid value for "task_definition_arn", the character length must be smaller than or equal to 1000.')
  end

  if !@task_arn.nil? && @task_arn.to_s.length > 1000
    invalid_properties.push('invalid value for "task_arn", the character length must be smaller than or equal to 1000.')
  end

  if !@cluster_arn.nil? && @cluster_arn.to_s.length > 1000
    invalid_properties.push('invalid value for "cluster_arn", the character length must be smaller than or equal to 1000.')
  end

  if !@execution_role.nil? && @execution_role.to_s.length > 1000
    invalid_properties.push('invalid value for "execution_role", the character length must be smaller than or equal to 1000.')
  end

  if !@task_role.nil? && @task_role.to_s.length > 1000
    invalid_properties.push('invalid value for "task_role", the character length must be smaller than or equal to 1000.')
  end

  if !@platform_version.nil? && @platform_version.to_s.length > 10
    invalid_properties.push('invalid value for "platform_version", the character length must be smaller than or equal to 10.')
  end

  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



454
455
456
# File 'lib/cloudreactor_api_client/models/aws_ecs_execution_method.rb', line 454

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



460
461
462
463
464
465
466
467
468
469
470
471
472
# File 'lib/cloudreactor_api_client/models/aws_ecs_execution_method.rb', line 460

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



448
449
450
# File 'lib/cloudreactor_api_client/models/aws_ecs_execution_method.rb', line 448

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



265
266
267
268
269
270
271
272
273
# File 'lib/cloudreactor_api_client/models/aws_ecs_execution_method.rb', line 265

def valid?
  return false if !@task_definition_arn.nil? && @task_definition_arn.to_s.length > 1000
  return false if !@task_arn.nil? && @task_arn.to_s.length > 1000
  return false if !@cluster_arn.nil? && @cluster_arn.to_s.length > 1000
  return false if !@execution_role.nil? && @execution_role.to_s.length > 1000
  return false if !@task_role.nil? && @task_role.to_s.length > 1000
  return false if !@platform_version.nil? && @platform_version.to_s.length > 10
  true
end