Class: SlackWebApi::TeamObject

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

Overview

TeamObject 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(domain:, email_domain:, icon:, id:, name:, archived: SKIP, avatar_base_url: SKIP, created: SKIP, date_create: SKIP, deleted: SKIP, description: SKIP, discoverable: SKIP, enterprise_id: SKIP, enterprise_name: SKIP, external_org_migrations: SKIP, has_compliance_export: SKIP, is_assigned: SKIP, is_enterprise: SKIP, is_over_storage_limit: SKIP, limit_ts: SKIP, locale: SKIP, messages_count: SKIP, msg_edit_window_mins: SKIP, over_integrations_limit: SKIP, over_storage_limit: SKIP, pay_prod_cur: SKIP, plan: SKIP, primary_owner: SKIP, sso_provider: SKIP, additional_properties: nil) ⇒ TeamObject

Returns a new instance of TeamObject.



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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
# File 'lib/slack_web_api/models/team_object.rb', line 200

def initialize(domain:, email_domain:, icon:, id:, name:, archived: SKIP,
               avatar_base_url: SKIP, created: SKIP, date_create: SKIP,
               deleted: SKIP, description: SKIP, discoverable: SKIP,
               enterprise_id: SKIP, enterprise_name: SKIP,
               external_org_migrations: SKIP, has_compliance_export: SKIP,
               is_assigned: SKIP, is_enterprise: SKIP,
               is_over_storage_limit: SKIP, limit_ts: SKIP, locale: SKIP,
               messages_count: SKIP, msg_edit_window_mins: SKIP,
               over_integrations_limit: SKIP, over_storage_limit: SKIP,
               pay_prod_cur: SKIP, plan: SKIP, primary_owner: SKIP,
               sso_provider: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @archived = archived unless archived == SKIP
  @avatar_base_url = avatar_base_url unless avatar_base_url == SKIP
  @created = created unless created == SKIP
  @date_create = date_create unless date_create == SKIP
  @deleted = deleted unless deleted == SKIP
  @description = description unless description == SKIP
  @discoverable = discoverable unless discoverable == SKIP
  @domain = domain
  @email_domain = email_domain
  @enterprise_id = enterprise_id unless enterprise_id == SKIP
  @enterprise_name = enterprise_name unless enterprise_name == SKIP
  @external_org_migrations = external_org_migrations unless external_org_migrations == SKIP
  @has_compliance_export = has_compliance_export unless has_compliance_export == SKIP
  @icon = icon
  @id = id
  @is_assigned = is_assigned unless is_assigned == SKIP
  @is_enterprise = is_enterprise unless is_enterprise == SKIP
  @is_over_storage_limit = is_over_storage_limit unless is_over_storage_limit == SKIP
  @limit_ts = limit_ts unless limit_ts == SKIP
  @locale = locale unless locale == SKIP
  @messages_count = messages_count unless messages_count == SKIP
  @msg_edit_window_mins = msg_edit_window_mins unless msg_edit_window_mins == SKIP
  @name = name
  @over_integrations_limit = over_integrations_limit unless over_integrations_limit == SKIP
  @over_storage_limit = over_storage_limit unless over_storage_limit == SKIP
  @pay_prod_cur = pay_prod_cur unless pay_prod_cur == SKIP
  @plan = plan unless plan == SKIP
  @primary_owner = primary_owner unless primary_owner == SKIP
  @sso_provider = sso_provider unless sso_provider == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#archivedTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


14
15
16
# File 'lib/slack_web_api/models/team_object.rb', line 14

def archived
  @archived
end

#avatar_base_urlString

TODO: Write general description for this method

Returns:

  • (String)


18
19
20
# File 'lib/slack_web_api/models/team_object.rb', line 18

def avatar_base_url
  @avatar_base_url
end

#createdInteger

TODO: Write general description for this method

Returns:

  • (Integer)


22
23
24
# File 'lib/slack_web_api/models/team_object.rb', line 22

def created
  @created
end

#date_createInteger

TODO: Write general description for this method

Returns:

  • (Integer)


26
27
28
# File 'lib/slack_web_api/models/team_object.rb', line 26

def date_create
  @date_create
end

#deletedTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


30
31
32
# File 'lib/slack_web_api/models/team_object.rb', line 30

def deleted
  @deleted
end

#descriptionString

TODO: Write general description for this method

Returns:

  • (String)


34
35
36
# File 'lib/slack_web_api/models/team_object.rb', line 34

def description
  @description
end

#discoverableObject

TODO: Write general description for this method

Returns:

  • (Object)


38
39
40
# File 'lib/slack_web_api/models/team_object.rb', line 38

def discoverable
  @discoverable
end

#domainString

TODO: Write general description for this method

Returns:

  • (String)


42
43
44
# File 'lib/slack_web_api/models/team_object.rb', line 42

def domain
  @domain
end

#email_domainString

TODO: Write general description for this method

Returns:

  • (String)


46
47
48
# File 'lib/slack_web_api/models/team_object.rb', line 46

def email_domain
  @email_domain
end

#enterprise_idString

TODO: Write general description for this method

Returns:

  • (String)


50
51
52
# File 'lib/slack_web_api/models/team_object.rb', line 50

def enterprise_id
  @enterprise_id
end

#enterprise_nameString

TODO: Write general description for this method

Returns:

  • (String)


54
55
56
# File 'lib/slack_web_api/models/team_object.rb', line 54

def enterprise_name
  @enterprise_name
end

#external_org_migrationsExternalOrgMigrations

TODO: Write general description for this method



58
59
60
# File 'lib/slack_web_api/models/team_object.rb', line 58

def external_org_migrations
  @external_org_migrations
end

#has_compliance_exportTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


62
63
64
# File 'lib/slack_web_api/models/team_object.rb', line 62

def has_compliance_export
  @has_compliance_export
end

#iconObjsIcon

TODO: Write general description for this method

Returns:



66
67
68
# File 'lib/slack_web_api/models/team_object.rb', line 66

def icon
  @icon
end

#idString

TODO: Write general description for this method

Returns:

  • (String)


70
71
72
# File 'lib/slack_web_api/models/team_object.rb', line 70

def id
  @id
end

#is_assignedTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


74
75
76
# File 'lib/slack_web_api/models/team_object.rb', line 74

def is_assigned
  @is_assigned
end

#is_enterpriseInteger

TODO: Write general description for this method

Returns:

  • (Integer)


78
79
80
# File 'lib/slack_web_api/models/team_object.rb', line 78

def is_enterprise
  @is_enterprise
end

#is_over_storage_limitTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


82
83
84
# File 'lib/slack_web_api/models/team_object.rb', line 82

def is_over_storage_limit
  @is_over_storage_limit
end

#limit_tsInteger

TODO: Write general description for this method

Returns:

  • (Integer)


86
87
88
# File 'lib/slack_web_api/models/team_object.rb', line 86

def limit_ts
  @limit_ts
end

#localeString

TODO: Write general description for this method

Returns:

  • (String)


90
91
92
# File 'lib/slack_web_api/models/team_object.rb', line 90

def locale
  @locale
end

#messages_countInteger

TODO: Write general description for this method

Returns:

  • (Integer)


94
95
96
# File 'lib/slack_web_api/models/team_object.rb', line 94

def messages_count
  @messages_count
end

#msg_edit_window_minsInteger

TODO: Write general description for this method

Returns:

  • (Integer)


98
99
100
# File 'lib/slack_web_api/models/team_object.rb', line 98

def msg_edit_window_mins
  @msg_edit_window_mins
end

#nameString

TODO: Write general description for this method

Returns:

  • (String)


102
103
104
# File 'lib/slack_web_api/models/team_object.rb', line 102

def name
  @name
end

#over_integrations_limitTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


106
107
108
# File 'lib/slack_web_api/models/team_object.rb', line 106

def over_integrations_limit
  @over_integrations_limit
end

#over_storage_limitTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


110
111
112
# File 'lib/slack_web_api/models/team_object.rb', line 110

def over_storage_limit
  @over_storage_limit
end

#pay_prod_curString

TODO: Write general description for this method

Returns:

  • (String)


114
115
116
# File 'lib/slack_web_api/models/team_object.rb', line 114

def pay_prod_cur
  @pay_prod_cur
end

#planPlan

TODO: Write general description for this method

Returns:



118
119
120
# File 'lib/slack_web_api/models/team_object.rb', line 118

def plan
  @plan
end

#primary_ownerObjsPrimaryOwner

TODO: Write general description for this method

Returns:



122
123
124
# File 'lib/slack_web_api/models/team_object.rb', line 122

def primary_owner
  @primary_owner
end

#sso_providerSsoProvider

TODO: Write general description for this method

Returns:



126
127
128
# File 'lib/slack_web_api/models/team_object.rb', line 126

def sso_provider
  @sso_provider
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
# File 'lib/slack_web_api/models/team_object.rb', line 247

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  domain = hash.key?('domain') ? hash['domain'] : nil
  email_domain = hash.key?('email_domain') ? hash['email_domain'] : nil
  icon = ObjsIcon.from_hash(hash['icon']) if hash['icon']
  id = hash.key?('id') ? hash['id'] : nil
  name = hash.key?('name') ? hash['name'] : nil
  archived = hash.key?('archived') ? hash['archived'] : SKIP
  avatar_base_url =
    hash.key?('avatar_base_url') ? hash['avatar_base_url'] : SKIP
  created = hash.key?('created') ? hash['created'] : SKIP
  date_create = hash.key?('date_create') ? hash['date_create'] : SKIP
  deleted = hash.key?('deleted') ? hash['deleted'] : SKIP
  description = hash.key?('description') ? hash['description'] : SKIP
  discoverable = hash.key?('discoverable') ? hash['discoverable'] : SKIP
  enterprise_id = hash.key?('enterprise_id') ? hash['enterprise_id'] : SKIP
  enterprise_name =
    hash.key?('enterprise_name') ? hash['enterprise_name'] : SKIP
  external_org_migrations = ExternalOrgMigrations.from_hash(hash['external_org_migrations']) if
    hash['external_org_migrations']
  has_compliance_export =
    hash.key?('has_compliance_export') ? hash['has_compliance_export'] : SKIP
  is_assigned = hash.key?('is_assigned') ? hash['is_assigned'] : SKIP
  is_enterprise = hash.key?('is_enterprise') ? hash['is_enterprise'] : SKIP
  is_over_storage_limit =
    hash.key?('is_over_storage_limit') ? hash['is_over_storage_limit'] : SKIP
  limit_ts = hash.key?('limit_ts') ? hash['limit_ts'] : SKIP
  locale = hash.key?('locale') ? hash['locale'] : SKIP
  messages_count =
    hash.key?('messages_count') ? hash['messages_count'] : SKIP
  msg_edit_window_mins =
    hash.key?('msg_edit_window_mins') ? hash['msg_edit_window_mins'] : SKIP
  over_integrations_limit =
    hash.key?('over_integrations_limit') ? hash['over_integrations_limit'] : SKIP
  over_storage_limit =
    hash.key?('over_storage_limit') ? hash['over_storage_limit'] : SKIP
  pay_prod_cur = hash.key?('pay_prod_cur') ? hash['pay_prod_cur'] : SKIP
  plan = hash.key?('plan') ? hash['plan'] : SKIP
  primary_owner = ObjsPrimaryOwner.from_hash(hash['primary_owner']) if hash['primary_owner']
  sso_provider = SsoProvider.from_hash(hash['sso_provider']) if hash['sso_provider']

  # 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.
  TeamObject.new(domain: domain,
                 email_domain: email_domain,
                 icon: icon,
                 id: id,
                 name: name,
                 archived: archived,
                 avatar_base_url: avatar_base_url,
                 created: created,
                 date_create: date_create,
                 deleted: deleted,
                 description: description,
                 discoverable: discoverable,
                 enterprise_id: enterprise_id,
                 enterprise_name: enterprise_name,
                 external_org_migrations: external_org_migrations,
                 has_compliance_export: has_compliance_export,
                 is_assigned: is_assigned,
                 is_enterprise: is_enterprise,
                 is_over_storage_limit: is_over_storage_limit,
                 limit_ts: limit_ts,
                 locale: locale,
                 messages_count: messages_count,
                 msg_edit_window_mins: msg_edit_window_mins,
                 over_integrations_limit: over_integrations_limit,
                 over_storage_limit: over_storage_limit,
                 pay_prod_cur: pay_prod_cur,
                 plan: plan,
                 primary_owner: primary_owner,
                 sso_provider: sso_provider,
                 additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



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
# File 'lib/slack_web_api/models/team_object.rb', line 129

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['archived'] = 'archived'
  @_hash['avatar_base_url'] = 'avatar_base_url'
  @_hash['created'] = 'created'
  @_hash['date_create'] = 'date_create'
  @_hash['deleted'] = 'deleted'
  @_hash['description'] = 'description'
  @_hash['discoverable'] = 'discoverable'
  @_hash['domain'] = 'domain'
  @_hash['email_domain'] = 'email_domain'
  @_hash['enterprise_id'] = 'enterprise_id'
  @_hash['enterprise_name'] = 'enterprise_name'
  @_hash['external_org_migrations'] = 'external_org_migrations'
  @_hash['has_compliance_export'] = 'has_compliance_export'
  @_hash['icon'] = 'icon'
  @_hash['id'] = 'id'
  @_hash['is_assigned'] = 'is_assigned'
  @_hash['is_enterprise'] = 'is_enterprise'
  @_hash['is_over_storage_limit'] = 'is_over_storage_limit'
  @_hash['limit_ts'] = 'limit_ts'
  @_hash['locale'] = 'locale'
  @_hash['messages_count'] = 'messages_count'
  @_hash['msg_edit_window_mins'] = 'msg_edit_window_mins'
  @_hash['name'] = 'name'
  @_hash['over_integrations_limit'] = 'over_integrations_limit'
  @_hash['over_storage_limit'] = 'over_storage_limit'
  @_hash['pay_prod_cur'] = 'pay_prod_cur'
  @_hash['plan'] = 'plan'
  @_hash['primary_owner'] = 'primary_owner'
  @_hash['sso_provider'] = 'sso_provider'
  @_hash
end

.nullablesObject

An array for nullable fields



194
195
196
197
198
# File 'lib/slack_web_api/models/team_object.rb', line 194

def self.nullables
  %w[
    description
  ]
end

.optionalsObject

An array for optional fields



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
# File 'lib/slack_web_api/models/team_object.rb', line 164

def self.optionals
  %w[
    archived
    avatar_base_url
    created
    date_create
    deleted
    description
    discoverable
    enterprise_id
    enterprise_name
    external_org_migrations
    has_compliance_export
    is_assigned
    is_enterprise
    is_over_storage_limit
    limit_ts
    locale
    messages_count
    msg_edit_window_mins
    over_integrations_limit
    over_storage_limit
    pay_prod_cur
    plan
    primary_owner
    sso_provider
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
# File 'lib/slack_web_api/models/team_object.rb', line 348

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} archived: #{@archived.inspect}, avatar_base_url:"\
  " #{@avatar_base_url.inspect}, created: #{@created.inspect}, date_create:"\
  " #{@date_create.inspect}, deleted: #{@deleted.inspect}, description:"\
  " #{@description.inspect}, discoverable: #{@discoverable.inspect}, domain:"\
  " #{@domain.inspect}, email_domain: #{@email_domain.inspect}, enterprise_id:"\
  " #{@enterprise_id.inspect}, enterprise_name: #{@enterprise_name.inspect},"\
  " external_org_migrations: #{@external_org_migrations.inspect}, has_compliance_export:"\
  " #{@has_compliance_export.inspect}, icon: #{@icon.inspect}, id: #{@id.inspect},"\
  " is_assigned: #{@is_assigned.inspect}, is_enterprise: #{@is_enterprise.inspect},"\
  " is_over_storage_limit: #{@is_over_storage_limit.inspect}, limit_ts: #{@limit_ts.inspect},"\
  " locale: #{@locale.inspect}, messages_count: #{@messages_count.inspect},"\
  " msg_edit_window_mins: #{@msg_edit_window_mins.inspect}, name: #{@name.inspect},"\
  " over_integrations_limit: #{@over_integrations_limit.inspect}, over_storage_limit:"\
  " #{@over_storage_limit.inspect}, pay_prod_cur: #{@pay_prod_cur.inspect}, plan:"\
  " #{@plan.inspect}, primary_owner: #{@primary_owner.inspect}, sso_provider:"\
  " #{@sso_provider.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
# File 'lib/slack_web_api/models/team_object.rb', line 331

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} archived: #{@archived}, avatar_base_url: #{@avatar_base_url}, created:"\
  " #{@created}, date_create: #{@date_create}, deleted: #{@deleted}, description:"\
  " #{@description}, discoverable: #{@discoverable}, domain: #{@domain}, email_domain:"\
  " #{@email_domain}, enterprise_id: #{@enterprise_id}, enterprise_name: #{@enterprise_name},"\
  " external_org_migrations: #{@external_org_migrations}, has_compliance_export:"\
  " #{@has_compliance_export}, icon: #{@icon}, id: #{@id}, is_assigned: #{@is_assigned},"\
  " is_enterprise: #{@is_enterprise}, is_over_storage_limit: #{@is_over_storage_limit},"\
  " limit_ts: #{@limit_ts}, locale: #{@locale}, messages_count: #{@messages_count},"\
  " msg_edit_window_mins: #{@msg_edit_window_mins}, name: #{@name}, over_integrations_limit:"\
  " #{@over_integrations_limit}, over_storage_limit: #{@over_storage_limit}, pay_prod_cur:"\
  " #{@pay_prod_cur}, plan: #{@plan}, primary_owner: #{@primary_owner}, sso_provider:"\
  " #{@sso_provider}, additional_properties: #{@additional_properties}>"
end