Class: ApiReference::EditPlan

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/api_reference/models/edit_plan.rb

Overview

EditPlan Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(metadata: SKIP, external_plan_id: SKIP, description: SKIP) ⇒ EditPlan

Returns a new instance of EditPlan.



55
56
57
58
59
# File 'lib/api_reference/models/edit_plan.rb', line 55

def initialize(metadata: SKIP, external_plan_id: SKIP, description: SKIP)
  @metadata =  unless  == SKIP
  @external_plan_id = external_plan_id unless external_plan_id == SKIP
  @description = description unless description == SKIP
end

Instance Attribute Details

#descriptionString

An optional user-defined description of the plan.

Returns:

  • (String)


26
27
28
# File 'lib/api_reference/models/edit_plan.rb', line 26

def description
  @description
end

#external_plan_idString

An optional user-defined ID for this plan resource, used throughout the system as an alias for this Plan. Use this field to identify a plan by an existing identifier in your system.

Returns:

  • (String)


22
23
24
# File 'lib/api_reference/models/edit_plan.rb', line 22

def external_plan_id
  @external_plan_id
end

#metadataHash[String, String]

User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to null, and the entire metadata mapping can be cleared by setting metadata to null.

Returns:

  • (Hash[String, String])


16
17
18
# File 'lib/api_reference/models/edit_plan.rb', line 16

def 
  @metadata
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/api_reference/models/edit_plan.rb', line 62

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   = hash.key?('metadata') ? hash['metadata'] : SKIP
  external_plan_id =
    hash.key?('external_plan_id') ? hash['external_plan_id'] : SKIP
  description = hash.key?('description') ? hash['description'] : SKIP

  # Create object from extracted values.
  EditPlan.new(metadata: ,
               external_plan_id: external_plan_id,
               description: description)
end

.namesObject

A mapping from model property names to API property names.



29
30
31
32
33
34
35
# File 'lib/api_reference/models/edit_plan.rb', line 29

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['metadata'] = 'metadata'
  @_hash['external_plan_id'] = 'external_plan_id'
  @_hash['description'] = 'description'
  @_hash
end

.nullablesObject

An array for nullable fields



47
48
49
50
51
52
53
# File 'lib/api_reference/models/edit_plan.rb', line 47

def self.nullables
  %w[
    metadata
    external_plan_id
    description
  ]
end

.optionalsObject

An array for optional fields



38
39
40
41
42
43
44
# File 'lib/api_reference/models/edit_plan.rb', line 38

def self.optionals
  %w[
    metadata
    external_plan_id
    description
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



85
86
87
88
89
# File 'lib/api_reference/models/edit_plan.rb', line 85

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} metadata: #{@metadata.inspect}, external_plan_id:"\
  " #{@external_plan_id.inspect}, description: #{@description.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



78
79
80
81
82
# File 'lib/api_reference/models/edit_plan.rb', line 78

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} metadata: #{@metadata}, external_plan_id: #{@external_plan_id},"\
  " description: #{@description}>"
end