Class: Pago::V2026_04::Models::MemberCreateFromCustomer

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

Overview

Schema for creating a new member nested under a customer.

The customer is taken from the URL path, so it's not part of the body.

Constant Summary collapse

JSON_KEYS =

Returns:

  • (Hash[Symbol, String])
{
  email: "email",
  name: "name",
  external_id: "external_id",
  role: "role"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["email"].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(email:, name: ::Pago::UNSET, external_id: ::Pago::UNSET, role: ::Pago::UNSET) ⇒ MemberCreateFromCustomer

Returns a new instance of MemberCreateFromCustomer.

Parameters:

  • email: (String)
  • name: (String, nil) (defaults to: ::Pago::UNSET)
  • external_id: (String, nil) (defaults to: ::Pago::UNSET)
  • role: (String, nil) (defaults to: ::Pago::UNSET)


28876
28877
28878
28879
28880
28881
28882
28883
28884
28885
28886
28887
# File 'lib/pago/v2026_04/models.rb', line 28876

def initialize(
  email:,
  name: ::Pago::UNSET,
  external_id: ::Pago::UNSET,
  role: ::Pago::UNSET
)
  super()
  assign(:email, email)
  assign(:name, name)
  assign(:external_id, external_id)
  assign(:role, role)
end

Instance Attribute Details

#emailString (readonly)

The email address of the member.

Returns:

  • (String)


28863
28864
28865
# File 'lib/pago/v2026_04/models.rb', line 28863

def email
  @email
end

#external_idString? (readonly)

The ID of the member in your system. This must be unique within the customer.

Returns:

  • (String, nil)


28870
28871
28872
# File 'lib/pago/v2026_04/models.rb', line 28870

def external_id
  @external_id
end

#nameString? (readonly)

Returns:

  • (String, nil)


28866
28867
28868
# File 'lib/pago/v2026_04/models.rb', line 28866

def name
  @name
end

#roleString (readonly)

The role of the member within the customer. To assign or transfer ownership, use the member update endpoint.

Returns:

  • (String)


28874
28875
28876
# File 'lib/pago/v2026_04/models.rb', line 28874

def role
  @role
end

Class Method Details

.from_json(data) ⇒ MemberCreateFromCustomer?

Parameters:

  • data (Hash, String, nil)

Returns:



28891
28892
28893
28894
28895
28896
28897
28898
28899
28900
28901
28902
28903
28904
28905
# File 'lib/pago/v2026_04/models.rb', line 28891

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(
      email: (data.key?("email") ? data["email"] : ::Pago::UNSET),
      name: (data.key?("name") ? data["name"] : ::Pago::UNSET),
      external_id: (data.key?("external_id") ? data["external_id"] : ::Pago::UNSET),
      role: (data.key?("role") ? data["role"] : ::Pago::UNSET)
    ),
    data
  )
end