Class: Pago::V2026_04::Models::CustomerOrganization

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])
{
  created_at: "created_at",
  modified_at: "modified_at",
  id: "id",
  name: "name",
  slug: "slug",
  avatar_url: "avatar_url",
  proration_behavior: "proration_behavior",
  allow_customer_updates: "allow_customer_updates",
  customer_portal_settings: "customer_portal_settings",
  organization_features: "organization_features"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["created_at", "modified_at", "id", "name", "slug", "avatar_url", "proration_behavior", "allow_customer_updates", "customer_portal_settings"].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(created_at:, modified_at:, id:, name:, slug:, avatar_url:, proration_behavior:, allow_customer_updates:, customer_portal_settings:, organization_features: ::Pago::UNSET) ⇒ CustomerOrganization

Returns a new instance of CustomerOrganization.

Parameters:



18310
18311
18312
18313
18314
18315
18316
18317
18318
18319
18320
18321
18322
18323
18324
18325
18326
18327
18328
18329
18330
18331
18332
18333
# File 'lib/pago/v2026_04/models.rb', line 18310

def initialize(
  created_at:,
  modified_at:,
  id:,
  name:,
  slug:,
  avatar_url:,
  proration_behavior:,
  allow_customer_updates:,
  customer_portal_settings:,
  organization_features: ::Pago::UNSET
)
  super()
  assign(:created_at, created_at)
  assign(:modified_at, modified_at)
  assign(:id, id)
  assign(:name, name)
  assign(:slug, slug)
  assign(:avatar_url, avatar_url)
  assign(:proration_behavior, proration_behavior)
  assign(:allow_customer_updates, allow_customer_updates)
  assign(:customer_portal_settings, customer_portal_settings)
  assign(:organization_features, organization_features)
end

Instance Attribute Details

#allow_customer_updatesBoolean (readonly)

Whether customers can update their subscriptions from the customer portal.

Returns:

  • (Boolean)


18302
18303
18304
# File 'lib/pago/v2026_04/models.rb', line 18302

def allow_customer_updates
  @allow_customer_updates
end

#avatar_urlString? (readonly)

Avatar URL shown in checkout, customer portal, emails etc.

Returns:

  • (String, nil)


18295
18296
18297
# File 'lib/pago/v2026_04/models.rb', line 18295

def avatar_url
  @avatar_url
end

#created_atString (readonly)

Creation timestamp of the object.

Returns:

  • (String)


18275
18276
18277
# File 'lib/pago/v2026_04/models.rb', line 18275

def created_at
  @created_at
end

#customer_portal_settingsModels::OrganizationCustomerPortalSettings (readonly)



18305
18306
18307
# File 'lib/pago/v2026_04/models.rb', line 18305

def customer_portal_settings
  @customer_portal_settings
end

#idString (readonly)

The ID of the object.

Returns:

  • (String)


18283
18284
18285
# File 'lib/pago/v2026_04/models.rb', line 18283

def id
  @id
end

#modified_atString? (readonly)

Last modification timestamp of the object.

Returns:

  • (String, nil)


18279
18280
18281
# File 'lib/pago/v2026_04/models.rb', line 18279

def modified_at
  @modified_at
end

#nameString (readonly)

Organization name shown in checkout, customer portal, emails etc.

Returns:

  • (String)


18287
18288
18289
# File 'lib/pago/v2026_04/models.rb', line 18287

def name
  @name
end

#organization_featuresModels::CustomerOrganizationFeatureSettings (readonly)



18308
18309
18310
# File 'lib/pago/v2026_04/models.rb', line 18308

def organization_features
  @organization_features
end

#proration_behaviorString (readonly)

Returns:

  • (String)


18298
18299
18300
# File 'lib/pago/v2026_04/models.rb', line 18298

def proration_behavior
  @proration_behavior
end

#slugString (readonly)

Unique organization slug in checkout, customer portal and credit card statements.

Returns:

  • (String)


18291
18292
18293
# File 'lib/pago/v2026_04/models.rb', line 18291

def slug
  @slug
end

Class Method Details

.from_json(data) ⇒ CustomerOrganization?

Parameters:

  • data (Hash, String, nil)

Returns:



18337
18338
18339
18340
18341
18342
18343
18344
18345
18346
18347
18348
18349
18350
18351
18352
18353
18354
18355
18356
18357
# File 'lib/pago/v2026_04/models.rb', line 18337

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(
      created_at: (data.key?("created_at") ? data["created_at"] : ::Pago::UNSET),
      modified_at: (data.key?("modified_at") ? data["modified_at"] : ::Pago::UNSET),
      id: (data.key?("id") ? data["id"] : ::Pago::UNSET),
      name: (data.key?("name") ? data["name"] : ::Pago::UNSET),
      slug: (data.key?("slug") ? data["slug"] : ::Pago::UNSET),
      avatar_url: (data.key?("avatar_url") ? data["avatar_url"] : ::Pago::UNSET),
      proration_behavior: (data.key?("proration_behavior") ? data["proration_behavior"] : ::Pago::UNSET),
      allow_customer_updates: (data.key?("allow_customer_updates") ? data["allow_customer_updates"] : ::Pago::UNSET),
      customer_portal_settings: (data.key?("customer_portal_settings") ? Models::OrganizationCustomerPortalSettings.from_json(data["customer_portal_settings"]) : ::Pago::UNSET),
      organization_features: (data.key?("organization_features") ? Models::CustomerOrganizationFeatureSettings.from_json(data["organization_features"]) : ::Pago::UNSET)
    ),
    data
  )
end