Class: SlackWebApi::ConversationsOpenSuccessSchema
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- SlackWebApi::ConversationsOpenSuccessSchema
- 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
-
#already_open ⇒ TrueClass | FalseClass
TODO: Write general description for this method.
-
#channel ⇒ Object
TODO: Write general description for this method.
-
#no_op ⇒ TrueClass | FalseClass
TODO: Write general description for this method.
-
#ok ⇒ String
readonly
TODO: Write general description for this method.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(channel:, already_open: SKIP, no_op: SKIP, additional_properties: nil) ⇒ ConversationsOpenSuccessSchema
constructor
A new instance of ConversationsOpenSuccessSchema.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
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_open ⇒ TrueClass | FalseClass
TODO: Write general description for this method
15 16 17 |
# File 'lib/slack_web_api/models/conversations_open_success_schema.rb', line 15 def already_open @already_open end |
#channel ⇒ Object
TODO: Write general description for this method
19 20 21 |
# File 'lib/slack_web_api/models/conversations_open_success_schema.rb', line 19 def channel @channel end |
#no_op ⇒ TrueClass | FalseClass
TODO: Write general description for this method
23 24 25 |
# File 'lib/slack_web_api/models/conversations_open_success_schema.rb', line 23 def no_op @no_op end |
#ok ⇒ String (readonly)
TODO: Write general description for this method
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 |
.names ⇒ Object
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 |
.nullables ⇒ Object
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 |
.optionals ⇒ Object
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
#inspect ⇒ Object
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_s ⇒ Object
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 |