encode<V> static method

V encode<V>(
  1. AccountSession instance,
  2. Encoder<V> encoder
)

Implementation

static V encode<V>(
  AccountSession instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  container.encodeString(
    'account',
    instance.account,
  );
  container.encodeString(
    'client_secret',
    instance.clientSecret,
  );
  ConnectEmbeddedAccountSessionCreateComponents.encode(
    instance.components,
    container.nestedSingleValueContainer('components').encoder,
  );
  container.encodeDateTime(
    'expires_at',
    instance.expiresAt,
  );
  container.encodeBool(
    'livemode',
    instance.livemode,
  );
  container.encodeString(
    'object',
    'account_session',
  );
  return container.value;
}