list_billing_view_segments
¶
list_billing_view_segments(
*,
config_overrides: Optional[BillingClientConfig] = None,
time_range: Optional[BillingViewSegmentTimeRange] = None,
arn: Optional[BillingViewArn] = None,
max_results: Optional[BillingViewsMaxResults] = None,
next_token: Optional[PageToken] = None,
) -> ListBillingViewSegmentsResponse
Lists the segments of a billing view over a given time period. Each segment identifies the billing domain (PRO_FORMA or BILLABLE) and the account relationships that apply during its time range.
If you don't provide an arn, the response includes segments for the caller's PRIMARY billing view.
If a mid-period change occurs, the response includes multiple segments, each with its own time range. The response omits hidden segments, so the segments it returns might not cover the entire requested time period.
Parameters:
-
time_range(Optional[BillingViewSegmentTimeRange], default:None) –The billing period to query. If you don't provide a time range, the current billing period, which is the calendar month in UTC, is used.
-
arn(Optional[BillingViewArn], default:None) –The Amazon Resource Name (ARN) that uniquely identifies the billing view to query. If you don't provide an ARN, the caller's
PRIMARYbilling view is used. The ARN must reference a primary billing view. Custom billing views aren't supported. -
max_results(Optional[BillingViewsMaxResults], default:None) –The number of entries a paginated response contains. Valid values range from 1 to 100. The default is 100.
-
next_token(Optional[PageToken], default:None) –The pagination token that is used on subsequent calls to list billing view segments.
Raises:
-
AccessDeniedException–You don't have sufficient access to perform this action.
-
BillingViewHealthStatusException–Exception thrown when a billing view's health status prevents an operation from being performed. This may occur if the billing view is in a state other than
HEALTHY. -
InternalServerException–The request processing failed because of an unknown error, exception, or failure.
-
ResourceNotFoundException–The specified ARN in the request doesn't exist.
-
ThrottlingException–The request was denied due to request throttling.
-
ValidationException–The input fails to satisfy the constraints specified by an Amazon Web Services service.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
Invoke ListBillingViewSegments
>>> client.list_billing_view_segments(time_range={'beginDateInclusive': 1719792000, 'endDateExclusive': 1722470400})
Error example for ListBillingViewSegments
>>> client.list_billing_view_segments(time_range={'beginDateInclusive': 1722470400, 'endDateExclusive': 1719792000})
Source code in docs_src/capo_billing/_services/billing.py
1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 | |