Class: Pago::V2026_04::Models::BenefitSlackSharedChannelProperties

Inherits:
Model
  • Object
show all
Defined in:
lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs

Constant Summary collapse

JSON_KEYS =

Returns:

  • (Hash[Symbol, String])
{
  slack_integration_id: "slack_integration_id",
  channel_name_template: "channel_name_template",
  private: "private",
  welcome_message: "welcome_message",
  archive_on_revoke: "archive_on_revoke",
  team_invitees: "team_invitees"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["slack_integration_id", "channel_name_template"].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Model

#==, #[], #field_set?, #hash, #inspect, json_keys, required_json_keys, #to_json, #to_json_hash, wrap_raw

Constructor Details

#initialize(slack_integration_id:, channel_name_template:, private: ::Pago::UNSET, welcome_message: ::Pago::UNSET, archive_on_revoke: ::Pago::UNSET, team_invitees: ::Pago::UNSET) ⇒ BenefitSlackSharedChannelProperties

Returns a new instance of BenefitSlackSharedChannelProperties.

Parameters:

  • slack_integration_id: (String)
  • channel_name_template: (String)
  • private: (Boolean, nil) (defaults to: ::Pago::UNSET)
  • welcome_message: (String, nil) (defaults to: ::Pago::UNSET)
  • archive_on_revoke: (Boolean, nil) (defaults to: ::Pago::UNSET)
  • team_invitees: (Array[String], nil) (defaults to: ::Pago::UNSET)


8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
# File 'lib/pago/v2026_04/models.rb', line 8383

def initialize(
  slack_integration_id:,
  channel_name_template:,
  private: ::Pago::UNSET,
  welcome_message: ::Pago::UNSET,
  archive_on_revoke: ::Pago::UNSET,
  team_invitees: ::Pago::UNSET
)
  super()
  assign(:slack_integration_id, slack_integration_id)
  assign(:channel_name_template, channel_name_template)
  assign(:private, private)
  assign(:welcome_message, welcome_message)
  assign(:archive_on_revoke, archive_on_revoke)
  assign(:team_invitees, team_invitees)
end

Instance Attribute Details

#archive_on_revokeBoolean (readonly)

Archive the channel when the benefit is revoked.

Returns:

  • (Boolean)


8377
8378
8379
# File 'lib/pago/v2026_04/models.rb', line 8377

def archive_on_revoke
  @archive_on_revoke
end

#channel_name_templateString (readonly)

Template for the channel name. Supports placeholders: customer_name, customer_email_local, and Pago::V2026_04::Models::BenefitSlackSharedChannelProperties.metadatametadata.<key> for any value stored in customer user metadata.

Returns:

  • (String)


8365
8366
8367
# File 'lib/pago/v2026_04/models.rb', line 8365

def channel_name_template
  @channel_name_template
end

#privateBoolean (readonly)

Create the channel as private (recommended).

Returns:

  • (Boolean)


8369
8370
8371
# File 'lib/pago/v2026_04/models.rb', line 8369

def private
  @private
end

#slack_integration_idString (readonly)

Pago Slack integration linked to this benefit.

Returns:

  • (String)


8361
8362
8363
# File 'lib/pago/v2026_04/models.rb', line 8361

def slack_integration_id
  @slack_integration_id
end

#team_inviteesArray<String> (readonly)

Slack user IDs from the merchant workspace to invite to every channel created for this benefit.

Returns:

  • (Array<String>)


8381
8382
8383
# File 'lib/pago/v2026_04/models.rb', line 8381

def team_invitees
  @team_invitees
end

#welcome_messageString? (readonly)

Optional message posted to the channel right after creation.

Returns:

  • (String, nil)


8373
8374
8375
# File 'lib/pago/v2026_04/models.rb', line 8373

def welcome_message
  @welcome_message
end

Class Method Details

.from_json(data) ⇒ BenefitSlackSharedChannelProperties?

Parameters:

  • data (Hash, String, nil)

Returns:



8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
# File 'lib/pago/v2026_04/models.rb', line 8402

def self.from_json(data)
  data = ::JSON.parse(data) if data.is_a?(String)
  data = ::Pago::Serde.object(data)
  return nil if data.nil?

  wrap_raw(
    new(
      slack_integration_id: (data.key?("slack_integration_id") ? data["slack_integration_id"] : ::Pago::UNSET),
      channel_name_template: (data.key?("channel_name_template") ? data["channel_name_template"] : ::Pago::UNSET),
      private: (data.key?("private") ? data["private"] : ::Pago::UNSET),
      welcome_message: (data.key?("welcome_message") ? data["welcome_message"] : ::Pago::UNSET),
      archive_on_revoke: (data.key?("archive_on_revoke") ? data["archive_on_revoke"] : ::Pago::UNSET),
      team_invitees: (data.key?("team_invitees") ? data["team_invitees"] : ::Pago::UNSET)
    ),
    data
  )
end