Class: SlackWebApi::ConversationsOpenSuccessSchema

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/slack_web_api/models/conversations_open_success_schema.rb

Overview

Schema for successful response from conversations.open method when opening channels, ims, mpims

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(channel:, already_open: SKIP, no_op: SKIP, additional_properties: nil) ⇒ ConversationsOpenSuccessSchema

Returns a new instance of ConversationsOpenSuccessSchema.



52
53
54
55
56
57
58
59
60
61
62
# File 'lib/slack_web_api/models/conversations_open_success_schema.rb', line 52

def initialize(channel:, already_open: SKIP, no_op: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @already_open = already_open unless already_open == SKIP
  @channel = channel
  @no_op = no_op unless no_op == SKIP
  @ok = 'True'
  @additional_properties = additional_properties
end

Instance Attribute Details

#already_openTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


15
16
17
# File 'lib/slack_web_api/models/conversations_open_success_schema.rb', line 15

def already_open
  @already_open
end

#channelObject

TODO: Write general description for this method

Returns:

  • (Object)


19
20
21
# File 'lib/slack_web_api/models/conversations_open_success_schema.rb', line 19

def channel
  @channel
end

#no_opTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


23
24
25
# File 'lib/slack_web_api/models/conversations_open_success_schema.rb', line 23

def no_op
  @no_op
end

#okString (readonly)

TODO: Write general description for this method

Returns:

  • (String)


27
28
29
# File 'lib/slack_web_api/models/conversations_open_success_schema.rb', line 27

def ok
  @ok
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/slack_web_api/models/conversations_open_success_schema.rb', line 65

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  channel = hash.key?('channel') ? hash['channel'] : nil
  already_open = hash.key?('already_open') ? hash['already_open'] : SKIP
  no_op = hash.key?('no_op') ? hash['no_op'] : SKIP

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  ConversationsOpenSuccessSchema.new(channel: channel,
                                     already_open: already_open,
                                     no_op: no_op,
                                     additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



30
31
32
33
34
35
36
37
# File 'lib/slack_web_api/models/conversations_open_success_schema.rb', line 30

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['already_open'] = 'already_open'
  @_hash['channel'] = 'channel'
  @_hash['no_op'] = 'no_op'
  @_hash['ok'] = 'ok'
  @_hash
end

.nullablesObject

An array for nullable fields



48
49
50
# File 'lib/slack_web_api/models/conversations_open_success_schema.rb', line 48

def self.nullables
  []
end

.optionalsObject

An array for optional fields



40
41
42
43
44
45
# File 'lib/slack_web_api/models/conversations_open_success_schema.rb', line 40

def self.optionals
  %w[
    already_open
    no_op
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



95
96
97
98
99
100
# File 'lib/slack_web_api/models/conversations_open_success_schema.rb', line 95

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} already_open: #{@already_open.inspect}, channel: #{@channel.inspect},"\
  " no_op: #{@no_op.inspect}, ok: #{@ok.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



88
89
90
91
92
# File 'lib/slack_web_api/models/conversations_open_success_schema.rb', line 88

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} already_open: #{@already_open}, channel: #{@channel}, no_op: #{@no_op}, ok:"\
  " #{@ok}, additional_properties: #{@additional_properties}>"
end