Class: Pago::V2026_04::Services::CustomerPortal::Seats
- Defined in:
- lib/pago/v2026_04/services/customer_portal.rb,
sig/pago/v2026_04/generated.rbs
Instance Attribute Summary
Attributes inherited from Service
Instance Method Summary collapse
- #assign_seat(body: {}) ⇒ Models::CustomerSeat
-
#list_claimed_subscriptions(page: 1, limit: 10) ⇒ Models::ListResourceCustomerSubscription
List all subscriptions where the authenticated customer has claimed a seat.
-
#list_claimed_subscriptions_each(limit: 10) {|item| ... } ⇒ Pago::Paginator
Enumerate every item of
list_claimed_subscriptions, fetching pages on demand. -
#list_seats(subscription_id: nil, order_id: nil) ⇒ Models::SeatsList
Scopes:
customer_portal:readcustomer_portal:write. - #resend_invitation(seat_id) ⇒ Models::CustomerSeat
- #revoke_seat(seat_id) ⇒ Models::CustomerSeat
Methods inherited from Service
Constructor Details
This class inherits a constructor from Pago::Service
Instance Method Details
#assign_seat(body: {}) ⇒ Models::CustomerSeat
407 408 409 410 411 412 413 414 415 416 417 418 |
# File 'lib/pago/v2026_04/services/customer_portal.rb', line 407 def assign_seat(body: {}) data = client.request( http_method: "POST", path: "/v1/customer-portal/seats", path_params: {}, query: {}, body: body, response_type: :json, errors: { 400 => Errors::AssignSeat400Error, 401 => Errors::AssignSeat401Error, 403 => Errors::AssignSeat403Error, 404 => Errors::AssignSeat404Error, 422 => Errors::HTTPValidationError } ) Models::CustomerSeat.from_json(data) end |
#list_claimed_subscriptions(page: 1, limit: 10) ⇒ Models::ListResourceCustomerSubscription
List all subscriptions where the authenticated customer has claimed a seat.
Scopes: customer_portal:read customer_portal:write
469 470 471 472 473 474 475 476 477 478 479 |
# File 'lib/pago/v2026_04/services/customer_portal.rb', line 469 def list_claimed_subscriptions(page: 1, limit: 10) data = client.request( http_method: "GET", path: "/v1/customer-portal/seats/subscriptions", path_params: {}, query: { "page" => page, "limit" => limit }, response_type: :json, errors: { 401 => Errors::ListClaimedSubscriptions401Error, 422 => Errors::HTTPValidationError } ) Models::ListResourceCustomerSubscription.from_json(data) end |
#list_claimed_subscriptions_each(limit: 10) {|item| ... } ⇒ Pago::Paginator
Enumerate every item of list_claimed_subscriptions, fetching pages on demand.
485 486 487 488 489 490 |
# File 'lib/pago/v2026_04/services/customer_portal.rb', line 485 def list_claimed_subscriptions_each(limit: 10, &block) paginator = ::Pago::Paginator.new do |page_number| list_claimed_subscriptions(page: page_number, limit: limit) end block ? paginator.each(&block) : paginator end |
#list_seats(subscription_id: nil, order_id: nil) ⇒ Models::SeatsList
Scopes: customer_portal:read customer_portal:write
387 388 389 390 391 392 393 394 395 396 397 |
# File 'lib/pago/v2026_04/services/customer_portal.rb', line 387 def list_seats(subscription_id: nil, order_id: nil) data = client.request( http_method: "GET", path: "/v1/customer-portal/seats", path_params: {}, query: { "subscription_id" => subscription_id, "order_id" => order_id }, response_type: :json, errors: { 401 => Errors::ListSeats401Error, 403 => Errors::ListSeats403Error, 404 => Errors::ListSeats404Error, 422 => Errors::HTTPValidationError } ) Models::SeatsList.from_json(data) end |
#resend_invitation(seat_id) ⇒ Models::CustomerSeat
447 448 449 450 451 452 453 454 455 456 457 |
# File 'lib/pago/v2026_04/services/customer_portal.rb', line 447 def resend_invitation(seat_id) data = client.request( http_method: "POST", path: "/v1/customer-portal/seats/{seat_id}/resend", path_params: { "seat_id" => seat_id }, query: {}, response_type: :json, errors: { 400 => Errors::ResendInvitation400Error, 401 => Errors::ResendInvitation401Error, 403 => Errors::ResendInvitation403Error, 404 => Errors::ResendInvitation404Error, 422 => Errors::HTTPValidationError } ) Models::CustomerSeat.from_json(data) end |
#revoke_seat(seat_id) ⇒ Models::CustomerSeat
427 428 429 430 431 432 433 434 435 436 437 |
# File 'lib/pago/v2026_04/services/customer_portal.rb', line 427 def revoke_seat(seat_id) data = client.request( http_method: "DELETE", path: "/v1/customer-portal/seats/{seat_id}", path_params: { "seat_id" => seat_id }, query: {}, response_type: :json, errors: { 401 => Errors::RevokeSeat401Error, 403 => Errors::RevokeSeat403Error, 404 => Errors::RevokeSeat404Error, 422 => Errors::HTTPValidationError } ) Models::CustomerSeat.from_json(data) end |