From c84480a960916784bed8131f56c0403552d0f2a4 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 5 Aug 2024 06:37:39 +0000 Subject: [PATCH] Generated v5.6.0 --- CHANGELOG.md | 10 + README.md | 15 +- docs/Api/BillingInvoicesApi.md | 40 +- docs/Api/BillingUsageMetricsApi.md | 108 ++ docs/Api/ImageOptimizerDefaultSettingsApi.md | 2 +- docs/Api/ObservabilityCustomDashboardsApi.md | 194 ++ docs/Api/TlsCertificatesApi.md | 35 + docs/Api/TlsCsrsApi.md | 2 +- ...DnsRecordDnsRecord.md => AsyncResponse.md} | 5 +- docs/Model/CreateDashboardRequest.md | 12 + docs/Model/Dashboard.md | 17 + docs/Model/DashboardItem.md | 15 + docs/Model/DashboardItemPropertyDataSource.md | 11 + ...ardItemPropertyDataSourcePropertyConfig.md | 10 + .../DashboardItemPropertyVisualization.md | 11 + ...ItemPropertyVisualizationPropertyConfig.md | 12 + ...ecord.md => DashboardPropertyCreatedBy.md} | 3 +- ...cords.md => DashboardPropertyUpdatedBy.md} | 3 +- docs/Model/DomainInspectorMeasurements.md | 2 +- ...voiceResponse.md => EomInvoiceResponse.md} | 2 +- docs/Model/GetServiceLevelUsageResponse.md | 10 + .../GetServiceLevelUsageTypesResponse.md | 10 + docs/Model/IncludedWithTlsConfiguration.md | 10 + .../Model/IncludedWithTlsConfigurationItem.md | 12 + docs/Model/ListDashboardsResponse.md | 11 + ...Response.md => ListEomInvoicesResponse.md} | 2 +- docs/Model/MtdInvoiceResponse.md | 15 + docs/Model/Mtdinvoice.md | 15 + docs/Model/Mtdlineitems.md | 18 + docs/Model/RealtimeEntryAggregated.md | 1 + docs/Model/RealtimeMeasurements.md | 1 + .../RelationshipDefaultEcdsaTlsCertificate.md | 10 + ...saTlsCertificateDefaultEcdsaCertificate.md | 10 + ...sCertificateDefaultEcdsaCertificateData.md | 11 + .../RelationshipDefaultTlsCertificate.md | 10 + ...DefaultTlsCertificateDefaultCertificate.md | 10 + ...ultTlsCertificateDefaultCertificateData.md | 11 + .../Model/RelationshipTlsDnsRecordsRequest.md | 10 + ...ationshipTlsDnsRecordsRequestDnsRecords.md | 10 + ...nshipTlsDnsRecordsRequestDnsRecordsData.md | 11 + .../RelationshipTlsDnsRecordsResponse.md | 10 + ...tionshipTlsDnsRecordsResponseDnsRecords.md | 10 + ...hipTlsDnsRecordsResponseDnsRecordsData.md} | 2 +- docs/Model/Results.md | 1 + docs/Model/Serviceusagemetric.md | 13 + docs/Model/Serviceusagemetrics.md | 10 + docs/Model/ServiceusagemetricsData.md | 16 + docs/Model/Serviceusagetype.md | 11 + docs/Model/Serviceusagetypes.md | 10 + docs/Model/TlsCertificateBlobResponse.md | 10 + docs/Model/TlsDnsRecord.md | 5 +- docs/Model/UpdateDashboardRequest.md | 12 + docs/Model/Values.md | 2 +- lib/Api/BillingInvoicesApi.php | 430 ++++- lib/Api/BillingUsageMetricsApi.php | 1085 +++++++++++ lib/Api/ObservabilityCustomDashboardsApi.php | 1679 +++++++++++++++++ lib/Api/TlsCertificatesApi.php | 322 ++++ lib/Configuration.php | 4 +- lib/Model/AsyncResponse.php | 344 ++++ lib/Model/CreateDashboardRequest.php | 377 ++++ lib/Model/Dashboard.php | 524 +++++ lib/Model/DashboardItem.php | 523 +++++ lib/Model/DashboardItemPropertyDataSource.php | 387 ++++ ...rdItemPropertyDataSourcePropertyConfig.php | 327 ++++ .../DashboardItemPropertyVisualization.php | 383 ++++ ...temPropertyVisualizationPropertyConfig.php | 506 +++++ lib/Model/DashboardPropertyCreatedBy.php | 290 +++ lib/Model/DashboardPropertyUpdatedBy.php | 290 +++ lib/Model/DomainInspectorMeasurements.php | 2 +- ...iceResponse.php => EomInvoiceResponse.php} | 8 +- lib/Model/GetServiceLevelUsageResponse.php | 314 +++ ... => GetServiceLevelUsageTypesResponse.php} | 14 +- lib/Model/IncludedWithTlsConfiguration.php | 314 +++ .../IncludedWithTlsConfigurationItem.php | 374 ++++ lib/Model/Invoicelineitems.php | 10 +- lib/Model/ListDashboardsResponse.php | 344 ++++ ...sponse.php => ListEomInvoicesResponse.php} | 8 +- lib/Model/MtdInvoiceResponse.php | 464 +++++ lib/Model/Mtdinvoice.php | 464 +++++ lib/Model/Mtdlineitems.php | 554 ++++++ lib/Model/RealtimeEntryAggregated.php | 40 +- lib/Model/RealtimeMeasurements.php | 40 +- ...RelationshipDefaultEcdsaTlsCertificate.php | 314 +++ ...aTlsCertificateDefaultEcdsaCertificate.php | 314 +++ ...CertificateDefaultEcdsaCertificateData.php | 344 ++++ .../RelationshipDefaultTlsCertificate.php | 314 +++ ...efaultTlsCertificateDefaultCertificate.php | 314 +++ ...ltTlsCertificateDefaultCertificateData.php | 344 ++++ ...p => RelationshipTlsDnsRecordsRequest.php} | 14 +- ...ionshipTlsDnsRecordsRequestDnsRecords.php} | 36 +- ...hipTlsDnsRecordsRequestDnsRecordsData.php} | 8 +- .../RelationshipTlsDnsRecordsResponse.php | 314 +++ ...ionshipTlsDnsRecordsResponseDnsRecords.php | 314 +++ ...hipTlsDnsRecordsResponseDnsRecordsData.php | 344 ++++ lib/Model/Results.php | 30 + lib/Model/Serviceusagemetric.php | 404 ++++ lib/Model/Serviceusagemetrics.php | 314 +++ lib/Model/ServiceusagemetricsData.php | 494 +++++ lib/Model/Serviceusagetype.php | 344 ++++ lib/Model/Serviceusagetypes.php | 314 +++ lib/Model/TlsCertificateBlobResponse.php | 314 +++ lib/Model/TlsDnsRecord.php | 104 +- lib/Model/UpdateDashboardRequest.php | 374 ++++ lib/Model/Values.php | 2 +- sig.json | 2 +- 105 files changed, 16780 insertions(+), 130 deletions(-) create mode 100644 docs/Api/BillingUsageMetricsApi.md create mode 100644 docs/Api/ObservabilityCustomDashboardsApi.md rename docs/Model/{RelationshipTlsDnsRecordDnsRecord.md => AsyncResponse.md} (56%) create mode 100644 docs/Model/CreateDashboardRequest.md create mode 100644 docs/Model/Dashboard.md create mode 100644 docs/Model/DashboardItem.md create mode 100644 docs/Model/DashboardItemPropertyDataSource.md create mode 100644 docs/Model/DashboardItemPropertyDataSourcePropertyConfig.md create mode 100644 docs/Model/DashboardItemPropertyVisualization.md create mode 100644 docs/Model/DashboardItemPropertyVisualizationPropertyConfig.md rename docs/Model/{RelationshipTlsDnsRecord.md => DashboardPropertyCreatedBy.md} (55%) rename docs/Model/{RelationshipTlsDnsRecords.md => DashboardPropertyUpdatedBy.md} (55%) rename docs/Model/{InvoiceResponse.md => EomInvoiceResponse.md} (98%) create mode 100644 docs/Model/GetServiceLevelUsageResponse.md create mode 100644 docs/Model/GetServiceLevelUsageTypesResponse.md create mode 100644 docs/Model/IncludedWithTlsConfiguration.md create mode 100644 docs/Model/IncludedWithTlsConfigurationItem.md create mode 100644 docs/Model/ListDashboardsResponse.md rename docs/Model/{ListInvoicesResponse.md => ListEomInvoicesResponse.md} (92%) create mode 100644 docs/Model/MtdInvoiceResponse.md create mode 100644 docs/Model/Mtdinvoice.md create mode 100644 docs/Model/Mtdlineitems.md create mode 100644 docs/Model/RelationshipDefaultEcdsaTlsCertificate.md create mode 100644 docs/Model/RelationshipDefaultEcdsaTlsCertificateDefaultEcdsaCertificate.md create mode 100644 docs/Model/RelationshipDefaultEcdsaTlsCertificateDefaultEcdsaCertificateData.md create mode 100644 docs/Model/RelationshipDefaultTlsCertificate.md create mode 100644 docs/Model/RelationshipDefaultTlsCertificateDefaultCertificate.md create mode 100644 docs/Model/RelationshipDefaultTlsCertificateDefaultCertificateData.md create mode 100644 docs/Model/RelationshipTlsDnsRecordsRequest.md create mode 100644 docs/Model/RelationshipTlsDnsRecordsRequestDnsRecords.md create mode 100644 docs/Model/RelationshipTlsDnsRecordsRequestDnsRecordsData.md create mode 100644 docs/Model/RelationshipTlsDnsRecordsResponse.md create mode 100644 docs/Model/RelationshipTlsDnsRecordsResponseDnsRecords.md rename docs/Model/{RelationshipMemberTlsDnsRecord.md => RelationshipTlsDnsRecordsResponseDnsRecordsData.md} (86%) create mode 100644 docs/Model/Serviceusagemetric.md create mode 100644 docs/Model/Serviceusagemetrics.md create mode 100644 docs/Model/ServiceusagemetricsData.md create mode 100644 docs/Model/Serviceusagetype.md create mode 100644 docs/Model/Serviceusagetypes.md create mode 100644 docs/Model/TlsCertificateBlobResponse.md create mode 100644 docs/Model/UpdateDashboardRequest.md create mode 100644 lib/Api/BillingUsageMetricsApi.php create mode 100644 lib/Api/ObservabilityCustomDashboardsApi.php create mode 100644 lib/Model/AsyncResponse.php create mode 100644 lib/Model/CreateDashboardRequest.php create mode 100644 lib/Model/Dashboard.php create mode 100644 lib/Model/DashboardItem.php create mode 100644 lib/Model/DashboardItemPropertyDataSource.php create mode 100644 lib/Model/DashboardItemPropertyDataSourcePropertyConfig.php create mode 100644 lib/Model/DashboardItemPropertyVisualization.php create mode 100644 lib/Model/DashboardItemPropertyVisualizationPropertyConfig.php create mode 100644 lib/Model/DashboardPropertyCreatedBy.php create mode 100644 lib/Model/DashboardPropertyUpdatedBy.php rename lib/Model/{InvoiceResponse.php => EomInvoiceResponse.php} (98%) create mode 100644 lib/Model/GetServiceLevelUsageResponse.php rename lib/Model/{RelationshipTlsDnsRecordDnsRecord.php => GetServiceLevelUsageTypesResponse.php} (93%) create mode 100644 lib/Model/IncludedWithTlsConfiguration.php create mode 100644 lib/Model/IncludedWithTlsConfigurationItem.php create mode 100644 lib/Model/ListDashboardsResponse.php rename lib/Model/{ListInvoicesResponse.php => ListEomInvoicesResponse.php} (96%) create mode 100644 lib/Model/MtdInvoiceResponse.php create mode 100644 lib/Model/Mtdinvoice.php create mode 100644 lib/Model/Mtdlineitems.php create mode 100644 lib/Model/RelationshipDefaultEcdsaTlsCertificate.php create mode 100644 lib/Model/RelationshipDefaultEcdsaTlsCertificateDefaultEcdsaCertificate.php create mode 100644 lib/Model/RelationshipDefaultEcdsaTlsCertificateDefaultEcdsaCertificateData.php create mode 100644 lib/Model/RelationshipDefaultTlsCertificate.php create mode 100644 lib/Model/RelationshipDefaultTlsCertificateDefaultCertificate.php create mode 100644 lib/Model/RelationshipDefaultTlsCertificateDefaultCertificateData.php rename lib/Model/{RelationshipTlsDnsRecords.php => RelationshipTlsDnsRecordsRequest.php} (94%) rename lib/Model/{RelationshipTlsDnsRecord.php => RelationshipTlsDnsRecordsRequestDnsRecords.php} (87%) rename lib/Model/{RelationshipMemberTlsDnsRecord.php => RelationshipTlsDnsRecordsRequestDnsRecordsData.php} (95%) create mode 100644 lib/Model/RelationshipTlsDnsRecordsResponse.php create mode 100644 lib/Model/RelationshipTlsDnsRecordsResponseDnsRecords.php create mode 100644 lib/Model/RelationshipTlsDnsRecordsResponseDnsRecordsData.php create mode 100644 lib/Model/Serviceusagemetric.php create mode 100644 lib/Model/Serviceusagemetrics.php create mode 100644 lib/Model/ServiceusagemetricsData.php create mode 100644 lib/Model/Serviceusagetype.php create mode 100644 lib/Model/Serviceusagetypes.php create mode 100644 lib/Model/TlsCertificateBlobResponse.php create mode 100644 lib/Model/UpdateDashboardRequest.php diff --git a/CHANGELOG.md b/CHANGELOG.md index fc5cb29e..5fe13ce8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## [v5.6.0](https://github.com/fastly/fastly-php/releases/tag/release/v5.6.0) (2024-08-04) + +**Enhancements:** + +- feat(observability): Adds new Observability Custom Dashboards API +- feat(billing-invoices): Adds month-to-date invoice information +- feat(billing-usage-metrics): Adds information on service-level usage. +- feat(tls): Adds an endpoint to get a TLS certificate blob (Limited Availability) +- feat(stats): Add `origin_offload` metric + ## [v5.5.0](https://github.com/fastly/fastly-php/releases/tag/release/v5.5.0) (2024-07-01) **Bug fixes:** diff --git a/README.md b/README.md index df72e286..28e7e2d4 100644 --- a/README.md +++ b/README.md @@ -118,7 +118,10 @@ Class | Method | Description [*BillingAddressApi*](docs/Api/BillingAddressApi.md) | [**getBillingAddr**](docs/Api/BillingAddressApi.md#getbillingaddr) | Get a billing address [*BillingAddressApi*](docs/Api/BillingAddressApi.md) | [**updateBillingAddr**](docs/Api/BillingAddressApi.md#updatebillingaddr) | Update a billing address [*BillingInvoicesApi*](docs/Api/BillingInvoicesApi.md) | [**getInvoiceByInvoiceId**](docs/Api/BillingInvoicesApi.md#getinvoicebyinvoiceid) | Get invoice by ID. +[*BillingInvoicesApi*](docs/Api/BillingInvoicesApi.md) | [**getMonthToDateInvoice**](docs/Api/BillingInvoicesApi.md#getmonthtodateinvoice) | Get month-to-date invoice. [*BillingInvoicesApi*](docs/Api/BillingInvoicesApi.md) | [**listInvoices**](docs/Api/BillingInvoicesApi.md#listinvoices) | List of invoices. +[*BillingUsageMetricsApi*](docs/Api/BillingUsageMetricsApi.md) | [**getServiceLevelUsage**](docs/Api/BillingUsageMetricsApi.md#getservicelevelusage) | Retrieve service-level usage metrics for a product. +[*BillingUsageMetricsApi*](docs/Api/BillingUsageMetricsApi.md) | [**getServiceLevelUsageTypes**](docs/Api/BillingUsageMetricsApi.md#getservicelevelusagetypes) | Retrieve product usage types for a customer. [*CacheSettingsApi*](docs/Api/CacheSettingsApi.md) | [**createCacheSettings**](docs/Api/CacheSettingsApi.md#createcachesettings) | Create a cache settings object [*CacheSettingsApi*](docs/Api/CacheSettingsApi.md) | [**deleteCacheSettings**](docs/Api/CacheSettingsApi.md#deletecachesettings) | Delete a cache settings object [*CacheSettingsApi*](docs/Api/CacheSettingsApi.md) | [**getCacheSettings**](docs/Api/CacheSettingsApi.md#getcachesettings) | Get a cache settings object @@ -430,6 +433,11 @@ Class | Method | Description [*MutualAuthenticationApi*](docs/Api/MutualAuthenticationApi.md) | [**getMutualAuthentication**](docs/Api/MutualAuthenticationApi.md#getmutualauthentication) | Get a Mutual Authentication [*MutualAuthenticationApi*](docs/Api/MutualAuthenticationApi.md) | [**listMutualAuthentications**](docs/Api/MutualAuthenticationApi.md#listmutualauthentications) | List Mutual Authentications [*MutualAuthenticationApi*](docs/Api/MutualAuthenticationApi.md) | [**patchMutualAuthentication**](docs/Api/MutualAuthenticationApi.md#patchmutualauthentication) | Update a Mutual Authentication +[*ObservabilityCustomDashboardsApi*](docs/Api/ObservabilityCustomDashboardsApi.md) | [**createDashboard**](docs/Api/ObservabilityCustomDashboardsApi.md#createdashboard) | Create a new dashboard +[*ObservabilityCustomDashboardsApi*](docs/Api/ObservabilityCustomDashboardsApi.md) | [**deleteDashboard**](docs/Api/ObservabilityCustomDashboardsApi.md#deletedashboard) | Delete an existing dashboard +[*ObservabilityCustomDashboardsApi*](docs/Api/ObservabilityCustomDashboardsApi.md) | [**getDashboard**](docs/Api/ObservabilityCustomDashboardsApi.md#getdashboard) | Retrieve a dashboard by ID +[*ObservabilityCustomDashboardsApi*](docs/Api/ObservabilityCustomDashboardsApi.md) | [**listDashboards**](docs/Api/ObservabilityCustomDashboardsApi.md#listdashboards) | List all custom dashboards +[*ObservabilityCustomDashboardsApi*](docs/Api/ObservabilityCustomDashboardsApi.md) | [**updateDashboard**](docs/Api/ObservabilityCustomDashboardsApi.md#updatedashboard) | Update an existing dashboard [*OriginInspectorHistoricalApi*](docs/Api/OriginInspectorHistoricalApi.md) | [**getOriginInspectorHistorical**](docs/Api/OriginInspectorHistoricalApi.md#getorigininspectorhistorical) | Get historical origin data for a service [*OriginInspectorRealtimeApi*](docs/Api/OriginInspectorRealtimeApi.md) | [**getOriginInspectorLast120Seconds**](docs/Api/OriginInspectorRealtimeApi.md#getorigininspectorlast120seconds) | Get real-time origin data for the last 120 seconds [*OriginInspectorRealtimeApi*](docs/Api/OriginInspectorRealtimeApi.md) | [**getOriginInspectorLastMaxEntries**](docs/Api/OriginInspectorRealtimeApi.md#getorigininspectorlastmaxentries) | Get a limited number of real-time origin data entries @@ -531,6 +539,7 @@ Class | Method | Description [*TlsCertificatesApi*](docs/Api/TlsCertificatesApi.md) | [**createTlsCert**](docs/Api/TlsCertificatesApi.md#createtlscert) | Create a TLS certificate [*TlsCertificatesApi*](docs/Api/TlsCertificatesApi.md) | [**deleteTlsCert**](docs/Api/TlsCertificatesApi.md#deletetlscert) | Delete a TLS certificate [*TlsCertificatesApi*](docs/Api/TlsCertificatesApi.md) | [**getTlsCert**](docs/Api/TlsCertificatesApi.md#gettlscert) | Get a TLS certificate +[*TlsCertificatesApi*](docs/Api/TlsCertificatesApi.md) | [**getTlsCertBlob**](docs/Api/TlsCertificatesApi.md#gettlscertblob) | Get a TLS certificate blob (Limited Availability) [*TlsCertificatesApi*](docs/Api/TlsCertificatesApi.md) | [**listTlsCerts**](docs/Api/TlsCertificatesApi.md#listtlscerts) | List TLS certificates [*TlsCertificatesApi*](docs/Api/TlsCertificatesApi.md) | [**updateTlsCert**](docs/Api/TlsCertificatesApi.md#updatetlscert) | Update a TLS certificate [*TlsConfigurationsApi*](docs/Api/TlsConfigurationsApi.md) | [**getTlsConfig**](docs/Api/TlsConfigurationsApi.md#gettlsconfig) | Get a TLS configuration @@ -628,6 +637,8 @@ The fastly-php API client currently does not support the following endpoints: - [`/alerts/definitions/{definition_id}`](https://www.fastly.com/documentation/reference/api/observability/alerts/definitions) (DELETE, GET, PUT) - [`/alerts/definitions`](https://www.fastly.com/documentation/reference/api/observability/alerts/definitions) (GET, POST) - [`/alerts/history`](https://www.fastly.com/documentation/reference/api/observability/alerts/history) (GET) +- [`/dns/configurations/{dns_configuration_id}`](https://www.fastly.com/documentation/reference/api/) (DELETE, GET, PATCH) +- [`/dns/configurations`](https://www.fastly.com/documentation/reference/api/) (GET, POST) - [`/notifications/integration-types`](https://developer.fastly.com/reference/api/observability/notification) (GET) - [`/notifications/integrations/{integration_id}/rotateSigningKey`](https://developer.fastly.com/reference/api/observability/notification) (POST) - [`/notifications/integrations/{integration_id}/signingKey`](https://developer.fastly.com/reference/api/observability/notification) (GET) @@ -637,7 +648,9 @@ The fastly-php API client currently does not support the following endpoints: - [`/resources/stores/kv/{store_id}/batch`](https://www.fastly.com/documentation/reference/api/services/resources/kv-store-item) (PUT) - [`/tls/activations/{tls_activation_id}`](https://www.fastly.com/documentation/reference/api/tls/mutual-tls/activations) (GET, PATCH) - [`/tls/activations`](https://www.fastly.com/documentation/reference/api/tls/mutual-tls/activations) (GET) -- [`/tls/preview/domains/{tls_preview_domain_id}`](https://www.fastly.com/documentation/reference/api/) (GET, PATCH) +- [`/tls/configurations/{tls_configuration_id}`](https://www.fastly.com/documentation/reference/api/) (DELETE, GET, PATCH) +- [`/tls/configurations`](https://www.fastly.com/documentation/reference/api/) (GET, POST) +- [`/tls/preview/domains/{domain_id}`](https://www.fastly.com/documentation/reference/api/) (GET, PATCH) - [`/tls/preview/domains`](https://www.fastly.com/documentation/reference/api/) (GET, POST) - [`/v1/channel/{service_id}/ts/h/limit/{max_entries}`](https://www.fastly.com/documentation/reference/api/metrics-stats/origin-insights) (GET) - [`/v1/channel/{service_id}/ts/h`](https://www.fastly.com/documentation/reference/api/metrics-stats/origin-insights) (GET) diff --git a/docs/Api/BillingInvoicesApi.md b/docs/Api/BillingInvoicesApi.md index 624bb96b..95b61006 100644 --- a/docs/Api/BillingInvoicesApi.md +++ b/docs/Api/BillingInvoicesApi.md @@ -18,13 +18,14 @@ $apiInstance = new Fastly\Api\BillingInvoicesApi( Method | HTTP request | Description ------ | ------------ | ----------- [**getInvoiceByInvoiceId()**](BillingInvoicesApi.md#getInvoiceByInvoiceId) | **GET** /billing/v3/invoices/{invoice_id} | Get invoice by ID. +[**getMonthToDateInvoice()**](BillingInvoicesApi.md#getMonthToDateInvoice) | **GET** /billing/v3/invoices/month-to-date | Get month-to-date invoice. [**listInvoices()**](BillingInvoicesApi.md#listInvoices) | **GET** /billing/v3/invoices | List of invoices. ## `getInvoiceByInvoiceId()` ```php -getInvoiceByInvoiceId($options): \Fastly\Model\InvoiceResponse // Get invoice by ID. +getInvoiceByInvoiceId($options): \Fastly\Model\EomInvoiceResponse // Get invoice by ID. ``` Returns invoice associated with the invoice id. @@ -50,7 +51,38 @@ Name | Type | Description | Notes ### Return type -[**\Fastly\Model\InvoiceResponse**](../Model/InvoiceResponse.md) +[**\Fastly\Model\EomInvoiceResponse**](../Model/EomInvoiceResponse.md) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `getMonthToDateInvoice()` + +```php +getMonthToDateInvoice($options): \Fastly\Model\MtdInvoiceResponse // Get month-to-date invoice. +``` + +Returns month-to-date invoice for the current month. + +### Example +```php + +try { + $result = $apiInstance->getMonthToDateInvoice($options); +} catch (Exception $e) { + echo 'Exception when calling BillingInvoicesApi->getMonthToDateInvoice: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +This endpoint does not need any parameters. + +### Return type + +[**\Fastly\Model\MtdInvoiceResponse**](../Model/MtdInvoiceResponse.md) [[Back to top]](#) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) @@ -58,7 +90,7 @@ Name | Type | Description | Notes ## `listInvoices()` ```php -listInvoices($options): \Fastly\Model\ListInvoicesResponse // List of invoices. +listInvoices($options): \Fastly\Model\ListEomInvoicesResponse // List of invoices. ``` Returns the list of invoices, sorted by billing start date (newest to oldest). @@ -90,7 +122,7 @@ Name | Type | Description | Notes ### Return type -[**\Fastly\Model\ListInvoicesResponse**](../Model/ListInvoicesResponse.md) +[**\Fastly\Model\ListEomInvoicesResponse**](../Model/ListEomInvoicesResponse.md) [[Back to top]](#) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Api/BillingUsageMetricsApi.md b/docs/Api/BillingUsageMetricsApi.md new file mode 100644 index 00000000..7364579b --- /dev/null +++ b/docs/Api/BillingUsageMetricsApi.md @@ -0,0 +1,108 @@ +# Fastly\Api\BillingUsageMetricsApi + + +```php +$apiInstance = new Fastly\Api\BillingUsageMetricsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +``` + +## Methods + +> [!NOTE] +> All URIs are relative to `https://api.fastly.com` + +Method | HTTP request | Description +------ | ------------ | ----------- +[**getServiceLevelUsage()**](BillingUsageMetricsApi.md#getServiceLevelUsage) | **GET** /billing/v2/account_customers/{customer_id}/service-usage-metrics | Retrieve service-level usage metrics for a product. +[**getServiceLevelUsageTypes()**](BillingUsageMetricsApi.md#getServiceLevelUsageTypes) | **GET** /billing/v2/account_customers/{customer_id}/service-usage-types | Retrieve product usage types for a customer. + + +## `getServiceLevelUsage()` + +```php +getServiceLevelUsage($options): \Fastly\Model\Serviceusagemetrics // Retrieve service-level usage metrics for a product. +``` + +Returns product usage, broken down by service. + +### Example +```php + $options['customer_id'] = 'customer_id_example'; // string | Alphanumeric string identifying the customer. +$options['product_id'] = 'product_id_example'; // string | The product identifier for the metrics returned (e.g., `cdn_usage`). This field is not required for CSV requests. +$options['usage_type_name'] = 'usage_type_name_example'; // string | The usage type name for the metrics returned (e.g., `North America Requests`). This field is not required for CSV requests. +$options['time_granularity'] = 'time_granularity_example'; // string +$options['start_date'] = 2023-01-01; // string +$options['end_date'] = 2023-01-31; // string +$options['start_month'] = 2023-01; // string +$options['end_month'] = 2023-03; // string +$options['limit'] = '5'; // string | Number of results per page. The maximum is 100. +$options['cursor'] = 'cursor_example'; // string | Cursor value from the `next_cursor` field of a previous response, used to retrieve the next page. To request the first page, this should be empty. + +try { + $result = $apiInstance->getServiceLevelUsage($options); +} catch (Exception $e) { + echo 'Exception when calling BillingUsageMetricsApi->getServiceLevelUsage: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**customer_id** | **string** | Alphanumeric string identifying the customer. | +**product_id** | **string** | The product identifier for the metrics returned (e.g., `cdn_usage`). This field is not required for CSV requests. | +**usage_type_name** | **string** | The usage type name for the metrics returned (e.g., `North America Requests`). This field is not required for CSV requests. | +**time_granularity** | **string** | | +**start_date** | **string** | | [optional] +**end_date** | **string** | | [optional] +**start_month** | **string** | | [optional] +**end_month** | **string** | | [optional] +**limit** | **string** | Number of results per page. The maximum is 100. | [optional] [defaults to '5'] +**cursor** | **string** | Cursor value from the `next_cursor` field of a previous response, used to retrieve the next page. To request the first page, this should be empty. | [optional] + +### Return type + +[**\Fastly\Model\Serviceusagemetrics**](../Model/Serviceusagemetrics.md) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `getServiceLevelUsageTypes()` + +```php +getServiceLevelUsageTypes($options): \Fastly\Model\Serviceusagetypes // Retrieve product usage types for a customer. +``` + +Returns product usage types reported by the customer's services. + +### Example +```php + $options['customer_id'] = 'customer_id_example'; // string | Alphanumeric string identifying the customer. + +try { + $result = $apiInstance->getServiceLevelUsageTypes($options); +} catch (Exception $e) { + echo 'Exception when calling BillingUsageMetricsApi->getServiceLevelUsageTypes: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**customer_id** | **string** | Alphanumeric string identifying the customer. | + +### Return type + +[**\Fastly\Model\Serviceusagetypes**](../Model/Serviceusagetypes.md) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) diff --git a/docs/Api/ImageOptimizerDefaultSettingsApi.md b/docs/Api/ImageOptimizerDefaultSettingsApi.md index 0d6a852f..98d332f3 100644 --- a/docs/Api/ImageOptimizerDefaultSettingsApi.md +++ b/docs/Api/ImageOptimizerDefaultSettingsApi.md @@ -69,7 +69,7 @@ Update one or more default settings. A minimum of one property is required. The ```php $options['service_id'] = 'service_id_example'; // string | Alphanumeric string identifying the service. $options['version_id'] = 56; // int | Integer identifying a service version. -$options['default_settings'] = {"type":"object","properties":{"resize_filter":{"type":"string","enum":["lanczos3","lanczos2","bicubic","bilinear","nearest"],"default":"lanczos3","description":"The type of filter to use while resizing an image.","x-enum-descriptions":["A Lanczos filter with a kernel size of 3. Lanczos filters can detect edges and linear features within an image, providing the best possible reconstruction.","A Lanczos filter with a kernel size of 2.","A filter using an average of a 4x4 environment of pixels, weighing the innermost pixels higher.","A filter using an average of a 2x2 environment of pixels.","A filter using the value of nearby translated pixel values. Preserves hard edges."]},"webp":{"type":"boolean","default":false,"description":"Controls whether or not to default to WebP output when the client supports it. This is equivalent to adding \"auto=webp\" to all image optimizer requests.\n"},"webp_quality":{"type":"integer","minimum":1,"maximum":100,"default":85,"description":"The default quality to use with WebP output. This can be overridden with the second option in the \"quality\" URL parameter on specific image optimizer requests.\n"},"jpeg_type":{"type":"string","enum":["auto","baseline","progressive"],"default":"auto","description":"The default type of JPEG output to use. This can be overridden with \"format=bjpeg\" and \"format=pjpeg\" on specific image optimizer requests.\n","x-enum-descriptions":["Match the input JPEG type, or baseline if transforming from a non-JPEG input.","Output baseline JPEG images","Output progressive JPEG images"]},"jpeg_quality":{"type":"integer","minimum":1,"maximum":100,"default":85,"description":"The default quality to use with JPEG output. This can be overridden with the \"quality\" parameter on specific image optimizer requests.\n"},"upscale":{"type":"boolean","default":false,"description":"Whether or not we should allow output images to render at sizes larger than input.\n"},"allow_video":{"type":"boolean","default":false,"description":"Enables GIF to MP4 transformations on this service."}}}; // \Fastly\Model\DefaultSettings +$options['default_settings'] = new \Fastly\Model\DefaultSettings(); // \Fastly\Model\DefaultSettings try { $result = $apiInstance->updateDefaultSettings($options); diff --git a/docs/Api/ObservabilityCustomDashboardsApi.md b/docs/Api/ObservabilityCustomDashboardsApi.md new file mode 100644 index 00000000..75432a94 --- /dev/null +++ b/docs/Api/ObservabilityCustomDashboardsApi.md @@ -0,0 +1,194 @@ +# Fastly\Api\ObservabilityCustomDashboardsApi + + +```php +$apiInstance = new Fastly\Api\ObservabilityCustomDashboardsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +``` + +## Methods + +> [!NOTE] +> All URIs are relative to `https://api.fastly.com` + +Method | HTTP request | Description +------ | ------------ | ----------- +[**createDashboard()**](ObservabilityCustomDashboardsApi.md#createDashboard) | **POST** /observability/dashboards | Create a new dashboard +[**deleteDashboard()**](ObservabilityCustomDashboardsApi.md#deleteDashboard) | **DELETE** /observability/dashboards/{dashboard_id} | Delete an existing dashboard +[**getDashboard()**](ObservabilityCustomDashboardsApi.md#getDashboard) | **GET** /observability/dashboards/{dashboard_id} | Retrieve a dashboard by ID +[**listDashboards()**](ObservabilityCustomDashboardsApi.md#listDashboards) | **GET** /observability/dashboards | List all custom dashboards +[**updateDashboard()**](ObservabilityCustomDashboardsApi.md#updateDashboard) | **PATCH** /observability/dashboards/{dashboard_id} | Update an existing dashboard + + +## `createDashboard()` + +```php +createDashboard($options): \Fastly\Model\Dashboard // Create a new dashboard +``` + +Create a new dashboard + +### Example +```php + $options['create_dashboard_request'] = new \Fastly\Model\CreateDashboardRequest(); // \Fastly\Model\CreateDashboardRequest + +try { + $result = $apiInstance->createDashboard($options); +} catch (Exception $e) { + echo 'Exception when calling ObservabilityCustomDashboardsApi->createDashboard: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**create_dashboard_request** | [**\Fastly\Model\CreateDashboardRequest**](../Model/CreateDashboardRequest.md) | | [optional] + +### Return type + +[**\Fastly\Model\Dashboard**](../Model/Dashboard.md) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `deleteDashboard()` + +```php +deleteDashboard($options) // Delete an existing dashboard +``` + +Delete an existing dashboard + +### Example +```php + $options['dashboard_id'] = 2eGFXF4F4kTxd4gU39Bg3e; // string + +try { + $apiInstance->deleteDashboard($options); +} catch (Exception $e) { + echo 'Exception when calling ObservabilityCustomDashboardsApi->deleteDashboard: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**dashboard_id** | **string** | | + +### Return type + +void (empty response body) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `getDashboard()` + +```php +getDashboard($options): \Fastly\Model\Dashboard // Retrieve a dashboard by ID +``` + +Retrieve a dashboard by ID + +### Example +```php + $options['dashboard_id'] = 2eGFXF4F4kTxd4gU39Bg3e; // string + +try { + $result = $apiInstance->getDashboard($options); +} catch (Exception $e) { + echo 'Exception when calling ObservabilityCustomDashboardsApi->getDashboard: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**dashboard_id** | **string** | | + +### Return type + +[**\Fastly\Model\Dashboard**](../Model/Dashboard.md) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `listDashboards()` + +```php +listDashboards($options): \Fastly\Model\ListDashboardsResponse // List all custom dashboards +``` + +List all custom dashboards + +### Example +```php + +try { + $result = $apiInstance->listDashboards($options); +} catch (Exception $e) { + echo 'Exception when calling ObservabilityCustomDashboardsApi->listDashboards: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +This endpoint does not need any parameters. + +### Return type + +[**\Fastly\Model\ListDashboardsResponse**](../Model/ListDashboardsResponse.md) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `updateDashboard()` + +```php +updateDashboard($options): \Fastly\Model\Dashboard // Update an existing dashboard +``` + +Update an existing dashboard + +### Example +```php + $options['dashboard_id'] = 2eGFXF4F4kTxd4gU39Bg3e; // string +$options['update_dashboard_request'] = new \Fastly\Model\UpdateDashboardRequest(); // \Fastly\Model\UpdateDashboardRequest + +try { + $result = $apiInstance->updateDashboard($options); +} catch (Exception $e) { + echo 'Exception when calling ObservabilityCustomDashboardsApi->updateDashboard: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**dashboard_id** | **string** | | +**update_dashboard_request** | [**\Fastly\Model\UpdateDashboardRequest**](../Model/UpdateDashboardRequest.md) | | [optional] + +### Return type + +[**\Fastly\Model\Dashboard**](../Model/Dashboard.md) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) diff --git a/docs/Api/TlsCertificatesApi.md b/docs/Api/TlsCertificatesApi.md index f50a9292..bc2e5727 100644 --- a/docs/Api/TlsCertificatesApi.md +++ b/docs/Api/TlsCertificatesApi.md @@ -20,6 +20,7 @@ Method | HTTP request | Description [**createTlsCert()**](TlsCertificatesApi.md#createTlsCert) | **POST** /tls/certificates | Create a TLS certificate [**deleteTlsCert()**](TlsCertificatesApi.md#deleteTlsCert) | **DELETE** /tls/certificates/{tls_certificate_id} | Delete a TLS certificate [**getTlsCert()**](TlsCertificatesApi.md#getTlsCert) | **GET** /tls/certificates/{tls_certificate_id} | Get a TLS certificate +[**getTlsCertBlob()**](TlsCertificatesApi.md#getTlsCertBlob) | **GET** /tls/certificates/{tls_certificate_id}/blob | Get a TLS certificate blob (Limited Availability) [**listTlsCerts()**](TlsCertificatesApi.md#listTlsCerts) | **GET** /tls/certificates | List TLS certificates [**updateTlsCert()**](TlsCertificatesApi.md#updateTlsCert) | **PATCH** /tls/certificates/{tls_certificate_id} | Update a TLS certificate @@ -126,6 +127,40 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) +## `getTlsCertBlob()` + +```php +getTlsCertBlob($options): \Fastly\Model\TlsCertificateBlobResponse // Get a TLS certificate blob (Limited Availability) +``` + +Retrieve a TLS certificate blob. This feature is part of a [limited availability](https://docs.fastly.com/products/fastly-product-lifecycle#limited-availability) release. + +### Example +```php + $options['tls_certificate_id'] = 'tls_certificate_id_example'; // string | Alphanumeric string identifying a TLS certificate. + +try { + $result = $apiInstance->getTlsCertBlob($options); +} catch (Exception $e) { + echo 'Exception when calling TlsCertificatesApi->getTlsCertBlob: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**tls_certificate_id** | **string** | Alphanumeric string identifying a TLS certificate. | + +### Return type + +[**\Fastly\Model\TlsCertificateBlobResponse**](../Model/TlsCertificateBlobResponse.md) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + ## `listTlsCerts()` ```php diff --git a/docs/Api/TlsCsrsApi.md b/docs/Api/TlsCsrsApi.md index e6510e9b..9cc3c82e 100644 --- a/docs/Api/TlsCsrsApi.md +++ b/docs/Api/TlsCsrsApi.md @@ -30,7 +30,7 @@ Creates a certificate signing request (CSR). ### Example ```php - $options['tls_csr'] = {"data":{"type":"csr","attributes":{"sans":["DOMAIN_NAME"],"common_name":"DOMAIN_NAME","key_type":"RSA2048","country":"US","state":"California","city":"San Francisco","organization":"Fastly, Inc.","organizational_unit":"Engineering"},"relationships":{"tls_private_key":{"data":{"type":"tls_private_key","id":"KeYguUGZzb2W9Euo4moOR"}}}}}; // \Fastly\Model\TlsCsr + $options['tls_csr'] = {"value":{"data":{"type":"csr","attributes":{"sans":["DOMAIN_NAME"],"common_name":"DOMAIN_NAME","key_type":"RSA2048","country":"US","state":"California","city":"San Francisco","organization":"Fastly, Inc.","organizational_unit":"Engineering"},"relationships":{"tls_private_key":{"data":{"type":"tls_private_key","id":"KeYguUGZzb2W9Euo4moOR"}}}}}}; // \Fastly\Model\TlsCsr try { $result = $apiInstance->createCsr($options); diff --git a/docs/Model/RelationshipTlsDnsRecordDnsRecord.md b/docs/Model/AsyncResponse.md similarity index 56% rename from docs/Model/RelationshipTlsDnsRecordDnsRecord.md rename to docs/Model/AsyncResponse.md index f3db2a19..9f609e27 100644 --- a/docs/Model/RelationshipTlsDnsRecordDnsRecord.md +++ b/docs/Model/AsyncResponse.md @@ -1,10 +1,11 @@ -# # RelationshipTlsDnsRecordDnsRecord +# # AsyncResponse ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**\Fastly\Model\RelationshipMemberTlsDnsRecord[]**](RelationshipMemberTlsDnsRecord.md) | | [optional] +**title** | **string** | | [optional] +**status** | **string** | | [optional] [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateDashboardRequest.md b/docs/Model/CreateDashboardRequest.md new file mode 100644 index 00000000..1a845725 --- /dev/null +++ b/docs/Model/CreateDashboardRequest.md @@ -0,0 +1,12 @@ +# # CreateDashboardRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | A human-readable name | +**description** | **string** | A short description of the dashboard | [optional] +**items** | [**\Fastly\Model\DashboardItem[]**](DashboardItem.md) | A list of [dashboard items](#dashboard-item). | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Dashboard.md b/docs/Model/Dashboard.md new file mode 100644 index 00000000..f8ef8a82 --- /dev/null +++ b/docs/Model/Dashboard.md @@ -0,0 +1,17 @@ +# # Dashboard + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | Dashboard identifier (UUID) | [optional] [readonly] +**name** | **string** | A human-readable name | [optional] +**description** | **string** | A short description of the dashboard | [optional] +**items** | [**\Fastly\Model\DashboardItem[]**](DashboardItem.md) | A list of [dashboard items](#dashboard-item). | [optional] +**created_at** | **\DateTime** | Date and time in ISO 8601 format. | [optional] [readonly] +**updated_at** | **\DateTime** | Date and time in ISO 8601 format. | [optional] [readonly] +**created_by** | [**\Fastly\Model\DashboardPropertyCreatedBy**](DashboardPropertyCreatedBy.md) | | [optional] +**updated_by** | [**\Fastly\Model\DashboardPropertyUpdatedBy**](DashboardPropertyUpdatedBy.md) | | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DashboardItem.md b/docs/Model/DashboardItem.md new file mode 100644 index 00000000..83980ae2 --- /dev/null +++ b/docs/Model/DashboardItem.md @@ -0,0 +1,15 @@ +# # DashboardItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **string** | A human-readable title for the dashboard item | +**subtitle** | **string** | A human-readable subtitle for the dashboard item. Often a description of the visualization. | +**data_source** | [**\Fastly\Model\DashboardItemPropertyDataSource**](DashboardItemPropertyDataSource.md) | | +**visualization** | [**\Fastly\Model\DashboardItemPropertyVisualization**](DashboardItemPropertyVisualization.md) | | +**id** | **string** | Dashboard item identifier (UUID) | [optional] [readonly] +**span** | **int** | The number of columns for the dashboard item to span. Dashboards are rendered on a 12-column grid on \"desktop\" screen sizes. | [optional] [defaults to 4] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DashboardItemPropertyDataSource.md b/docs/Model/DashboardItemPropertyDataSource.md new file mode 100644 index 00000000..8cc128fd --- /dev/null +++ b/docs/Model/DashboardItemPropertyDataSource.md @@ -0,0 +1,11 @@ +# # DashboardItemPropertyDataSource + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | The source of the data to display. | [one of: 'stats.edge', 'stats.domain', 'stats.origin'] +**config** | [**\Fastly\Model\DashboardItemPropertyDataSourcePropertyConfig**](DashboardItemPropertyDataSourcePropertyConfig.md) | | + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DashboardItemPropertyDataSourcePropertyConfig.md b/docs/Model/DashboardItemPropertyDataSourcePropertyConfig.md new file mode 100644 index 00000000..1cd95e4b --- /dev/null +++ b/docs/Model/DashboardItemPropertyDataSourcePropertyConfig.md @@ -0,0 +1,10 @@ +# # DashboardItemPropertyDataSourcePropertyConfig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**metrics** | **string[]** | The metrics to visualize. Valid options are defined by the selected [data source](#field_data_source). | + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DashboardItemPropertyVisualization.md b/docs/Model/DashboardItemPropertyVisualization.md new file mode 100644 index 00000000..909a9c10 --- /dev/null +++ b/docs/Model/DashboardItemPropertyVisualization.md @@ -0,0 +1,11 @@ +# # DashboardItemPropertyVisualization + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | The type of visualization to display. | [one of: 'chart'] +**config** | [**\Fastly\Model\DashboardItemPropertyVisualizationPropertyConfig**](DashboardItemPropertyVisualizationPropertyConfig.md) | | + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DashboardItemPropertyVisualizationPropertyConfig.md b/docs/Model/DashboardItemPropertyVisualizationPropertyConfig.md new file mode 100644 index 00000000..5fc917bd --- /dev/null +++ b/docs/Model/DashboardItemPropertyVisualizationPropertyConfig.md @@ -0,0 +1,12 @@ +# # DashboardItemPropertyVisualizationPropertyConfig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**plot_type** | **string** | The type of chart to display. | [one of: 'line', 'bar', 'single-metric', 'donut'] +**format** | **string** | (Optional) The units to use to format the data. | [optional] [one of: 'number', 'bytes', 'percent', 'requests', 'responses', 'seconds', 'milliseconds', 'ratio', 'bitrate'] [defaults to 'number'] +**calculation_method** | **string** | (Optional) The aggregation function to apply to the dataset. | [optional] [one of: 'avg', 'sum', 'min', 'max', 'latest', 'p95'] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RelationshipTlsDnsRecord.md b/docs/Model/DashboardPropertyCreatedBy.md similarity index 55% rename from docs/Model/RelationshipTlsDnsRecord.md rename to docs/Model/DashboardPropertyCreatedBy.md index 8642a807..966d6699 100644 --- a/docs/Model/RelationshipTlsDnsRecord.md +++ b/docs/Model/DashboardPropertyCreatedBy.md @@ -1,10 +1,9 @@ -# # RelationshipTlsDnsRecord +# # DashboardPropertyCreatedBy ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**dns_record** | [**\Fastly\Model\RelationshipTlsDnsRecordDnsRecord**](RelationshipTlsDnsRecordDnsRecord.md) | | [optional] [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RelationshipTlsDnsRecords.md b/docs/Model/DashboardPropertyUpdatedBy.md similarity index 55% rename from docs/Model/RelationshipTlsDnsRecords.md rename to docs/Model/DashboardPropertyUpdatedBy.md index 435d1210..da6f620b 100644 --- a/docs/Model/RelationshipTlsDnsRecords.md +++ b/docs/Model/DashboardPropertyUpdatedBy.md @@ -1,10 +1,9 @@ -# # RelationshipTlsDnsRecords +# # DashboardPropertyUpdatedBy ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**dns_records** | [**\Fastly\Model\RelationshipTlsDnsRecordDnsRecord**](RelationshipTlsDnsRecordDnsRecord.md) | | [optional] [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DomainInspectorMeasurements.md b/docs/Model/DomainInspectorMeasurements.md index a1c73c2f..d8620c1c 100644 --- a/docs/Model/DomainInspectorMeasurements.md +++ b/docs/Model/DomainInspectorMeasurements.md @@ -42,7 +42,7 @@ Name | Type | Description | Notes **origin_fetch_resp_body_bytes** | **int** | Total body bytes received from origin. | [optional] **bandwidth** | **int** | Total bytes delivered (`resp_header_bytes` + `resp_body_bytes` + `bereq_header_bytes` + `bereq_body_bytes`). | [optional] **edge_hit_ratio** | **float** | Ratio of cache hits to cache misses at the edge, between 0 and 1 (`edge_hit_requests` / (`edge_hit_requests` + `edge_miss_requests`)). | [optional] -**origin_offload** | **float** | Ratio of response bytes delivered from the edge compared to what is delivered from origin, between 0 and 1. (`edge_resp_body_bytes` + `edge_resp_header_bytes`) / (`origin_fetch_resp_body_bytes` + `origin_fetch_resp_header_bytes` + `edge_resp_body_bytes` + `edge_resp_header_bytes`). | [optional] +**origin_offload** | **float** | Origin Offload measures the ratio of bytes served to end users that were cached by Fastly, over the bytes served to end users, between 0 and 1. ((`edge_resp_body_bytes` + `edge_resp_header_bytes`) - (`origin_fetch_resp_body_bytes` + `origin_fetch_resp_header_bytes`)) / (`edge_resp_body_bytes` + `edge_resp_header_bytes`). Previously, Origin Offload used a different formula. [Learn more](https://www.fastly.com/documentation/reference/changes/2024/06/add-origin_offload-metric). | [optional] **origin_status_200** | **int** | Number of responses received from origin with status code 200 (Success). | [optional] **origin_status_204** | **int** | Number of responses received from origin with status code 204 (No Content). | [optional] **origin_status_206** | **int** | Number of responses received from origin with status code 206 (Partial Content). | [optional] diff --git a/docs/Model/InvoiceResponse.md b/docs/Model/EomInvoiceResponse.md similarity index 98% rename from docs/Model/InvoiceResponse.md rename to docs/Model/EomInvoiceResponse.md index 8bcaa7a5..18cb54f1 100644 --- a/docs/Model/InvoiceResponse.md +++ b/docs/Model/EomInvoiceResponse.md @@ -1,4 +1,4 @@ -# # InvoiceResponse +# # EomInvoiceResponse ## Properties diff --git a/docs/Model/GetServiceLevelUsageResponse.md b/docs/Model/GetServiceLevelUsageResponse.md new file mode 100644 index 00000000..a5a3053f --- /dev/null +++ b/docs/Model/GetServiceLevelUsageResponse.md @@ -0,0 +1,10 @@ +# # GetServiceLevelUsageResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Fastly\Model\ServiceusagemetricsData**](ServiceusagemetricsData.md) | | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetServiceLevelUsageTypesResponse.md b/docs/Model/GetServiceLevelUsageTypesResponse.md new file mode 100644 index 00000000..d09edb1a --- /dev/null +++ b/docs/Model/GetServiceLevelUsageTypesResponse.md @@ -0,0 +1,10 @@ +# # GetServiceLevelUsageTypesResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Fastly\Model\Serviceusagetype[]**](Serviceusagetype.md) | | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/IncludedWithTlsConfiguration.md b/docs/Model/IncludedWithTlsConfiguration.md new file mode 100644 index 00000000..c21dcef1 --- /dev/null +++ b/docs/Model/IncludedWithTlsConfiguration.md @@ -0,0 +1,10 @@ +# # IncludedWithTlsConfiguration + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**included** | [**\Fastly\Model\IncludedWithTlsConfigurationItem[]**](IncludedWithTlsConfigurationItem.md) | | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/IncludedWithTlsConfigurationItem.md b/docs/Model/IncludedWithTlsConfigurationItem.md new file mode 100644 index 00000000..95eb0a0b --- /dev/null +++ b/docs/Model/IncludedWithTlsConfigurationItem.md @@ -0,0 +1,12 @@ +# # IncludedWithTlsConfigurationItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | The IP address or hostname of the DNS record. | [optional] +**type** | [**\Fastly\Model\TypeTlsDnsRecord**](TypeTlsDnsRecord.md) | | [optional] +**attributes** | [**\Fastly\Model\TlsDnsRecord**](TlsDnsRecord.md) | | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ListDashboardsResponse.md b/docs/Model/ListDashboardsResponse.md new file mode 100644 index 00000000..ce30c03e --- /dev/null +++ b/docs/Model/ListDashboardsResponse.md @@ -0,0 +1,11 @@ +# # ListDashboardsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Fastly\Model\Dashboard[]**](Dashboard.md) | | [optional] +**meta** | **object** | Meta for the pagination. | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ListInvoicesResponse.md b/docs/Model/ListEomInvoicesResponse.md similarity index 92% rename from docs/Model/ListInvoicesResponse.md rename to docs/Model/ListEomInvoicesResponse.md index 1dababe3..97e37491 100644 --- a/docs/Model/ListInvoicesResponse.md +++ b/docs/Model/ListEomInvoicesResponse.md @@ -1,4 +1,4 @@ -# # ListInvoicesResponse +# # ListEomInvoicesResponse ## Properties diff --git a/docs/Model/MtdInvoiceResponse.md b/docs/Model/MtdInvoiceResponse.md new file mode 100644 index 00000000..44653a9c --- /dev/null +++ b/docs/Model/MtdInvoiceResponse.md @@ -0,0 +1,15 @@ +# # MtdInvoiceResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**customer_id** | **string** | The Customer ID associated with the invoice. | [optional] +**invoice_id** | **string** | An alphanumeric string identifying the invoice. | [optional] +**billing_start_date** | **\DateTime** | The date and time (in ISO 8601 format) for the initiation point of a billing cycle, signifying the start of charges for a service or subscription. | [optional] +**billing_end_date** | **\DateTime** | The date and time (in ISO 8601 format) for the termination point of a billing cycle, signifying the end of charges for a service or subscription. | [optional] +**monthly_transaction_amount** | **string** | The total billable amount for invoiced services charged within a single month. | [optional] +**transaction_line_items** | [**\Fastly\Model\Mtdlineitems[]**](Mtdlineitems.md) | | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Mtdinvoice.md b/docs/Model/Mtdinvoice.md new file mode 100644 index 00000000..2db5e639 --- /dev/null +++ b/docs/Model/Mtdinvoice.md @@ -0,0 +1,15 @@ +# # Mtdinvoice + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**customer_id** | **string** | The Customer ID associated with the invoice. | [optional] +**invoice_id** | **string** | An alphanumeric string identifying the invoice. | [optional] +**billing_start_date** | **\DateTime** | The date and time (in ISO 8601 format) for the initiation point of a billing cycle, signifying the start of charges for a service or subscription. | [optional] +**billing_end_date** | **\DateTime** | The date and time (in ISO 8601 format) for the termination point of a billing cycle, signifying the end of charges for a service or subscription. | [optional] +**monthly_transaction_amount** | **string** | The total billable amount for invoiced services charged within a single month. | [optional] +**transaction_line_items** | [**\Fastly\Model\Mtdlineitems[]**](Mtdlineitems.md) | | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Mtdlineitems.md b/docs/Model/Mtdlineitems.md new file mode 100644 index 00000000..3a8bf81e --- /dev/null +++ b/docs/Model/Mtdlineitems.md @@ -0,0 +1,18 @@ +# # Mtdlineitems + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **string** | Invoice line item transaction name. | [optional] +**amount** | **float** | Billed amount for line item. | [optional] +**rate** | **float** | Price per unit. | [optional] +**units** | **float** | Total number of units of usage. | [optional] +**product_name** | **string** | The name of the product. | [optional] +**product_group** | **string** | The broader classification of the product (e.g., `Compute` or `Full-Site Delivery`). | [optional] +**product_line** | **string** | The broader classification of the product (e.g., `Network Services` or `Security`). | [optional] +**region** | **string** | The geographical area applicable for regionally based products. | [optional] +**usage_type** | **string** | The unit of measure (e.g., `requests` or `bandwidth`). | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RealtimeEntryAggregated.md b/docs/Model/RealtimeEntryAggregated.md index b79448d3..7a8e07ef 100644 --- a/docs/Model/RealtimeEntryAggregated.md +++ b/docs/Model/RealtimeEntryAggregated.md @@ -252,6 +252,7 @@ Name | Type | Description | Notes **all_status_3xx** | **int** | Number of \"Redirection\" codes delivered for all sources. | [optional] **all_status_4xx** | **int** | Number of \"Client Error\" codes delivered for all sources. | [optional] **all_status_5xx** | **int** | Number of \"Server Error\" codes delivered for all sources. | [optional] +**origin_offload** | **float** | Origin Offload measures the ratio of bytes served to end users that were cached by Fastly, over the bytes served to end users, between 0 and 1. ((`edge_resp_body_bytes` + `edge_resp_header_bytes`) - (`origin_fetch_resp_body_bytes` + `origin_fetch_resp_header_bytes`)) / (`edge_resp_body_bytes` + `edge_resp_header_bytes`). | [optional] [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RealtimeMeasurements.md b/docs/Model/RealtimeMeasurements.md index 6cb44c34..e7d677db 100644 --- a/docs/Model/RealtimeMeasurements.md +++ b/docs/Model/RealtimeMeasurements.md @@ -252,6 +252,7 @@ Name | Type | Description | Notes **all_status_3xx** | **int** | Number of \"Redirection\" codes delivered for all sources. | [optional] **all_status_4xx** | **int** | Number of \"Client Error\" codes delivered for all sources. | [optional] **all_status_5xx** | **int** | Number of \"Server Error\" codes delivered for all sources. | [optional] +**origin_offload** | **float** | Origin Offload measures the ratio of bytes served to end users that were cached by Fastly, over the bytes served to end users, between 0 and 1. ((`edge_resp_body_bytes` + `edge_resp_header_bytes`) - (`origin_fetch_resp_body_bytes` + `origin_fetch_resp_header_bytes`)) / (`edge_resp_body_bytes` + `edge_resp_header_bytes`). | [optional] [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RelationshipDefaultEcdsaTlsCertificate.md b/docs/Model/RelationshipDefaultEcdsaTlsCertificate.md new file mode 100644 index 00000000..79e73055 --- /dev/null +++ b/docs/Model/RelationshipDefaultEcdsaTlsCertificate.md @@ -0,0 +1,10 @@ +# # RelationshipDefaultEcdsaTlsCertificate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**default_ecdsa_certificate** | [**\Fastly\Model\RelationshipDefaultEcdsaTlsCertificateDefaultEcdsaCertificate**](RelationshipDefaultEcdsaTlsCertificateDefaultEcdsaCertificate.md) | | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RelationshipDefaultEcdsaTlsCertificateDefaultEcdsaCertificate.md b/docs/Model/RelationshipDefaultEcdsaTlsCertificateDefaultEcdsaCertificate.md new file mode 100644 index 00000000..0d4e279c --- /dev/null +++ b/docs/Model/RelationshipDefaultEcdsaTlsCertificateDefaultEcdsaCertificate.md @@ -0,0 +1,10 @@ +# # RelationshipDefaultEcdsaTlsCertificateDefaultEcdsaCertificate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Fastly\Model\RelationshipDefaultEcdsaTlsCertificateDefaultEcdsaCertificateData**](RelationshipDefaultEcdsaTlsCertificateDefaultEcdsaCertificateData.md) | | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RelationshipDefaultEcdsaTlsCertificateDefaultEcdsaCertificateData.md b/docs/Model/RelationshipDefaultEcdsaTlsCertificateDefaultEcdsaCertificateData.md new file mode 100644 index 00000000..88b6870a --- /dev/null +++ b/docs/Model/RelationshipDefaultEcdsaTlsCertificateDefaultEcdsaCertificateData.md @@ -0,0 +1,11 @@ +# # RelationshipDefaultEcdsaTlsCertificateDefaultEcdsaCertificateData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | [**\Fastly\Model\TypeTlsCertificate**](TypeTlsCertificate.md) | | [optional] +**id** | **string** | Alphanumeric string identifying the default ECDSA TLS certificate. | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RelationshipDefaultTlsCertificate.md b/docs/Model/RelationshipDefaultTlsCertificate.md new file mode 100644 index 00000000..ed24fd8f --- /dev/null +++ b/docs/Model/RelationshipDefaultTlsCertificate.md @@ -0,0 +1,10 @@ +# # RelationshipDefaultTlsCertificate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**default_certificate** | [**\Fastly\Model\RelationshipDefaultTlsCertificateDefaultCertificate**](RelationshipDefaultTlsCertificateDefaultCertificate.md) | | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RelationshipDefaultTlsCertificateDefaultCertificate.md b/docs/Model/RelationshipDefaultTlsCertificateDefaultCertificate.md new file mode 100644 index 00000000..ba9c8e7a --- /dev/null +++ b/docs/Model/RelationshipDefaultTlsCertificateDefaultCertificate.md @@ -0,0 +1,10 @@ +# # RelationshipDefaultTlsCertificateDefaultCertificate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Fastly\Model\RelationshipDefaultTlsCertificateDefaultCertificateData**](RelationshipDefaultTlsCertificateDefaultCertificateData.md) | | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RelationshipDefaultTlsCertificateDefaultCertificateData.md b/docs/Model/RelationshipDefaultTlsCertificateDefaultCertificateData.md new file mode 100644 index 00000000..9029b3ef --- /dev/null +++ b/docs/Model/RelationshipDefaultTlsCertificateDefaultCertificateData.md @@ -0,0 +1,11 @@ +# # RelationshipDefaultTlsCertificateDefaultCertificateData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | [**\Fastly\Model\TypeTlsCertificate**](TypeTlsCertificate.md) | | [optional] +**id** | **string** | Alphanumeric string identifying the default TLS certificate. | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RelationshipTlsDnsRecordsRequest.md b/docs/Model/RelationshipTlsDnsRecordsRequest.md new file mode 100644 index 00000000..379c31f6 --- /dev/null +++ b/docs/Model/RelationshipTlsDnsRecordsRequest.md @@ -0,0 +1,10 @@ +# # RelationshipTlsDnsRecordsRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dns_records** | [**\Fastly\Model\RelationshipTlsDnsRecordsRequestDnsRecords**](RelationshipTlsDnsRecordsRequestDnsRecords.md) | | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RelationshipTlsDnsRecordsRequestDnsRecords.md b/docs/Model/RelationshipTlsDnsRecordsRequestDnsRecords.md new file mode 100644 index 00000000..7528bfce --- /dev/null +++ b/docs/Model/RelationshipTlsDnsRecordsRequestDnsRecords.md @@ -0,0 +1,10 @@ +# # RelationshipTlsDnsRecordsRequestDnsRecords + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Fastly\Model\RelationshipTlsDnsRecordsRequestDnsRecordsData[]**](RelationshipTlsDnsRecordsRequestDnsRecordsData.md) | | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RelationshipTlsDnsRecordsRequestDnsRecordsData.md b/docs/Model/RelationshipTlsDnsRecordsRequestDnsRecordsData.md new file mode 100644 index 00000000..512fb44c --- /dev/null +++ b/docs/Model/RelationshipTlsDnsRecordsRequestDnsRecordsData.md @@ -0,0 +1,11 @@ +# # RelationshipTlsDnsRecordsRequestDnsRecordsData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | [**\Fastly\Model\TypeTlsDnsRecord**](TypeTlsDnsRecord.md) | | [optional] +**id** | **string** | | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RelationshipTlsDnsRecordsResponse.md b/docs/Model/RelationshipTlsDnsRecordsResponse.md new file mode 100644 index 00000000..38fdb05d --- /dev/null +++ b/docs/Model/RelationshipTlsDnsRecordsResponse.md @@ -0,0 +1,10 @@ +# # RelationshipTlsDnsRecordsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dns_records** | [**\Fastly\Model\RelationshipTlsDnsRecordsResponseDnsRecords**](RelationshipTlsDnsRecordsResponseDnsRecords.md) | | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RelationshipTlsDnsRecordsResponseDnsRecords.md b/docs/Model/RelationshipTlsDnsRecordsResponseDnsRecords.md new file mode 100644 index 00000000..c5eb27e5 --- /dev/null +++ b/docs/Model/RelationshipTlsDnsRecordsResponseDnsRecords.md @@ -0,0 +1,10 @@ +# # RelationshipTlsDnsRecordsResponseDnsRecords + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Fastly\Model\RelationshipTlsDnsRecordsResponseDnsRecordsData[]**](RelationshipTlsDnsRecordsResponseDnsRecordsData.md) | | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RelationshipMemberTlsDnsRecord.md b/docs/Model/RelationshipTlsDnsRecordsResponseDnsRecordsData.md similarity index 86% rename from docs/Model/RelationshipMemberTlsDnsRecord.md rename to docs/Model/RelationshipTlsDnsRecordsResponseDnsRecordsData.md index 6fa3c05c..61149864 100644 --- a/docs/Model/RelationshipMemberTlsDnsRecord.md +++ b/docs/Model/RelationshipTlsDnsRecordsResponseDnsRecordsData.md @@ -1,4 +1,4 @@ -# # RelationshipMemberTlsDnsRecord +# # RelationshipTlsDnsRecordsResponseDnsRecordsData ## Properties diff --git a/docs/Model/Results.md b/docs/Model/Results.md index d047483e..b93f5b09 100644 --- a/docs/Model/Results.md +++ b/docs/Model/Results.md @@ -252,6 +252,7 @@ Name | Type | Description | Notes **all_status_3xx** | **int** | Number of \"Redirection\" codes delivered for all sources. | [optional] **all_status_4xx** | **int** | Number of \"Client Error\" codes delivered for all sources. | [optional] **all_status_5xx** | **int** | Number of \"Server Error\" codes delivered for all sources. | [optional] +**origin_offload** | **float** | Origin Offload measures the ratio of bytes served to end users that were cached by Fastly, over the bytes served to end users, between 0 and 1. ((`edge_resp_body_bytes` + `edge_resp_header_bytes`) - (`origin_fetch_resp_body_bytes` + `origin_fetch_resp_header_bytes`)) / (`edge_resp_body_bytes` + `edge_resp_header_bytes`). | [optional] **service_id** | **string** | | [optional] [readonly] **start_time** | **int** | Timestamp for the start of the time period being reported | [optional] diff --git a/docs/Model/Serviceusagemetric.md b/docs/Model/Serviceusagemetric.md new file mode 100644 index 00000000..561b27ce --- /dev/null +++ b/docs/Model/Serviceusagemetric.md @@ -0,0 +1,13 @@ +# # Serviceusagemetric + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**customer_id** | **string** | | [optional] [readonly] +**service_id** | **string** | Service ID associated with the usage. | [optional] +**service_name** | **string** | Name of the service associated with the usage. | [optional] +**usage_units** | **float** | The quantity of the usage for the billing period. Amount will be in the units provided in the parent object (e.g., a quantity of `1.3` with a unit of `gb` would have a usage amount of 1.3 gigabytes). | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Serviceusagemetrics.md b/docs/Model/Serviceusagemetrics.md new file mode 100644 index 00000000..9e4656d1 --- /dev/null +++ b/docs/Model/Serviceusagemetrics.md @@ -0,0 +1,10 @@ +# # Serviceusagemetrics + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Fastly\Model\ServiceusagemetricsData**](ServiceusagemetricsData.md) | | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ServiceusagemetricsData.md b/docs/Model/ServiceusagemetricsData.md new file mode 100644 index 00000000..c396c378 --- /dev/null +++ b/docs/Model/ServiceusagemetricsData.md @@ -0,0 +1,16 @@ +# # ServiceusagemetricsData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**customer_id** | **string** | | [optional] [readonly] +**start_time** | **\DateTime** | Date and time (in ISO 8601 format) for initiation point of a billing cycle, signifying the start of charges for a service or subscription. | [optional] +**end_time** | **\DateTime** | Date and time (in ISO 8601 format) for termination point of a billing cycle, signifying the end of charges for a service or subscription. | [optional] +**usage_type** | **string** | The usage type identifier for the usage. This is a single, billable metric for the product. | [optional] +**unit** | **string** | The unit for the usage as shown on an invoice. If there is no explicit unit, this field will be \"unit\" (e.g., a request with `product_id` of 'cdn_usage' and `usage_type` of 'North America Requests' has no unit, and will return \"unit\"). | [optional] +**details** | [**\Fastly\Model\Serviceusagemetric[]**](Serviceusagemetric.md) | | [optional] +**meta** | [**\Fastly\Model\Metadata**](Metadata.md) | | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Serviceusagetype.md b/docs/Model/Serviceusagetype.md new file mode 100644 index 00000000..25dab00f --- /dev/null +++ b/docs/Model/Serviceusagetype.md @@ -0,0 +1,11 @@ +# # Serviceusagetype + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**product_id** | **string** | The product identifier associated with the usage type. This corresponds to a Fastly product offering. | [optional] +**name** | **string** | Full name of the product usage type as it might appear on a customer's invoice. | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Serviceusagetypes.md b/docs/Model/Serviceusagetypes.md new file mode 100644 index 00000000..f51f39cd --- /dev/null +++ b/docs/Model/Serviceusagetypes.md @@ -0,0 +1,10 @@ +# # Serviceusagetypes + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Fastly\Model\Serviceusagetype[]**](Serviceusagetype.md) | | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TlsCertificateBlobResponse.md b/docs/Model/TlsCertificateBlobResponse.md new file mode 100644 index 00000000..c025f0aa --- /dev/null +++ b/docs/Model/TlsCertificateBlobResponse.md @@ -0,0 +1,10 @@ +# # TlsCertificateBlobResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cert_blob** | **string** | A certificate blob | [optional] [readonly] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TlsDnsRecord.md b/docs/Model/TlsDnsRecord.md index 6e797144..65b863ee 100644 --- a/docs/Model/TlsDnsRecord.md +++ b/docs/Model/TlsDnsRecord.md @@ -4,9 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **string** | The IP address or hostname of the DNS record. | [optional] -**region** | **string** | Specifies the regions that will be used to route traffic. Select DNS Records with a `global` region to route traffic to the most performant point of presence (POP) worldwide (global pricing will apply). Select DNS records with a `us-eu` region to exclusively land traffic on North American and European POPs. | [optional] -**record_type** | **string** | The type of the DNS record. `A` specifies an IPv4 address to be used for an A record to be used for apex domains (e.g., `example.com`). `AAAA` specifies an IPv6 address for use in an A record for apex domains. `CNAME` specifies the hostname to be used for a CNAME record for subdomains or wildcard domains (e.g., `www.example.com` or `*.example.com`). | [optional] +**region** | **string** | Specifies the regions that will be used to route traffic. Select DNS records with a `global` region to route traffic to the most performant point of presence (POP) worldwide (global pricing will apply). Select DNS records with a `na/eu` region to exclusively land traffic on North American and European POPs. | [optional] [one of: 'custom', 'global', 'na/eu'] +**record_type** | **string** | The type of the DNS record. `A` specifies an IPv4 address to be used for an A record to be used for apex domains (e.g., `example.com`). `AAAA` specifies an IPv6 address for use in an A record for apex domains. `CNAME` specifies the hostname to be used for a CNAME record for subdomains or wildcard domains (e.g., `www.example.com` or `*.example.com`). | [optional] [one of: 'CNAME', 'A', 'AAAA'] [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdateDashboardRequest.md b/docs/Model/UpdateDashboardRequest.md new file mode 100644 index 00000000..a0e1a236 --- /dev/null +++ b/docs/Model/UpdateDashboardRequest.md @@ -0,0 +1,12 @@ +# # UpdateDashboardRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | A human-readable name | [optional] +**description** | **string** | A short description of the dashboard | [optional] +**items** | [**\Fastly\Model\DashboardItem[]**](DashboardItem.md) | A list of [dashboard items](#dashboard-item). | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Values.md b/docs/Model/Values.md index ffbc054b..6cc18df3 100644 --- a/docs/Model/Values.md +++ b/docs/Model/Values.md @@ -42,7 +42,7 @@ Name | Type | Description | Notes **origin_fetch_resp_body_bytes** | **int** | Total body bytes received from origin. | [optional] **bandwidth** | **int** | Total bytes delivered (`resp_header_bytes` + `resp_body_bytes` + `bereq_header_bytes` + `bereq_body_bytes`). | [optional] **edge_hit_ratio** | **float** | Ratio of cache hits to cache misses at the edge, between 0 and 1 (`edge_hit_requests` / (`edge_hit_requests` + `edge_miss_requests`)). | [optional] -**origin_offload** | **float** | Ratio of response bytes delivered from the edge compared to what is delivered from origin, between 0 and 1. (`edge_resp_body_bytes` + `edge_resp_header_bytes`) / (`origin_fetch_resp_body_bytes` + `origin_fetch_resp_header_bytes` + `edge_resp_body_bytes` + `edge_resp_header_bytes`). | [optional] +**origin_offload** | **float** | Origin Offload measures the ratio of bytes served to end users that were cached by Fastly, over the bytes served to end users, between 0 and 1. ((`edge_resp_body_bytes` + `edge_resp_header_bytes`) - (`origin_fetch_resp_body_bytes` + `origin_fetch_resp_header_bytes`)) / (`edge_resp_body_bytes` + `edge_resp_header_bytes`). Previously, Origin Offload used a different formula. [Learn more](https://www.fastly.com/documentation/reference/changes/2024/06/add-origin_offload-metric). | [optional] **origin_status_200** | **int** | Number of responses received from origin with status code 200 (Success). | [optional] **origin_status_204** | **int** | Number of responses received from origin with status code 204 (No Content). | [optional] **origin_status_206** | **int** | Number of responses received from origin with status code 206 (Partial Content). | [optional] diff --git a/lib/Api/BillingInvoicesApi.php b/lib/Api/BillingInvoicesApi.php index 56a90dea..79ce5158 100644 --- a/lib/Api/BillingInvoicesApi.php +++ b/lib/Api/BillingInvoicesApi.php @@ -123,7 +123,7 @@ public function getConfig() * * @throws \Fastly\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Fastly\Model\InvoiceResponse|\Fastly\Model\Error|\Fastly\Model\Error|\Fastly\Model\Error + * @return \Fastly\Model\EomInvoiceResponse|\Fastly\Model\Error|\Fastly\Model\Error|\Fastly\Model\Error */ public function getInvoiceByInvoiceId($options) { @@ -145,7 +145,7 @@ public function getInvoiceByInvoiceId($options) * * @throws \Fastly\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Fastly\Model\InvoiceResponse|\Fastly\Model\Error|\Fastly\Model\Error|\Fastly\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \Fastly\Model\EomInvoiceResponse|\Fastly\Model\Error|\Fastly\Model\Error|\Fastly\Model\Error, HTTP status code, HTTP response headers (array of strings) */ public function getInvoiceByInvoiceIdWithHttpInfo($options) { @@ -200,14 +200,14 @@ public function getInvoiceByInvoiceIdWithHttpInfo($options) switch($statusCode) { case 200: - if ('\Fastly\Model\InvoiceResponse' === '\SplFileObject') { + if ('\Fastly\Model\EomInvoiceResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Fastly\Model\InvoiceResponse', []), + ObjectSerializer::deserialize($content, '\Fastly\Model\EomInvoiceResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -249,7 +249,7 @@ public function getInvoiceByInvoiceIdWithHttpInfo($options) ]; } - $returnType = '\Fastly\Model\InvoiceResponse'; + $returnType = '\Fastly\Model\EomInvoiceResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -267,7 +267,7 @@ public function getInvoiceByInvoiceIdWithHttpInfo($options) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Fastly\Model\InvoiceResponse', + '\Fastly\Model\EomInvoiceResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -343,7 +343,7 @@ function ($response) { */ public function getInvoiceByInvoiceIdAsyncWithHttpInfo($options) { - $returnType = '\Fastly\Model\InvoiceResponse'; + $returnType = '\Fastly\Model\EomInvoiceResponse'; $request = $this->getInvoiceByInvoiceIdRequest($options); return $this->client @@ -423,6 +423,408 @@ public function getInvoiceByInvoiceIdRequest($options) } + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + } + } + + // this endpoint requires API token authentication + $apiToken = $this->config->getApiTokenWithPrefix('Fastly-Key'); + if ($apiToken !== null) { + $headers['Fastly-Key'] = $apiToken; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHosts = ["https://api.fastly.com"]; + if ($this->hostIndex < 0 || $this->hostIndex >= sizeof($operationHosts)) { + throw new \InvalidArgumentException("Invalid index {$this->hostIndex} when selecting the host. Must be less than ".sizeof($operationHosts)); + } + $operationHost = $operationHosts[$this->hostIndex]; + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getMonthToDateInvoice + * + * Get month-to-date invoice. + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * URL: https://api.fastly.com + * + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Fastly\Model\MtdInvoiceResponse|\Fastly\Model\AsyncResponse|\Fastly\Model\Error|\Fastly\Model\Error|\Fastly\Model\Error|\Fastly\Model\Error + */ + public function getMonthToDateInvoice($options) + { + list($response) = $this->getMonthToDateInvoiceWithHttpInfo($options); + return $response; + } + + /** + * Operation getMonthToDateInvoiceWithHttpInfo + * + * Get month-to-date invoice. + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * This operation contains Fastly API host(s). Use 'hostIndex' to select the host. + * URL: https://api.fastly.com + * + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Fastly\Model\MtdInvoiceResponse|\Fastly\Model\AsyncResponse|\Fastly\Model\Error|\Fastly\Model\Error|\Fastly\Model\Error|\Fastly\Model\Error, HTTP status code, HTTP response headers (array of strings) + */ + public function getMonthToDateInvoiceWithHttpInfo($options) + { + $request = $this->getMonthToDateInvoiceRequest($options); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + if ('GET' != 'GET' && 'GET' != 'HEAD') { + $header = $response->getHeader('Fastly-RateLimit-Remaining'); + if (count($header) > 0) { + $this->config->setRateLimitRemaining($header[0]); + } + + $header = $response->getHeader('Fastly-RateLimit-Reset'); + if (count($header) > 0) { + $this->config->setRateLimitReset($header[0]); + } + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Fastly\Model\MtdInvoiceResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\MtdInvoiceResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 202: + if ('\Fastly\Model\AsyncResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\AsyncResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Fastly\Model\Error' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\Error', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Fastly\Model\Error' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\Error', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Fastly\Model\Error' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\Error', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Fastly\Model\Error' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\Error', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Fastly\Model\MtdInvoiceResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Fastly\Model\MtdInvoiceResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 202: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Fastly\Model\AsyncResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Fastly\Model\Error', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Fastly\Model\Error', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Fastly\Model\Error', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Fastly\Model\Error', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getMonthToDateInvoiceAsync + * + * Get month-to-date invoice. + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * URL: https://api.fastly.com + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getMonthToDateInvoiceAsync($options) + { + return $this->getMonthToDateInvoiceAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getMonthToDateInvoiceAsyncWithHttpInfo + * + * Get month-to-date invoice. + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * URL: https://api.fastly.com + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getMonthToDateInvoiceAsyncWithHttpInfo($options) + { + $returnType = '\Fastly\Model\MtdInvoiceResponse'; + $request = $this->getMonthToDateInvoiceRequest($options); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getMonthToDateInvoice' + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * URL: https://api.fastly.com + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getMonthToDateInvoiceRequest($options) + { + // unbox the parameters from the associative array + + + $resourcePath = '/billing/v3/invoices/month-to-date'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] @@ -508,7 +910,7 @@ public function getInvoiceByInvoiceIdRequest($options) * * @throws \Fastly\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Fastly\Model\ListInvoicesResponse|\Fastly\Model\Error|\Fastly\Model\Error|\Fastly\Model\Error + * @return \Fastly\Model\ListEomInvoicesResponse|\Fastly\Model\Error|\Fastly\Model\Error|\Fastly\Model\Error */ public function listInvoices($options) { @@ -533,7 +935,7 @@ public function listInvoices($options) * * @throws \Fastly\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Fastly\Model\ListInvoicesResponse|\Fastly\Model\Error|\Fastly\Model\Error|\Fastly\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \Fastly\Model\ListEomInvoicesResponse|\Fastly\Model\Error|\Fastly\Model\Error|\Fastly\Model\Error, HTTP status code, HTTP response headers (array of strings) */ public function listInvoicesWithHttpInfo($options) { @@ -588,14 +990,14 @@ public function listInvoicesWithHttpInfo($options) switch($statusCode) { case 200: - if ('\Fastly\Model\ListInvoicesResponse' === '\SplFileObject') { + if ('\Fastly\Model\ListEomInvoicesResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Fastly\Model\ListInvoicesResponse', []), + ObjectSerializer::deserialize($content, '\Fastly\Model\ListEomInvoicesResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -637,7 +1039,7 @@ public function listInvoicesWithHttpInfo($options) ]; } - $returnType = '\Fastly\Model\ListInvoicesResponse'; + $returnType = '\Fastly\Model\ListEomInvoicesResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -655,7 +1057,7 @@ public function listInvoicesWithHttpInfo($options) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Fastly\Model\ListInvoicesResponse', + '\Fastly\Model\ListEomInvoicesResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -737,7 +1139,7 @@ function ($response) { */ public function listInvoicesAsyncWithHttpInfo($options) { - $returnType = '\Fastly\Model\ListInvoicesResponse'; + $returnType = '\Fastly\Model\ListEomInvoicesResponse'; $request = $this->listInvoicesRequest($options); return $this->client diff --git a/lib/Api/BillingUsageMetricsApi.php b/lib/Api/BillingUsageMetricsApi.php new file mode 100644 index 00000000..89b1c1ad --- /dev/null +++ b/lib/Api/BillingUsageMetricsApi.php @@ -0,0 +1,1085 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation getServiceLevelUsage + * + * Retrieve service-level usage metrics for a product. + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * URL: https://api.fastly.com + * + * @param string $customer_id Alphanumeric string identifying the customer. (required) + * @param string $product_id The product identifier for the metrics returned (e.g., `cdn_usage`). This field is not required for CSV requests. (required) + * @param string $usage_type_name The usage type name for the metrics returned (e.g., `North America Requests`). This field is not required for CSV requests. (required) + * @param string $time_granularity time_granularity (required) + * @param string $start_date start_date (optional) + * @param string $end_date end_date (optional) + * @param string $start_month start_month (optional) + * @param string $end_month end_month (optional) + * @param string $limit Number of results per page. The maximum is 100. (optional, default to '5') + * @param string $cursor Cursor value from the `next_cursor` field of a previous response, used to retrieve the next page. To request the first page, this should be empty. (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Fastly\Model\Serviceusagemetrics|\Fastly\Model\Error|\Fastly\Model\Error|\Fastly\Model\Error + */ + public function getServiceLevelUsage($options) + { + list($response) = $this->getServiceLevelUsageWithHttpInfo($options); + return $response; + } + + /** + * Operation getServiceLevelUsageWithHttpInfo + * + * Retrieve service-level usage metrics for a product. + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * This operation contains Fastly API host(s). Use 'hostIndex' to select the host. + * URL: https://api.fastly.com + * + * @param string $customer_id Alphanumeric string identifying the customer. (required) + * @param string $product_id The product identifier for the metrics returned (e.g., `cdn_usage`). This field is not required for CSV requests. (required) + * @param string $usage_type_name The usage type name for the metrics returned (e.g., `North America Requests`). This field is not required for CSV requests. (required) + * @param string $time_granularity (required) + * @param string $start_date (optional) + * @param string $end_date (optional) + * @param string $start_month (optional) + * @param string $end_month (optional) + * @param string $limit Number of results per page. The maximum is 100. (optional, default to '5') + * @param string $cursor Cursor value from the `next_cursor` field of a previous response, used to retrieve the next page. To request the first page, this should be empty. (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Fastly\Model\Serviceusagemetrics|\Fastly\Model\Error|\Fastly\Model\Error|\Fastly\Model\Error, HTTP status code, HTTP response headers (array of strings) + */ + public function getServiceLevelUsageWithHttpInfo($options) + { + $request = $this->getServiceLevelUsageRequest($options); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + if ('GET' != 'GET' && 'GET' != 'HEAD') { + $header = $response->getHeader('Fastly-RateLimit-Remaining'); + if (count($header) > 0) { + $this->config->setRateLimitRemaining($header[0]); + } + + $header = $response->getHeader('Fastly-RateLimit-Reset'); + if (count($header) > 0) { + $this->config->setRateLimitReset($header[0]); + } + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Fastly\Model\Serviceusagemetrics' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\Serviceusagemetrics', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Fastly\Model\Error' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\Error', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Fastly\Model\Error' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\Error', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Fastly\Model\Error' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\Error', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Fastly\Model\Serviceusagemetrics'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Fastly\Model\Serviceusagemetrics', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Fastly\Model\Error', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Fastly\Model\Error', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Fastly\Model\Error', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getServiceLevelUsageAsync + * + * Retrieve service-level usage metrics for a product. + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * URL: https://api.fastly.com + * + * @param string $customer_id Alphanumeric string identifying the customer. (required) + * @param string $product_id The product identifier for the metrics returned (e.g., `cdn_usage`). This field is not required for CSV requests. (required) + * @param string $usage_type_name The usage type name for the metrics returned (e.g., `North America Requests`). This field is not required for CSV requests. (required) + * @param string $time_granularity (required) + * @param string $start_date (optional) + * @param string $end_date (optional) + * @param string $start_month (optional) + * @param string $end_month (optional) + * @param string $limit Number of results per page. The maximum is 100. (optional, default to '5') + * @param string $cursor Cursor value from the `next_cursor` field of a previous response, used to retrieve the next page. To request the first page, this should be empty. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getServiceLevelUsageAsync($options) + { + return $this->getServiceLevelUsageAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getServiceLevelUsageAsyncWithHttpInfo + * + * Retrieve service-level usage metrics for a product. + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * URL: https://api.fastly.com + * + * @param string $customer_id Alphanumeric string identifying the customer. (required) + * @param string $product_id The product identifier for the metrics returned (e.g., `cdn_usage`). This field is not required for CSV requests. (required) + * @param string $usage_type_name The usage type name for the metrics returned (e.g., `North America Requests`). This field is not required for CSV requests. (required) + * @param string $time_granularity (required) + * @param string $start_date (optional) + * @param string $end_date (optional) + * @param string $start_month (optional) + * @param string $end_month (optional) + * @param string $limit Number of results per page. The maximum is 100. (optional, default to '5') + * @param string $cursor Cursor value from the `next_cursor` field of a previous response, used to retrieve the next page. To request the first page, this should be empty. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getServiceLevelUsageAsyncWithHttpInfo($options) + { + $returnType = '\Fastly\Model\Serviceusagemetrics'; + $request = $this->getServiceLevelUsageRequest($options); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getServiceLevelUsage' + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * URL: https://api.fastly.com + * + * @param string $customer_id Alphanumeric string identifying the customer. (required) + * @param string $product_id The product identifier for the metrics returned (e.g., `cdn_usage`). This field is not required for CSV requests. (required) + * @param string $usage_type_name The usage type name for the metrics returned (e.g., `North America Requests`). This field is not required for CSV requests. (required) + * @param string $time_granularity (required) + * @param string $start_date (optional) + * @param string $end_date (optional) + * @param string $start_month (optional) + * @param string $end_month (optional) + * @param string $limit Number of results per page. The maximum is 100. (optional, default to '5') + * @param string $cursor Cursor value from the `next_cursor` field of a previous response, used to retrieve the next page. To request the first page, this should be empty. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getServiceLevelUsageRequest($options) + { + // unbox the parameters from the associative array + $customer_id = array_key_exists('customer_id', $options) ? $options['customer_id'] : null; + $product_id = array_key_exists('product_id', $options) ? $options['product_id'] : null; + $usage_type_name = array_key_exists('usage_type_name', $options) ? $options['usage_type_name'] : null; + $time_granularity = array_key_exists('time_granularity', $options) ? $options['time_granularity'] : null; + $start_date = array_key_exists('start_date', $options) ? $options['start_date'] : null; + $end_date = array_key_exists('end_date', $options) ? $options['end_date'] : null; + $start_month = array_key_exists('start_month', $options) ? $options['start_month'] : null; + $end_month = array_key_exists('end_month', $options) ? $options['end_month'] : null; + $limit = array_key_exists('limit', $options) ? $options['limit'] : '5'; + $cursor = array_key_exists('cursor', $options) ? $options['cursor'] : null; + + // verify the required parameter 'customer_id' is set + if ($customer_id === null || (is_array($customer_id) && count($customer_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $customer_id when calling getServiceLevelUsage' + ); + } + // verify the required parameter 'product_id' is set + if ($product_id === null || (is_array($product_id) && count($product_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $product_id when calling getServiceLevelUsage' + ); + } + // verify the required parameter 'usage_type_name' is set + if ($usage_type_name === null || (is_array($usage_type_name) && count($usage_type_name) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $usage_type_name when calling getServiceLevelUsage' + ); + } + // verify the required parameter 'time_granularity' is set + if ($time_granularity === null || (is_array($time_granularity) && count($time_granularity) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $time_granularity when calling getServiceLevelUsage' + ); + } + if (!preg_match("/^day$|^month$/", $time_granularity)) { + throw new \InvalidArgumentException("invalid value for \"time_granularity\" when calling BillingUsageMetricsApi.getServiceLevelUsage, must conform to the pattern /^day$|^month$/."); + } + + if ($start_date !== null && !preg_match("/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/", $start_date)) { + throw new \InvalidArgumentException("invalid value for \"start_date\" when calling BillingUsageMetricsApi.getServiceLevelUsage, must conform to the pattern /^[0-9]{4}-[0-9]{2}-[0-9]{2}$/."); + } + + if ($end_date !== null && !preg_match("/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/", $end_date)) { + throw new \InvalidArgumentException("invalid value for \"end_date\" when calling BillingUsageMetricsApi.getServiceLevelUsage, must conform to the pattern /^[0-9]{4}-[0-9]{2}-[0-9]{2}$/."); + } + + if ($start_month !== null && !preg_match("/^[0-9]{4}-[0-9]{2}$/", $start_month)) { + throw new \InvalidArgumentException("invalid value for \"start_month\" when calling BillingUsageMetricsApi.getServiceLevelUsage, must conform to the pattern /^[0-9]{4}-[0-9]{2}$/."); + } + + if ($end_month !== null && !preg_match("/^[0-9]{4}-[0-9]{2}$/", $end_month)) { + throw new \InvalidArgumentException("invalid value for \"end_month\" when calling BillingUsageMetricsApi.getServiceLevelUsage, must conform to the pattern /^[0-9]{4}-[0-9]{2}$/."); + } + + + $resourcePath = '/billing/v2/account_customers/{customer_id}/service-usage-metrics'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($product_id !== null) { + if('form' === 'form' && is_array($product_id)) { + foreach($product_id as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['product_id'] = ObjectSerializer::toString($product_id); + } + } + // query params + if ($usage_type_name !== null) { + if('form' === 'form' && is_array($usage_type_name)) { + foreach($usage_type_name as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['usage_type_name'] = ObjectSerializer::toString($usage_type_name); + } + } + // query params + if ($time_granularity !== null) { + if('form' === 'form' && is_array($time_granularity)) { + foreach($time_granularity as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['time_granularity'] = ObjectSerializer::toString($time_granularity); + } + } + // query params + if ($start_date !== null) { + if('form' === 'form' && is_array($start_date)) { + foreach($start_date as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['start_date'] = ObjectSerializer::toString($start_date); + } + } + // query params + if ($end_date !== null) { + if('form' === 'form' && is_array($end_date)) { + foreach($end_date as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['end_date'] = ObjectSerializer::toString($end_date); + } + } + // query params + if ($start_month !== null) { + if('form' === 'form' && is_array($start_month)) { + foreach($start_month as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['start_month'] = ObjectSerializer::toString($start_month); + } + } + // query params + if ($end_month !== null) { + if('form' === 'form' && is_array($end_month)) { + foreach($end_month as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['end_month'] = ObjectSerializer::toString($end_month); + } + } + // query params + if ($limit !== null) { + if('form' === 'form' && is_array($limit)) { + foreach($limit as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['limit'] = ObjectSerializer::toString($limit); + } + } + // query params + if ($cursor !== null) { + if('form' === 'form' && is_array($cursor)) { + foreach($cursor as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['cursor'] = ObjectSerializer::toString($cursor); + } + } + + + // path params + if ($customer_id !== null) { + $resourcePath = str_replace( + '{' . 'customer_id' . '}', + ObjectSerializer::toPathValue($customer_id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + } + } + + // this endpoint requires API token authentication + $apiToken = $this->config->getApiTokenWithPrefix('Fastly-Key'); + if ($apiToken !== null) { + $headers['Fastly-Key'] = $apiToken; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHosts = ["https://api.fastly.com"]; + if ($this->hostIndex < 0 || $this->hostIndex >= sizeof($operationHosts)) { + throw new \InvalidArgumentException("Invalid index {$this->hostIndex} when selecting the host. Must be less than ".sizeof($operationHosts)); + } + $operationHost = $operationHosts[$this->hostIndex]; + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getServiceLevelUsageTypes + * + * Retrieve product usage types for a customer. + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * URL: https://api.fastly.com + * + * @param string $customer_id Alphanumeric string identifying the customer. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Fastly\Model\Serviceusagetypes|\Fastly\Model\Error|\Fastly\Model\Error|\Fastly\Model\Error + */ + public function getServiceLevelUsageTypes($options) + { + list($response) = $this->getServiceLevelUsageTypesWithHttpInfo($options); + return $response; + } + + /** + * Operation getServiceLevelUsageTypesWithHttpInfo + * + * Retrieve product usage types for a customer. + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * This operation contains Fastly API host(s). Use 'hostIndex' to select the host. + * URL: https://api.fastly.com + * + * @param string $customer_id Alphanumeric string identifying the customer. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Fastly\Model\Serviceusagetypes|\Fastly\Model\Error|\Fastly\Model\Error|\Fastly\Model\Error, HTTP status code, HTTP response headers (array of strings) + */ + public function getServiceLevelUsageTypesWithHttpInfo($options) + { + $request = $this->getServiceLevelUsageTypesRequest($options); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + if ('GET' != 'GET' && 'GET' != 'HEAD') { + $header = $response->getHeader('Fastly-RateLimit-Remaining'); + if (count($header) > 0) { + $this->config->setRateLimitRemaining($header[0]); + } + + $header = $response->getHeader('Fastly-RateLimit-Reset'); + if (count($header) > 0) { + $this->config->setRateLimitReset($header[0]); + } + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Fastly\Model\Serviceusagetypes' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\Serviceusagetypes', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Fastly\Model\Error' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\Error', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Fastly\Model\Error' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\Error', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Fastly\Model\Error' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\Error', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Fastly\Model\Serviceusagetypes'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Fastly\Model\Serviceusagetypes', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Fastly\Model\Error', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Fastly\Model\Error', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Fastly\Model\Error', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getServiceLevelUsageTypesAsync + * + * Retrieve product usage types for a customer. + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * URL: https://api.fastly.com + * + * @param string $customer_id Alphanumeric string identifying the customer. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getServiceLevelUsageTypesAsync($options) + { + return $this->getServiceLevelUsageTypesAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getServiceLevelUsageTypesAsyncWithHttpInfo + * + * Retrieve product usage types for a customer. + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * URL: https://api.fastly.com + * + * @param string $customer_id Alphanumeric string identifying the customer. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getServiceLevelUsageTypesAsyncWithHttpInfo($options) + { + $returnType = '\Fastly\Model\Serviceusagetypes'; + $request = $this->getServiceLevelUsageTypesRequest($options); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getServiceLevelUsageTypes' + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * URL: https://api.fastly.com + * + * @param string $customer_id Alphanumeric string identifying the customer. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getServiceLevelUsageTypesRequest($options) + { + // unbox the parameters from the associative array + $customer_id = array_key_exists('customer_id', $options) ? $options['customer_id'] : null; + + // verify the required parameter 'customer_id' is set + if ($customer_id === null || (is_array($customer_id) && count($customer_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $customer_id when calling getServiceLevelUsageTypes' + ); + } + + $resourcePath = '/billing/v2/account_customers/{customer_id}/service-usage-types'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($customer_id !== null) { + $resourcePath = str_replace( + '{' . 'customer_id' . '}', + ObjectSerializer::toPathValue($customer_id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + } + } + + // this endpoint requires API token authentication + $apiToken = $this->config->getApiTokenWithPrefix('Fastly-Key'); + if ($apiToken !== null) { + $headers['Fastly-Key'] = $apiToken; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHosts = ["https://api.fastly.com"]; + if ($this->hostIndex < 0 || $this->hostIndex >= sizeof($operationHosts)) { + throw new \InvalidArgumentException("Invalid index {$this->hostIndex} when selecting the host. Must be less than ".sizeof($operationHosts)); + } + $operationHost = $operationHosts[$this->hostIndex]; + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/ObservabilityCustomDashboardsApi.php b/lib/Api/ObservabilityCustomDashboardsApi.php new file mode 100644 index 00000000..9f7db83f --- /dev/null +++ b/lib/Api/ObservabilityCustomDashboardsApi.php @@ -0,0 +1,1679 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation createDashboard + * + * Create a new dashboard + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * URL: https://api.fastly.com + * + * @param \Fastly\Model\CreateDashboardRequest $create_dashboard_request create_dashboard_request (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Fastly\Model\Dashboard + */ + public function createDashboard($options) + { + list($response) = $this->createDashboardWithHttpInfo($options); + return $response; + } + + /** + * Operation createDashboardWithHttpInfo + * + * Create a new dashboard + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * This operation contains Fastly API host(s). Use 'hostIndex' to select the host. + * URL: https://api.fastly.com + * + * @param \Fastly\Model\CreateDashboardRequest $create_dashboard_request (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Fastly\Model\Dashboard, HTTP status code, HTTP response headers (array of strings) + */ + public function createDashboardWithHttpInfo($options) + { + $request = $this->createDashboardRequest($options); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + if ('POST' != 'GET' && 'POST' != 'HEAD') { + $header = $response->getHeader('Fastly-RateLimit-Remaining'); + if (count($header) > 0) { + $this->config->setRateLimitRemaining($header[0]); + } + + $header = $response->getHeader('Fastly-RateLimit-Reset'); + if (count($header) > 0) { + $this->config->setRateLimitReset($header[0]); + } + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Fastly\Model\Dashboard' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\Dashboard', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Fastly\Model\Dashboard'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Fastly\Model\Dashboard', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createDashboardAsync + * + * Create a new dashboard + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * URL: https://api.fastly.com + * + * @param \Fastly\Model\CreateDashboardRequest $create_dashboard_request (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createDashboardAsync($options) + { + return $this->createDashboardAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createDashboardAsyncWithHttpInfo + * + * Create a new dashboard + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * URL: https://api.fastly.com + * + * @param \Fastly\Model\CreateDashboardRequest $create_dashboard_request (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createDashboardAsyncWithHttpInfo($options) + { + $returnType = '\Fastly\Model\Dashboard'; + $request = $this->createDashboardRequest($options); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createDashboard' + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * URL: https://api.fastly.com + * + * @param \Fastly\Model\CreateDashboardRequest $create_dashboard_request (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createDashboardRequest($options) + { + // unbox the parameters from the associative array + $create_dashboard_request = array_key_exists('create_dashboard_request', $options) ? $options['create_dashboard_request'] : null; + + + $resourcePath = '/observability/dashboards'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($create_dashboard_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($create_dashboard_request)); + } else { + $httpBody = $create_dashboard_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + } + } + + // this endpoint requires API token authentication + $apiToken = $this->config->getApiTokenWithPrefix('Fastly-Key'); + if ($apiToken !== null) { + $headers['Fastly-Key'] = $apiToken; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHosts = ["https://api.fastly.com"]; + if ($this->hostIndex < 0 || $this->hostIndex >= sizeof($operationHosts)) { + throw new \InvalidArgumentException("Invalid index {$this->hostIndex} when selecting the host. Must be less than ".sizeof($operationHosts)); + } + $operationHost = $operationHosts[$this->hostIndex]; + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteDashboard + * + * Delete an existing dashboard + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * URL: https://api.fastly.com + * + * @param string $dashboard_id dashboard_id (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function deleteDashboard($options) + { + $this->deleteDashboardWithHttpInfo($options); + } + + /** + * Operation deleteDashboardWithHttpInfo + * + * Delete an existing dashboard + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * This operation contains Fastly API host(s). Use 'hostIndex' to select the host. + * URL: https://api.fastly.com + * + * @param string $dashboard_id (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteDashboardWithHttpInfo($options) + { + $request = $this->deleteDashboardRequest($options); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + if ('DELETE' != 'GET' && 'DELETE' != 'HEAD') { + $header = $response->getHeader('Fastly-RateLimit-Remaining'); + if (count($header) > 0) { + $this->config->setRateLimitRemaining($header[0]); + } + + $header = $response->getHeader('Fastly-RateLimit-Reset'); + if (count($header) > 0) { + $this->config->setRateLimitReset($header[0]); + } + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteDashboardAsync + * + * Delete an existing dashboard + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * URL: https://api.fastly.com + * + * @param string $dashboard_id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteDashboardAsync($options) + { + return $this->deleteDashboardAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteDashboardAsyncWithHttpInfo + * + * Delete an existing dashboard + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * URL: https://api.fastly.com + * + * @param string $dashboard_id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteDashboardAsyncWithHttpInfo($options) + { + $returnType = ''; + $request = $this->deleteDashboardRequest($options); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteDashboard' + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * URL: https://api.fastly.com + * + * @param string $dashboard_id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteDashboardRequest($options) + { + // unbox the parameters from the associative array + $dashboard_id = array_key_exists('dashboard_id', $options) ? $options['dashboard_id'] : null; + + // verify the required parameter 'dashboard_id' is set + if ($dashboard_id === null || (is_array($dashboard_id) && count($dashboard_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $dashboard_id when calling deleteDashboard' + ); + } + + $resourcePath = '/observability/dashboards/{dashboard_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($dashboard_id !== null) { + $resourcePath = str_replace( + '{' . 'dashboard_id' . '}', + ObjectSerializer::toPathValue($dashboard_id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + [] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + [], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + } + } + + // this endpoint requires API token authentication + $apiToken = $this->config->getApiTokenWithPrefix('Fastly-Key'); + if ($apiToken !== null) { + $headers['Fastly-Key'] = $apiToken; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHosts = ["https://api.fastly.com"]; + if ($this->hostIndex < 0 || $this->hostIndex >= sizeof($operationHosts)) { + throw new \InvalidArgumentException("Invalid index {$this->hostIndex} when selecting the host. Must be less than ".sizeof($operationHosts)); + } + $operationHost = $operationHosts[$this->hostIndex]; + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getDashboard + * + * Retrieve a dashboard by ID + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * URL: https://api.fastly.com + * + * @param string $dashboard_id dashboard_id (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Fastly\Model\Dashboard + */ + public function getDashboard($options) + { + list($response) = $this->getDashboardWithHttpInfo($options); + return $response; + } + + /** + * Operation getDashboardWithHttpInfo + * + * Retrieve a dashboard by ID + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * This operation contains Fastly API host(s). Use 'hostIndex' to select the host. + * URL: https://api.fastly.com + * + * @param string $dashboard_id (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Fastly\Model\Dashboard, HTTP status code, HTTP response headers (array of strings) + */ + public function getDashboardWithHttpInfo($options) + { + $request = $this->getDashboardRequest($options); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + if ('GET' != 'GET' && 'GET' != 'HEAD') { + $header = $response->getHeader('Fastly-RateLimit-Remaining'); + if (count($header) > 0) { + $this->config->setRateLimitRemaining($header[0]); + } + + $header = $response->getHeader('Fastly-RateLimit-Reset'); + if (count($header) > 0) { + $this->config->setRateLimitReset($header[0]); + } + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Fastly\Model\Dashboard' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\Dashboard', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Fastly\Model\Dashboard'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Fastly\Model\Dashboard', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getDashboardAsync + * + * Retrieve a dashboard by ID + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * URL: https://api.fastly.com + * + * @param string $dashboard_id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getDashboardAsync($options) + { + return $this->getDashboardAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getDashboardAsyncWithHttpInfo + * + * Retrieve a dashboard by ID + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * URL: https://api.fastly.com + * + * @param string $dashboard_id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getDashboardAsyncWithHttpInfo($options) + { + $returnType = '\Fastly\Model\Dashboard'; + $request = $this->getDashboardRequest($options); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getDashboard' + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * URL: https://api.fastly.com + * + * @param string $dashboard_id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getDashboardRequest($options) + { + // unbox the parameters from the associative array + $dashboard_id = array_key_exists('dashboard_id', $options) ? $options['dashboard_id'] : null; + + // verify the required parameter 'dashboard_id' is set + if ($dashboard_id === null || (is_array($dashboard_id) && count($dashboard_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $dashboard_id when calling getDashboard' + ); + } + + $resourcePath = '/observability/dashboards/{dashboard_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($dashboard_id !== null) { + $resourcePath = str_replace( + '{' . 'dashboard_id' . '}', + ObjectSerializer::toPathValue($dashboard_id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + } + } + + // this endpoint requires API token authentication + $apiToken = $this->config->getApiTokenWithPrefix('Fastly-Key'); + if ($apiToken !== null) { + $headers['Fastly-Key'] = $apiToken; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHosts = ["https://api.fastly.com"]; + if ($this->hostIndex < 0 || $this->hostIndex >= sizeof($operationHosts)) { + throw new \InvalidArgumentException("Invalid index {$this->hostIndex} when selecting the host. Must be less than ".sizeof($operationHosts)); + } + $operationHost = $operationHosts[$this->hostIndex]; + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listDashboards + * + * List all custom dashboards + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * URL: https://api.fastly.com + * + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Fastly\Model\ListDashboardsResponse + */ + public function listDashboards($options) + { + list($response) = $this->listDashboardsWithHttpInfo($options); + return $response; + } + + /** + * Operation listDashboardsWithHttpInfo + * + * List all custom dashboards + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * This operation contains Fastly API host(s). Use 'hostIndex' to select the host. + * URL: https://api.fastly.com + * + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Fastly\Model\ListDashboardsResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function listDashboardsWithHttpInfo($options) + { + $request = $this->listDashboardsRequest($options); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + if ('GET' != 'GET' && 'GET' != 'HEAD') { + $header = $response->getHeader('Fastly-RateLimit-Remaining'); + if (count($header) > 0) { + $this->config->setRateLimitRemaining($header[0]); + } + + $header = $response->getHeader('Fastly-RateLimit-Reset'); + if (count($header) > 0) { + $this->config->setRateLimitReset($header[0]); + } + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Fastly\Model\ListDashboardsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\ListDashboardsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Fastly\Model\ListDashboardsResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Fastly\Model\ListDashboardsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listDashboardsAsync + * + * List all custom dashboards + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * URL: https://api.fastly.com + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listDashboardsAsync($options) + { + return $this->listDashboardsAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listDashboardsAsyncWithHttpInfo + * + * List all custom dashboards + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * URL: https://api.fastly.com + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listDashboardsAsyncWithHttpInfo($options) + { + $returnType = '\Fastly\Model\ListDashboardsResponse'; + $request = $this->listDashboardsRequest($options); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listDashboards' + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * URL: https://api.fastly.com + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listDashboardsRequest($options) + { + // unbox the parameters from the associative array + + + $resourcePath = '/observability/dashboards'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + } + } + + // this endpoint requires API token authentication + $apiToken = $this->config->getApiTokenWithPrefix('Fastly-Key'); + if ($apiToken !== null) { + $headers['Fastly-Key'] = $apiToken; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHosts = ["https://api.fastly.com"]; + if ($this->hostIndex < 0 || $this->hostIndex >= sizeof($operationHosts)) { + throw new \InvalidArgumentException("Invalid index {$this->hostIndex} when selecting the host. Must be less than ".sizeof($operationHosts)); + } + $operationHost = $operationHosts[$this->hostIndex]; + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateDashboard + * + * Update an existing dashboard + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * URL: https://api.fastly.com + * + * @param string $dashboard_id dashboard_id (required) + * @param \Fastly\Model\UpdateDashboardRequest $update_dashboard_request update_dashboard_request (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Fastly\Model\Dashboard + */ + public function updateDashboard($options) + { + list($response) = $this->updateDashboardWithHttpInfo($options); + return $response; + } + + /** + * Operation updateDashboardWithHttpInfo + * + * Update an existing dashboard + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * This operation contains Fastly API host(s). Use 'hostIndex' to select the host. + * URL: https://api.fastly.com + * + * @param string $dashboard_id (required) + * @param \Fastly\Model\UpdateDashboardRequest $update_dashboard_request (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Fastly\Model\Dashboard, HTTP status code, HTTP response headers (array of strings) + */ + public function updateDashboardWithHttpInfo($options) + { + $request = $this->updateDashboardRequest($options); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + if ('PATCH' != 'GET' && 'PATCH' != 'HEAD') { + $header = $response->getHeader('Fastly-RateLimit-Remaining'); + if (count($header) > 0) { + $this->config->setRateLimitRemaining($header[0]); + } + + $header = $response->getHeader('Fastly-RateLimit-Reset'); + if (count($header) > 0) { + $this->config->setRateLimitReset($header[0]); + } + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Fastly\Model\Dashboard' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\Dashboard', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Fastly\Model\Dashboard'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Fastly\Model\Dashboard', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateDashboardAsync + * + * Update an existing dashboard + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * URL: https://api.fastly.com + * + * @param string $dashboard_id (required) + * @param \Fastly\Model\UpdateDashboardRequest $update_dashboard_request (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateDashboardAsync($options) + { + return $this->updateDashboardAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateDashboardAsyncWithHttpInfo + * + * Update an existing dashboard + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * URL: https://api.fastly.com + * + * @param string $dashboard_id (required) + * @param \Fastly\Model\UpdateDashboardRequest $update_dashboard_request (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateDashboardAsyncWithHttpInfo($options) + { + $returnType = '\Fastly\Model\Dashboard'; + $request = $this->updateDashboardRequest($options); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateDashboard' + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * URL: https://api.fastly.com + * + * @param string $dashboard_id (required) + * @param \Fastly\Model\UpdateDashboardRequest $update_dashboard_request (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateDashboardRequest($options) + { + // unbox the parameters from the associative array + $dashboard_id = array_key_exists('dashboard_id', $options) ? $options['dashboard_id'] : null; + $update_dashboard_request = array_key_exists('update_dashboard_request', $options) ? $options['update_dashboard_request'] : null; + + // verify the required parameter 'dashboard_id' is set + if ($dashboard_id === null || (is_array($dashboard_id) && count($dashboard_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $dashboard_id when calling updateDashboard' + ); + } + + $resourcePath = '/observability/dashboards/{dashboard_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($dashboard_id !== null) { + $resourcePath = str_replace( + '{' . 'dashboard_id' . '}', + ObjectSerializer::toPathValue($dashboard_id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($update_dashboard_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($update_dashboard_request)); + } else { + $httpBody = $update_dashboard_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + } + } + + // this endpoint requires API token authentication + $apiToken = $this->config->getApiTokenWithPrefix('Fastly-Key'); + if ($apiToken !== null) { + $headers['Fastly-Key'] = $apiToken; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHosts = ["https://api.fastly.com"]; + if ($this->hostIndex < 0 || $this->hostIndex >= sizeof($operationHosts)) { + throw new \InvalidArgumentException("Invalid index {$this->hostIndex} when selecting the host. Must be less than ".sizeof($operationHosts)); + } + $operationHost = $operationHosts[$this->hostIndex]; + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'PATCH', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/TlsCertificatesApi.php b/lib/Api/TlsCertificatesApi.php index 382f2fbf..41d7d7e1 100644 --- a/lib/Api/TlsCertificatesApi.php +++ b/lib/Api/TlsCertificatesApi.php @@ -1022,6 +1022,328 @@ public function getTlsCertRequest($options) ); } + /** + * Operation getTlsCertBlob + * + * Get a TLS certificate blob (Limited Availability) + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * URL: https://api.fastly.com + * + * @param string $tls_certificate_id Alphanumeric string identifying a TLS certificate. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Fastly\Model\TlsCertificateBlobResponse + */ + public function getTlsCertBlob($options) + { + list($response) = $this->getTlsCertBlobWithHttpInfo($options); + return $response; + } + + /** + * Operation getTlsCertBlobWithHttpInfo + * + * Get a TLS certificate blob (Limited Availability) + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * This operation contains Fastly API host(s). Use 'hostIndex' to select the host. + * URL: https://api.fastly.com + * + * @param string $tls_certificate_id Alphanumeric string identifying a TLS certificate. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Fastly\Model\TlsCertificateBlobResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getTlsCertBlobWithHttpInfo($options) + { + $request = $this->getTlsCertBlobRequest($options); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + if ('GET' != 'GET' && 'GET' != 'HEAD') { + $header = $response->getHeader('Fastly-RateLimit-Remaining'); + if (count($header) > 0) { + $this->config->setRateLimitRemaining($header[0]); + } + + $header = $response->getHeader('Fastly-RateLimit-Reset'); + if (count($header) > 0) { + $this->config->setRateLimitReset($header[0]); + } + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Fastly\Model\TlsCertificateBlobResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\TlsCertificateBlobResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Fastly\Model\TlsCertificateBlobResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Fastly\Model\TlsCertificateBlobResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getTlsCertBlobAsync + * + * Get a TLS certificate blob (Limited Availability) + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * URL: https://api.fastly.com + * + * @param string $tls_certificate_id Alphanumeric string identifying a TLS certificate. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getTlsCertBlobAsync($options) + { + return $this->getTlsCertBlobAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getTlsCertBlobAsyncWithHttpInfo + * + * Get a TLS certificate blob (Limited Availability) + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * URL: https://api.fastly.com + * + * @param string $tls_certificate_id Alphanumeric string identifying a TLS certificate. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getTlsCertBlobAsyncWithHttpInfo($options) + { + $returnType = '\Fastly\Model\TlsCertificateBlobResponse'; + $request = $this->getTlsCertBlobRequest($options); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getTlsCertBlob' + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * URL: https://api.fastly.com + * + * @param string $tls_certificate_id Alphanumeric string identifying a TLS certificate. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getTlsCertBlobRequest($options) + { + // unbox the parameters from the associative array + $tls_certificate_id = array_key_exists('tls_certificate_id', $options) ? $options['tls_certificate_id'] : null; + + // verify the required parameter 'tls_certificate_id' is set + if ($tls_certificate_id === null || (is_array($tls_certificate_id) && count($tls_certificate_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $tls_certificate_id when calling getTlsCertBlob' + ); + } + + $resourcePath = '/tls/certificates/{tls_certificate_id}/blob'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($tls_certificate_id !== null) { + $resourcePath = str_replace( + '{' . 'tls_certificate_id' . '}', + ObjectSerializer::toPathValue($tls_certificate_id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + } + } + + // this endpoint requires API token authentication + $apiToken = $this->config->getApiTokenWithPrefix('Fastly-Key'); + if ($apiToken !== null) { + $headers['Fastly-Key'] = $apiToken; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHosts = ["https://api.fastly.com"]; + if ($this->hostIndex < 0 || $this->hostIndex >= sizeof($operationHosts)) { + throw new \InvalidArgumentException("Invalid index {$this->hostIndex} when selecting the host. Must be less than ".sizeof($operationHosts)); + } + $operationHost = $operationHosts[$this->hostIndex]; + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation listTlsCerts * diff --git a/lib/Configuration.php b/lib/Configuration.php index 8f31a58c..c3eacd49 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -89,7 +89,7 @@ class Configuration * * @var string */ - protected $userAgent = 'fastly-php/5.5.0'; + protected $userAgent = 'fastly-php/5.6.0'; /** * Debug switch (default set to false) @@ -453,7 +453,7 @@ public static function toDebugReport() $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; $report .= ' The version of the schema document: 1.0.0' . PHP_EOL; - $report .= ' SDK Package Version: 5.5.0' . PHP_EOL; + $report .= ' SDK Package Version: 5.6.0' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/lib/Model/AsyncResponse.php b/lib/Model/AsyncResponse.php new file mode 100644 index 00000000..153c40d0 --- /dev/null +++ b/lib/Model/AsyncResponse.php @@ -0,0 +1,344 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AsyncResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'async_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'title' => 'string', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'title' => null, + 'status' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyTypes() + { + return self::$fastlyTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyFormats() + { + return self::$fastlyFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'title' => 'title', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'title' => 'setTitle', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'title' => 'getTitle', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$fastlyModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['title'] = $data['title'] ?? null; + $this->container['status'] = $data['status'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets title + * + * @return string|null + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title title + * + * @return self + */ + public function setTitle($title) + { + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status status + * + * @return self + */ + public function setStatus($status) + { + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/CreateDashboardRequest.php b/lib/Model/CreateDashboardRequest.php new file mode 100644 index 00000000..5a289017 --- /dev/null +++ b/lib/Model/CreateDashboardRequest.php @@ -0,0 +1,377 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class CreateDashboardRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'create-dashboard-request'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'name' => 'string', + 'description' => 'string', + 'items' => '\Fastly\Model\DashboardItem[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'name' => null, + 'description' => null, + 'items' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyTypes() + { + return self::$fastlyTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyFormats() + { + return self::$fastlyFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'description' => 'description', + 'items' => 'items' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'description' => 'setDescription', + 'items' => 'setItems' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'description' => 'getDescription', + 'items' => 'getItems' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$fastlyModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + $this->container['description'] = $data['description'] ?? null; + $this->container['items'] = $data['items'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name A human-readable name + * + * @return self + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description A short description of the dashboard + * + * @return self + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets items + * + * @return \Fastly\Model\DashboardItem[]|null + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param \Fastly\Model\DashboardItem[]|null $items A list of [dashboard items](#dashboard-item). + * + * @return self + */ + public function setItems($items) + { + $this->container['items'] = $items; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/Dashboard.php b/lib/Model/Dashboard.php new file mode 100644 index 00000000..6431b198 --- /dev/null +++ b/lib/Model/Dashboard.php @@ -0,0 +1,524 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class Dashboard implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'dashboard'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'id' => 'string', + 'name' => 'string', + 'description' => 'string', + 'items' => '\Fastly\Model\DashboardItem[]', + 'created_at' => '\DateTime', + 'updated_at' => '\DateTime', + 'created_by' => '\Fastly\Model\DashboardPropertyCreatedBy', + 'updated_by' => '\Fastly\Model\DashboardPropertyUpdatedBy' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'id' => null, + 'name' => null, + 'description' => null, + 'items' => null, + 'created_at' => 'date-time', + 'updated_at' => 'date-time', + 'created_by' => null, + 'updated_by' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyTypes() + { + return self::$fastlyTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyFormats() + { + return self::$fastlyFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'description' => 'description', + 'items' => 'items', + 'created_at' => 'created_at', + 'updated_at' => 'updated_at', + 'created_by' => 'created_by', + 'updated_by' => 'updated_by' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'description' => 'setDescription', + 'items' => 'setItems', + 'created_at' => 'setCreatedAt', + 'updated_at' => 'setUpdatedAt', + 'created_by' => 'setCreatedBy', + 'updated_by' => 'setUpdatedBy' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'description' => 'getDescription', + 'items' => 'getItems', + 'created_at' => 'getCreatedAt', + 'updated_at' => 'getUpdatedAt', + 'created_by' => 'getCreatedBy', + 'updated_by' => 'getUpdatedBy' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$fastlyModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['description'] = $data['description'] ?? null; + $this->container['items'] = $data['items'] ?? null; + $this->container['created_at'] = $data['created_at'] ?? null; + $this->container['updated_at'] = $data['updated_at'] ?? null; + $this->container['created_by'] = $data['created_by'] ?? null; + $this->container['updated_by'] = $data['updated_by'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Dashboard identifier (UUID) + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name A human-readable name + * + * @return self + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description A short description of the dashboard + * + * @return self + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets items + * + * @return \Fastly\Model\DashboardItem[]|null + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param \Fastly\Model\DashboardItem[]|null $items A list of [dashboard items](#dashboard-item). + * + * @return self + */ + public function setItems($items) + { + $this->container['items'] = $items; + + return $this; + } + + /** + * Gets created_at + * + * @return \DateTime|null + */ + public function getCreatedAt() + { + return $this->container['created_at']; + } + + /** + * Sets created_at + * + * @param \DateTime|null $created_at Date and time in ISO 8601 format. + * + * @return self + */ + public function setCreatedAt($created_at) + { + $this->container['created_at'] = $created_at; + + return $this; + } + + /** + * Gets updated_at + * + * @return \DateTime|null + */ + public function getUpdatedAt() + { + return $this->container['updated_at']; + } + + /** + * Sets updated_at + * + * @param \DateTime|null $updated_at Date and time in ISO 8601 format. + * + * @return self + */ + public function setUpdatedAt($updated_at) + { + $this->container['updated_at'] = $updated_at; + + return $this; + } + + /** + * Gets created_by + * + * @return \Fastly\Model\DashboardPropertyCreatedBy|null + */ + public function getCreatedBy() + { + return $this->container['created_by']; + } + + /** + * Sets created_by + * + * @param \Fastly\Model\DashboardPropertyCreatedBy|null $created_by created_by + * + * @return self + */ + public function setCreatedBy($created_by) + { + $this->container['created_by'] = $created_by; + + return $this; + } + + /** + * Gets updated_by + * + * @return \Fastly\Model\DashboardPropertyUpdatedBy|null + */ + public function getUpdatedBy() + { + return $this->container['updated_by']; + } + + /** + * Sets updated_by + * + * @param \Fastly\Model\DashboardPropertyUpdatedBy|null $updated_by updated_by + * + * @return self + */ + public function setUpdatedBy($updated_by) + { + $this->container['updated_by'] = $updated_by; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/DashboardItem.php b/lib/Model/DashboardItem.php new file mode 100644 index 00000000..57325be1 --- /dev/null +++ b/lib/Model/DashboardItem.php @@ -0,0 +1,523 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DashboardItem implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'dashboard-item'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'title' => 'string', + 'subtitle' => 'string', + 'data_source' => '\Fastly\Model\DashboardItemPropertyDataSource', + 'visualization' => '\Fastly\Model\DashboardItemPropertyVisualization', + 'id' => 'string', + 'span' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'title' => null, + 'subtitle' => null, + 'data_source' => null, + 'visualization' => null, + 'id' => null, + 'span' => 'int8' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyTypes() + { + return self::$fastlyTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyFormats() + { + return self::$fastlyFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'title' => 'title', + 'subtitle' => 'subtitle', + 'data_source' => 'data_source', + 'visualization' => 'visualization', + 'id' => 'id', + 'span' => 'span' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'title' => 'setTitle', + 'subtitle' => 'setSubtitle', + 'data_source' => 'setDataSource', + 'visualization' => 'setVisualization', + 'id' => 'setId', + 'span' => 'setSpan' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'title' => 'getTitle', + 'subtitle' => 'getSubtitle', + 'data_source' => 'getDataSource', + 'visualization' => 'getVisualization', + 'id' => 'getId', + 'span' => 'getSpan' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$fastlyModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['title'] = $data['title'] ?? null; + $this->container['subtitle'] = $data['subtitle'] ?? null; + $this->container['data_source'] = $data['data_source'] ?? null; + $this->container['visualization'] = $data['visualization'] ?? null; + $this->container['id'] = $data['id'] ?? null; + $this->container['span'] = $data['span'] ?? 4; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['title'] === null) { + $invalidProperties[] = "'title' can't be null"; + } + if ((mb_strlen($this->container['title']) > 255)) { + $invalidProperties[] = "invalid value for 'title', the character length must be smaller than or equal to 255."; + } + + if ((mb_strlen($this->container['title']) < 1)) { + $invalidProperties[] = "invalid value for 'title', the character length must be bigger than or equal to 1."; + } + + if ($this->container['subtitle'] === null) { + $invalidProperties[] = "'subtitle' can't be null"; + } + if ((mb_strlen($this->container['subtitle']) > 255)) { + $invalidProperties[] = "invalid value for 'subtitle', the character length must be smaller than or equal to 255."; + } + + if ((mb_strlen($this->container['subtitle']) < 1)) { + $invalidProperties[] = "invalid value for 'subtitle', the character length must be bigger than or equal to 1."; + } + + if ($this->container['data_source'] === null) { + $invalidProperties[] = "'data_source' can't be null"; + } + if ($this->container['visualization'] === null) { + $invalidProperties[] = "'visualization' can't be null"; + } + if (!is_null($this->container['span']) && ($this->container['span'] > 12)) { + $invalidProperties[] = "invalid value for 'span', must be smaller than or equal to 12."; + } + + if (!is_null($this->container['span']) && ($this->container['span'] < 1)) { + $invalidProperties[] = "invalid value for 'span', must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets title + * + * @return string + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string $title A human-readable title for the dashboard item + * + * @return self + */ + public function setTitle($title) + { + if ((mb_strlen($title) > 255)) { + throw new \InvalidArgumentException('invalid length for $title when calling DashboardItem., must be smaller than or equal to 255.'); + } + if ((mb_strlen($title) < 1)) { + throw new \InvalidArgumentException('invalid length for $title when calling DashboardItem., must be bigger than or equal to 1.'); + } + + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets subtitle + * + * @return string + */ + public function getSubtitle() + { + return $this->container['subtitle']; + } + + /** + * Sets subtitle + * + * @param string $subtitle A human-readable subtitle for the dashboard item. Often a description of the visualization. + * + * @return self + */ + public function setSubtitle($subtitle) + { + if ((mb_strlen($subtitle) > 255)) { + throw new \InvalidArgumentException('invalid length for $subtitle when calling DashboardItem., must be smaller than or equal to 255.'); + } + if ((mb_strlen($subtitle) < 1)) { + throw new \InvalidArgumentException('invalid length for $subtitle when calling DashboardItem., must be bigger than or equal to 1.'); + } + + $this->container['subtitle'] = $subtitle; + + return $this; + } + + /** + * Gets data_source + * + * @return \Fastly\Model\DashboardItemPropertyDataSource + */ + public function getDataSource() + { + return $this->container['data_source']; + } + + /** + * Sets data_source + * + * @param \Fastly\Model\DashboardItemPropertyDataSource $data_source data_source + * + * @return self + */ + public function setDataSource($data_source) + { + $this->container['data_source'] = $data_source; + + return $this; + } + + /** + * Gets visualization + * + * @return \Fastly\Model\DashboardItemPropertyVisualization + */ + public function getVisualization() + { + return $this->container['visualization']; + } + + /** + * Sets visualization + * + * @param \Fastly\Model\DashboardItemPropertyVisualization $visualization visualization + * + * @return self + */ + public function setVisualization($visualization) + { + $this->container['visualization'] = $visualization; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Dashboard item identifier (UUID) + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets span + * + * @return int|null + */ + public function getSpan() + { + return $this->container['span']; + } + + /** + * Sets span + * + * @param int|null $span The number of columns for the dashboard item to span. Dashboards are rendered on a 12-column grid on \"desktop\" screen sizes. + * + * @return self + */ + public function setSpan($span) + { + + if (!is_null($span) && ($span > 12)) { + throw new \InvalidArgumentException('invalid value for $span when calling DashboardItem., must be smaller than or equal to 12.'); + } + if (!is_null($span) && ($span < 1)) { + throw new \InvalidArgumentException('invalid value for $span when calling DashboardItem., must be bigger than or equal to 1.'); + } + + $this->container['span'] = $span; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/DashboardItemPropertyDataSource.php b/lib/Model/DashboardItemPropertyDataSource.php new file mode 100644 index 00000000..1652b2d9 --- /dev/null +++ b/lib/Model/DashboardItemPropertyDataSource.php @@ -0,0 +1,387 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DashboardItemPropertyDataSource implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'dashboard-item-property-data-source'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'type' => 'string', + 'config' => '\Fastly\Model\DashboardItemPropertyDataSourcePropertyConfig' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'type' => null, + 'config' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyTypes() + { + return self::$fastlyTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyFormats() + { + return self::$fastlyFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'config' => 'config' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'config' => 'setConfig' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'config' => 'getConfig' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$fastlyModelName; + } + + const TYPE_EDGE = 'stats.edge'; + const TYPE_DOMAIN = 'stats.domain'; + const TYPE_ORIGIN = 'stats.origin'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_EDGE, + self::TYPE_DOMAIN, + self::TYPE_ORIGIN, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['type'] = $data['type'] ?? null; + $this->container['config'] = $data['config'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['config'] === null) { + $invalidProperties[] = "'config' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type The source of the data to display. + * + * @return self + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets config + * + * @return \Fastly\Model\DashboardItemPropertyDataSourcePropertyConfig + */ + public function getConfig() + { + return $this->container['config']; + } + + /** + * Sets config + * + * @param \Fastly\Model\DashboardItemPropertyDataSourcePropertyConfig $config config + * + * @return self + */ + public function setConfig($config) + { + $this->container['config'] = $config; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/DashboardItemPropertyDataSourcePropertyConfig.php b/lib/Model/DashboardItemPropertyDataSourcePropertyConfig.php new file mode 100644 index 00000000..3cfb71da --- /dev/null +++ b/lib/Model/DashboardItemPropertyDataSourcePropertyConfig.php @@ -0,0 +1,327 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DashboardItemPropertyDataSourcePropertyConfig implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'dashboard-item-property-data-source-property-config'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'metrics' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'metrics' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyTypes() + { + return self::$fastlyTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyFormats() + { + return self::$fastlyFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'metrics' => 'metrics' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'metrics' => 'setMetrics' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'metrics' => 'getMetrics' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$fastlyModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['metrics'] = $data['metrics'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['metrics'] === null) { + $invalidProperties[] = "'metrics' can't be null"; + } + if ((count($this->container['metrics']) < 1)) { + $invalidProperties[] = "invalid value for 'metrics', number of items must be greater than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets metrics + * + * @return string[] + */ + public function getMetrics() + { + return $this->container['metrics']; + } + + /** + * Sets metrics + * + * @param string[] $metrics The metrics to visualize. Valid options are defined by the selected [data source](#field_data_source). + * + * @return self + */ + public function setMetrics($metrics) + { + + + if ((count($metrics) < 1)) { + throw new \InvalidArgumentException('invalid length for $metrics when calling DashboardItemPropertyDataSourcePropertyConfig., number of items must be greater than or equal to 1.'); + } + $this->container['metrics'] = $metrics; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/DashboardItemPropertyVisualization.php b/lib/Model/DashboardItemPropertyVisualization.php new file mode 100644 index 00000000..885ce852 --- /dev/null +++ b/lib/Model/DashboardItemPropertyVisualization.php @@ -0,0 +1,383 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DashboardItemPropertyVisualization implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'dashboard-item-property-visualization'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'type' => 'string', + 'config' => '\Fastly\Model\DashboardItemPropertyVisualizationPropertyConfig' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'type' => null, + 'config' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyTypes() + { + return self::$fastlyTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyFormats() + { + return self::$fastlyFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'config' => 'config' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'config' => 'setConfig' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'config' => 'getConfig' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$fastlyModelName; + } + + const TYPE_CHART = 'chart'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_CHART, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['type'] = $data['type'] ?? null; + $this->container['config'] = $data['config'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['config'] === null) { + $invalidProperties[] = "'config' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type The type of visualization to display. + * + * @return self + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets config + * + * @return \Fastly\Model\DashboardItemPropertyVisualizationPropertyConfig + */ + public function getConfig() + { + return $this->container['config']; + } + + /** + * Sets config + * + * @param \Fastly\Model\DashboardItemPropertyVisualizationPropertyConfig $config config + * + * @return self + */ + public function setConfig($config) + { + $this->container['config'] = $config; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/DashboardItemPropertyVisualizationPropertyConfig.php b/lib/Model/DashboardItemPropertyVisualizationPropertyConfig.php new file mode 100644 index 00000000..4d5253b7 --- /dev/null +++ b/lib/Model/DashboardItemPropertyVisualizationPropertyConfig.php @@ -0,0 +1,506 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DashboardItemPropertyVisualizationPropertyConfig implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'dashboard-item-property-visualization-property-config'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'plot_type' => 'string', + 'format' => 'string', + 'calculation_method' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'plot_type' => null, + 'format' => null, + 'calculation_method' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyTypes() + { + return self::$fastlyTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyFormats() + { + return self::$fastlyFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'plot_type' => 'plot_type', + 'format' => 'format', + 'calculation_method' => 'calculation_method' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'plot_type' => 'setPlotType', + 'format' => 'setFormat', + 'calculation_method' => 'setCalculationMethod' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'plot_type' => 'getPlotType', + 'format' => 'getFormat', + 'calculation_method' => 'getCalculationMethod' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$fastlyModelName; + } + + const PLOT_TYPE_LINE = 'line'; + const PLOT_TYPE_BAR = 'bar'; + const PLOT_TYPE_SINGLE_METRIC = 'single-metric'; + const PLOT_TYPE_DONUT = 'donut'; + const FORMAT_NUMBER = 'number'; + const FORMAT_BYTES = 'bytes'; + const FORMAT_PERCENT = 'percent'; + const FORMAT_REQUESTS = 'requests'; + const FORMAT_RESPONSES = 'responses'; + const FORMAT_SECONDS = 'seconds'; + const FORMAT_MILLISECONDS = 'milliseconds'; + const FORMAT_RATIO = 'ratio'; + const FORMAT_BITRATE = 'bitrate'; + const CALCULATION_METHOD_AVG = 'avg'; + const CALCULATION_METHOD_SUM = 'sum'; + const CALCULATION_METHOD_MIN = 'min'; + const CALCULATION_METHOD_MAX = 'max'; + const CALCULATION_METHOD_LATEST = 'latest'; + const CALCULATION_METHOD_P95 = 'p95'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getPlotTypeAllowableValues() + { + return [ + self::PLOT_TYPE_LINE, + self::PLOT_TYPE_BAR, + self::PLOT_TYPE_SINGLE_METRIC, + self::PLOT_TYPE_DONUT, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getFormatAllowableValues() + { + return [ + self::FORMAT_NUMBER, + self::FORMAT_BYTES, + self::FORMAT_PERCENT, + self::FORMAT_REQUESTS, + self::FORMAT_RESPONSES, + self::FORMAT_SECONDS, + self::FORMAT_MILLISECONDS, + self::FORMAT_RATIO, + self::FORMAT_BITRATE, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getCalculationMethodAllowableValues() + { + return [ + self::CALCULATION_METHOD_AVG, + self::CALCULATION_METHOD_SUM, + self::CALCULATION_METHOD_MIN, + self::CALCULATION_METHOD_MAX, + self::CALCULATION_METHOD_LATEST, + self::CALCULATION_METHOD_P95, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['plot_type'] = $data['plot_type'] ?? null; + $this->container['format'] = $data['format'] ?? 'number'; + $this->container['calculation_method'] = $data['calculation_method'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['plot_type'] === null) { + $invalidProperties[] = "'plot_type' can't be null"; + } + $allowedValues = $this->getPlotTypeAllowableValues(); + if (!is_null($this->container['plot_type']) && !in_array($this->container['plot_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'plot_type', must be one of '%s'", + $this->container['plot_type'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getFormatAllowableValues(); + if (!is_null($this->container['format']) && !in_array($this->container['format'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'format', must be one of '%s'", + $this->container['format'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getCalculationMethodAllowableValues(); + if (!is_null($this->container['calculation_method']) && !in_array($this->container['calculation_method'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'calculation_method', must be one of '%s'", + $this->container['calculation_method'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets plot_type + * + * @return string + */ + public function getPlotType() + { + return $this->container['plot_type']; + } + + /** + * Sets plot_type + * + * @param string $plot_type The type of chart to display. + * + * @return self + */ + public function setPlotType($plot_type) + { + $allowedValues = $this->getPlotTypeAllowableValues(); + if (!in_array($plot_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'plot_type', must be one of '%s'", + $plot_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['plot_type'] = $plot_type; + + return $this; + } + + /** + * Gets format + * + * @return string|null + */ + public function getFormat() + { + return $this->container['format']; + } + + /** + * Sets format + * + * @param string|null $format (Optional) The units to use to format the data. + * + * @return self + */ + public function setFormat($format) + { + $allowedValues = $this->getFormatAllowableValues(); + if (!is_null($format) && !in_array($format, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'format', must be one of '%s'", + $format, + implode("', '", $allowedValues) + ) + ); + } + $this->container['format'] = $format; + + return $this; + } + + /** + * Gets calculation_method + * + * @return string|null + */ + public function getCalculationMethod() + { + return $this->container['calculation_method']; + } + + /** + * Sets calculation_method + * + * @param string|null $calculation_method (Optional) The aggregation function to apply to the dataset. + * + * @return self + */ + public function setCalculationMethod($calculation_method) + { + $allowedValues = $this->getCalculationMethodAllowableValues(); + if (!is_null($calculation_method) && !in_array($calculation_method, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'calculation_method', must be one of '%s'", + $calculation_method, + implode("', '", $allowedValues) + ) + ); + } + $this->container['calculation_method'] = $calculation_method; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/DashboardPropertyCreatedBy.php b/lib/Model/DashboardPropertyCreatedBy.php new file mode 100644 index 00000000..bee4359a --- /dev/null +++ b/lib/Model/DashboardPropertyCreatedBy.php @@ -0,0 +1,290 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DashboardPropertyCreatedBy implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'dashboard-property-created-by'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyTypes() + { + return self::$fastlyTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyFormats() + { + return self::$fastlyFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$fastlyModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/DashboardPropertyUpdatedBy.php b/lib/Model/DashboardPropertyUpdatedBy.php new file mode 100644 index 00000000..5c847900 --- /dev/null +++ b/lib/Model/DashboardPropertyUpdatedBy.php @@ -0,0 +1,290 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DashboardPropertyUpdatedBy implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'dashboard-property-updated-by'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyTypes() + { + return self::$fastlyTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyFormats() + { + return self::$fastlyFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$fastlyModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/DomainInspectorMeasurements.php b/lib/Model/DomainInspectorMeasurements.php index 03466e03..40a3c0ae 100644 --- a/lib/Model/DomainInspectorMeasurements.php +++ b/lib/Model/DomainInspectorMeasurements.php @@ -1491,7 +1491,7 @@ public function getOriginOffload() /** * Sets origin_offload * - * @param float|null $origin_offload Ratio of response bytes delivered from the edge compared to what is delivered from origin, between 0 and 1. (`edge_resp_body_bytes` + `edge_resp_header_bytes`) / (`origin_fetch_resp_body_bytes` + `origin_fetch_resp_header_bytes` + `edge_resp_body_bytes` + `edge_resp_header_bytes`). + * @param float|null $origin_offload Origin Offload measures the ratio of bytes served to end users that were cached by Fastly, over the bytes served to end users, between 0 and 1. ((`edge_resp_body_bytes` + `edge_resp_header_bytes`) - (`origin_fetch_resp_body_bytes` + `origin_fetch_resp_header_bytes`)) / (`edge_resp_body_bytes` + `edge_resp_header_bytes`). Previously, Origin Offload used a different formula. [Learn more](https://www.fastly.com/documentation/reference/changes/2024/06/add-origin_offload-metric). * * @return self */ diff --git a/lib/Model/InvoiceResponse.php b/lib/Model/EomInvoiceResponse.php similarity index 98% rename from lib/Model/InvoiceResponse.php rename to lib/Model/EomInvoiceResponse.php index 0eb4ec57..19442a8f 100644 --- a/lib/Model/InvoiceResponse.php +++ b/lib/Model/EomInvoiceResponse.php @@ -1,6 +1,6 @@ + * @template TKey int|null + * @template TValue mixed|null + */ +class GetServiceLevelUsageResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'get_service_level_usage_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'data' => '\Fastly\Model\ServiceusagemetricsData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyTypes() + { + return self::$fastlyTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyFormats() + { + return self::$fastlyFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$fastlyModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Fastly\Model\ServiceusagemetricsData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Fastly\Model\ServiceusagemetricsData|null $data data + * + * @return self + */ + public function setData($data) + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/RelationshipTlsDnsRecordDnsRecord.php b/lib/Model/GetServiceLevelUsageTypesResponse.php similarity index 93% rename from lib/Model/RelationshipTlsDnsRecordDnsRecord.php rename to lib/Model/GetServiceLevelUsageTypesResponse.php index bffc6001..3c5f4a46 100644 --- a/lib/Model/RelationshipTlsDnsRecordDnsRecord.php +++ b/lib/Model/GetServiceLevelUsageTypesResponse.php @@ -1,6 +1,6 @@ '\Fastly\Model\RelationshipMemberTlsDnsRecord[]' + 'data' => '\Fastly\Model\Serviceusagetype[]' ]; /** @@ -202,7 +202,7 @@ public function valid() /** * Gets data * - * @return \Fastly\Model\RelationshipMemberTlsDnsRecord[]|null + * @return \Fastly\Model\Serviceusagetype[]|null */ public function getData() { @@ -212,7 +212,7 @@ public function getData() /** * Sets data * - * @param \Fastly\Model\RelationshipMemberTlsDnsRecord[]|null $data data + * @param \Fastly\Model\Serviceusagetype[]|null $data data * * @return self */ diff --git a/lib/Model/IncludedWithTlsConfiguration.php b/lib/Model/IncludedWithTlsConfiguration.php new file mode 100644 index 00000000..6de696b6 --- /dev/null +++ b/lib/Model/IncludedWithTlsConfiguration.php @@ -0,0 +1,314 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class IncludedWithTlsConfiguration implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'included_with_tls_configuration'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'included' => '\Fastly\Model\IncludedWithTlsConfigurationItem[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'included' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyTypes() + { + return self::$fastlyTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyFormats() + { + return self::$fastlyFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'included' => 'included' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'included' => 'setIncluded' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'included' => 'getIncluded' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$fastlyModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['included'] = $data['included'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets included + * + * @return \Fastly\Model\IncludedWithTlsConfigurationItem[]|null + */ + public function getIncluded() + { + return $this->container['included']; + } + + /** + * Sets included + * + * @param \Fastly\Model\IncludedWithTlsConfigurationItem[]|null $included included + * + * @return self + */ + public function setIncluded($included) + { + $this->container['included'] = $included; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/IncludedWithTlsConfigurationItem.php b/lib/Model/IncludedWithTlsConfigurationItem.php new file mode 100644 index 00000000..04ca03f0 --- /dev/null +++ b/lib/Model/IncludedWithTlsConfigurationItem.php @@ -0,0 +1,374 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class IncludedWithTlsConfigurationItem implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'included_with_tls_configuration_item'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'id' => 'string', + 'type' => '\Fastly\Model\TypeTlsDnsRecord', + 'attributes' => '\Fastly\Model\TlsDnsRecord' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'id' => null, + 'type' => null, + 'attributes' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyTypes() + { + return self::$fastlyTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyFormats() + { + return self::$fastlyFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'type' => 'type', + 'attributes' => 'attributes' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'type' => 'setType', + 'attributes' => 'setAttributes' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'type' => 'getType', + 'attributes' => 'getAttributes' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$fastlyModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['type'] = $data['type'] ?? null; + $this->container['attributes'] = $data['attributes'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The IP address or hostname of the DNS record. + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * + * @return \Fastly\Model\TypeTlsDnsRecord|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \Fastly\Model\TypeTlsDnsRecord|null $type type + * + * @return self + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets attributes + * + * @return \Fastly\Model\TlsDnsRecord|null + */ + public function getAttributes() + { + return $this->container['attributes']; + } + + /** + * Sets attributes + * + * @param \Fastly\Model\TlsDnsRecord|null $attributes attributes + * + * @return self + */ + public function setAttributes($attributes) + { + $this->container['attributes'] = $attributes; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/Invoicelineitems.php b/lib/Model/Invoicelineitems.php index cb7c16ba..4b0fa572 100644 --- a/lib/Model/Invoicelineitems.php +++ b/lib/Model/Invoicelineitems.php @@ -117,11 +117,11 @@ public static function fastlyFormats() 'credit_coupon_code' => 'credit_coupon_code', 'rate' => 'rate', 'units' => 'units', - 'product_name' => 'ProductName', - 'product_group' => 'ProductGroup', - 'product_line' => 'ProductLine', - 'region' => 'Region', - 'usage_type' => 'UsageType' + 'product_name' => 'product_name', + 'product_group' => 'product_group', + 'product_line' => 'product_line', + 'region' => 'region', + 'usage_type' => 'usage_type' ]; /** diff --git a/lib/Model/ListDashboardsResponse.php b/lib/Model/ListDashboardsResponse.php new file mode 100644 index 00000000..cca48d72 --- /dev/null +++ b/lib/Model/ListDashboardsResponse.php @@ -0,0 +1,344 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ListDashboardsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'list-dashboards-response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'data' => '\Fastly\Model\Dashboard[]', + 'meta' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'data' => null, + 'meta' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyTypes() + { + return self::$fastlyTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyFormats() + { + return self::$fastlyFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'meta' => 'meta' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'meta' => 'setMeta' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'meta' => 'getMeta' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$fastlyModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + $this->container['meta'] = $data['meta'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Fastly\Model\Dashboard[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Fastly\Model\Dashboard[]|null $data data + * + * @return self + */ + public function setData($data) + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets meta + * + * @return object|null + */ + public function getMeta() + { + return $this->container['meta']; + } + + /** + * Sets meta + * + * @param object|null $meta Meta for the pagination. + * + * @return self + */ + public function setMeta($meta) + { + $this->container['meta'] = $meta; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ListInvoicesResponse.php b/lib/Model/ListEomInvoicesResponse.php similarity index 96% rename from lib/Model/ListInvoicesResponse.php rename to lib/Model/ListEomInvoicesResponse.php index df81fc55..d2afe758 100644 --- a/lib/Model/ListInvoicesResponse.php +++ b/lib/Model/ListEomInvoicesResponse.php @@ -1,6 +1,6 @@ + * @template TKey int|null + * @template TValue mixed|null + */ +class MtdInvoiceResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'mtd_invoice_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'customer_id' => 'string', + 'invoice_id' => 'string', + 'billing_start_date' => '\DateTime', + 'billing_end_date' => '\DateTime', + 'monthly_transaction_amount' => 'string', + 'transaction_line_items' => '\Fastly\Model\Mtdlineitems[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'customer_id' => null, + 'invoice_id' => null, + 'billing_start_date' => 'date-time', + 'billing_end_date' => 'date-time', + 'monthly_transaction_amount' => null, + 'transaction_line_items' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyTypes() + { + return self::$fastlyTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyFormats() + { + return self::$fastlyFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'customer_id' => 'customer_id', + 'invoice_id' => 'invoice_id', + 'billing_start_date' => 'billing_start_date', + 'billing_end_date' => 'billing_end_date', + 'monthly_transaction_amount' => 'monthly_transaction_amount', + 'transaction_line_items' => 'transaction_line_items' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'customer_id' => 'setCustomerId', + 'invoice_id' => 'setInvoiceId', + 'billing_start_date' => 'setBillingStartDate', + 'billing_end_date' => 'setBillingEndDate', + 'monthly_transaction_amount' => 'setMonthlyTransactionAmount', + 'transaction_line_items' => 'setTransactionLineItems' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'customer_id' => 'getCustomerId', + 'invoice_id' => 'getInvoiceId', + 'billing_start_date' => 'getBillingStartDate', + 'billing_end_date' => 'getBillingEndDate', + 'monthly_transaction_amount' => 'getMonthlyTransactionAmount', + 'transaction_line_items' => 'getTransactionLineItems' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$fastlyModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['customer_id'] = $data['customer_id'] ?? null; + $this->container['invoice_id'] = $data['invoice_id'] ?? null; + $this->container['billing_start_date'] = $data['billing_start_date'] ?? null; + $this->container['billing_end_date'] = $data['billing_end_date'] ?? null; + $this->container['monthly_transaction_amount'] = $data['monthly_transaction_amount'] ?? null; + $this->container['transaction_line_items'] = $data['transaction_line_items'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets customer_id + * + * @return string|null + */ + public function getCustomerId() + { + return $this->container['customer_id']; + } + + /** + * Sets customer_id + * + * @param string|null $customer_id The Customer ID associated with the invoice. + * + * @return self + */ + public function setCustomerId($customer_id) + { + $this->container['customer_id'] = $customer_id; + + return $this; + } + + /** + * Gets invoice_id + * + * @return string|null + */ + public function getInvoiceId() + { + return $this->container['invoice_id']; + } + + /** + * Sets invoice_id + * + * @param string|null $invoice_id An alphanumeric string identifying the invoice. + * + * @return self + */ + public function setInvoiceId($invoice_id) + { + $this->container['invoice_id'] = $invoice_id; + + return $this; + } + + /** + * Gets billing_start_date + * + * @return \DateTime|null + */ + public function getBillingStartDate() + { + return $this->container['billing_start_date']; + } + + /** + * Sets billing_start_date + * + * @param \DateTime|null $billing_start_date The date and time (in ISO 8601 format) for the initiation point of a billing cycle, signifying the start of charges for a service or subscription. + * + * @return self + */ + public function setBillingStartDate($billing_start_date) + { + $this->container['billing_start_date'] = $billing_start_date; + + return $this; + } + + /** + * Gets billing_end_date + * + * @return \DateTime|null + */ + public function getBillingEndDate() + { + return $this->container['billing_end_date']; + } + + /** + * Sets billing_end_date + * + * @param \DateTime|null $billing_end_date The date and time (in ISO 8601 format) for the termination point of a billing cycle, signifying the end of charges for a service or subscription. + * + * @return self + */ + public function setBillingEndDate($billing_end_date) + { + $this->container['billing_end_date'] = $billing_end_date; + + return $this; + } + + /** + * Gets monthly_transaction_amount + * + * @return string|null + */ + public function getMonthlyTransactionAmount() + { + return $this->container['monthly_transaction_amount']; + } + + /** + * Sets monthly_transaction_amount + * + * @param string|null $monthly_transaction_amount The total billable amount for invoiced services charged within a single month. + * + * @return self + */ + public function setMonthlyTransactionAmount($monthly_transaction_amount) + { + $this->container['monthly_transaction_amount'] = $monthly_transaction_amount; + + return $this; + } + + /** + * Gets transaction_line_items + * + * @return \Fastly\Model\Mtdlineitems[]|null + */ + public function getTransactionLineItems() + { + return $this->container['transaction_line_items']; + } + + /** + * Sets transaction_line_items + * + * @param \Fastly\Model\Mtdlineitems[]|null $transaction_line_items transaction_line_items + * + * @return self + */ + public function setTransactionLineItems($transaction_line_items) + { + $this->container['transaction_line_items'] = $transaction_line_items; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/Mtdinvoice.php b/lib/Model/Mtdinvoice.php new file mode 100644 index 00000000..24fadf8b --- /dev/null +++ b/lib/Model/Mtdinvoice.php @@ -0,0 +1,464 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class Mtdinvoice implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'mtdinvoice'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'customer_id' => 'string', + 'invoice_id' => 'string', + 'billing_start_date' => '\DateTime', + 'billing_end_date' => '\DateTime', + 'monthly_transaction_amount' => 'string', + 'transaction_line_items' => '\Fastly\Model\Mtdlineitems[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'customer_id' => null, + 'invoice_id' => null, + 'billing_start_date' => 'date-time', + 'billing_end_date' => 'date-time', + 'monthly_transaction_amount' => null, + 'transaction_line_items' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyTypes() + { + return self::$fastlyTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyFormats() + { + return self::$fastlyFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'customer_id' => 'customer_id', + 'invoice_id' => 'invoice_id', + 'billing_start_date' => 'billing_start_date', + 'billing_end_date' => 'billing_end_date', + 'monthly_transaction_amount' => 'monthly_transaction_amount', + 'transaction_line_items' => 'transaction_line_items' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'customer_id' => 'setCustomerId', + 'invoice_id' => 'setInvoiceId', + 'billing_start_date' => 'setBillingStartDate', + 'billing_end_date' => 'setBillingEndDate', + 'monthly_transaction_amount' => 'setMonthlyTransactionAmount', + 'transaction_line_items' => 'setTransactionLineItems' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'customer_id' => 'getCustomerId', + 'invoice_id' => 'getInvoiceId', + 'billing_start_date' => 'getBillingStartDate', + 'billing_end_date' => 'getBillingEndDate', + 'monthly_transaction_amount' => 'getMonthlyTransactionAmount', + 'transaction_line_items' => 'getTransactionLineItems' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$fastlyModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['customer_id'] = $data['customer_id'] ?? null; + $this->container['invoice_id'] = $data['invoice_id'] ?? null; + $this->container['billing_start_date'] = $data['billing_start_date'] ?? null; + $this->container['billing_end_date'] = $data['billing_end_date'] ?? null; + $this->container['monthly_transaction_amount'] = $data['monthly_transaction_amount'] ?? null; + $this->container['transaction_line_items'] = $data['transaction_line_items'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets customer_id + * + * @return string|null + */ + public function getCustomerId() + { + return $this->container['customer_id']; + } + + /** + * Sets customer_id + * + * @param string|null $customer_id The Customer ID associated with the invoice. + * + * @return self + */ + public function setCustomerId($customer_id) + { + $this->container['customer_id'] = $customer_id; + + return $this; + } + + /** + * Gets invoice_id + * + * @return string|null + */ + public function getInvoiceId() + { + return $this->container['invoice_id']; + } + + /** + * Sets invoice_id + * + * @param string|null $invoice_id An alphanumeric string identifying the invoice. + * + * @return self + */ + public function setInvoiceId($invoice_id) + { + $this->container['invoice_id'] = $invoice_id; + + return $this; + } + + /** + * Gets billing_start_date + * + * @return \DateTime|null + */ + public function getBillingStartDate() + { + return $this->container['billing_start_date']; + } + + /** + * Sets billing_start_date + * + * @param \DateTime|null $billing_start_date The date and time (in ISO 8601 format) for the initiation point of a billing cycle, signifying the start of charges for a service or subscription. + * + * @return self + */ + public function setBillingStartDate($billing_start_date) + { + $this->container['billing_start_date'] = $billing_start_date; + + return $this; + } + + /** + * Gets billing_end_date + * + * @return \DateTime|null + */ + public function getBillingEndDate() + { + return $this->container['billing_end_date']; + } + + /** + * Sets billing_end_date + * + * @param \DateTime|null $billing_end_date The date and time (in ISO 8601 format) for the termination point of a billing cycle, signifying the end of charges for a service or subscription. + * + * @return self + */ + public function setBillingEndDate($billing_end_date) + { + $this->container['billing_end_date'] = $billing_end_date; + + return $this; + } + + /** + * Gets monthly_transaction_amount + * + * @return string|null + */ + public function getMonthlyTransactionAmount() + { + return $this->container['monthly_transaction_amount']; + } + + /** + * Sets monthly_transaction_amount + * + * @param string|null $monthly_transaction_amount The total billable amount for invoiced services charged within a single month. + * + * @return self + */ + public function setMonthlyTransactionAmount($monthly_transaction_amount) + { + $this->container['monthly_transaction_amount'] = $monthly_transaction_amount; + + return $this; + } + + /** + * Gets transaction_line_items + * + * @return \Fastly\Model\Mtdlineitems[]|null + */ + public function getTransactionLineItems() + { + return $this->container['transaction_line_items']; + } + + /** + * Sets transaction_line_items + * + * @param \Fastly\Model\Mtdlineitems[]|null $transaction_line_items transaction_line_items + * + * @return self + */ + public function setTransactionLineItems($transaction_line_items) + { + $this->container['transaction_line_items'] = $transaction_line_items; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/Mtdlineitems.php b/lib/Model/Mtdlineitems.php new file mode 100644 index 00000000..d629c569 --- /dev/null +++ b/lib/Model/Mtdlineitems.php @@ -0,0 +1,554 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class Mtdlineitems implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'mtdlineitems'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'description' => 'string', + 'amount' => 'float', + 'rate' => 'float', + 'units' => 'float', + 'product_name' => 'string', + 'product_group' => 'string', + 'product_line' => 'string', + 'region' => 'string', + 'usage_type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'description' => null, + 'amount' => null, + 'rate' => null, + 'units' => null, + 'product_name' => null, + 'product_group' => null, + 'product_line' => null, + 'region' => null, + 'usage_type' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyTypes() + { + return self::$fastlyTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyFormats() + { + return self::$fastlyFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'description' => 'description', + 'amount' => 'amount', + 'rate' => 'rate', + 'units' => 'units', + 'product_name' => 'product_name', + 'product_group' => 'product_group', + 'product_line' => 'product_line', + 'region' => 'region', + 'usage_type' => 'usage_type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'amount' => 'setAmount', + 'rate' => 'setRate', + 'units' => 'setUnits', + 'product_name' => 'setProductName', + 'product_group' => 'setProductGroup', + 'product_line' => 'setProductLine', + 'region' => 'setRegion', + 'usage_type' => 'setUsageType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'amount' => 'getAmount', + 'rate' => 'getRate', + 'units' => 'getUnits', + 'product_name' => 'getProductName', + 'product_group' => 'getProductGroup', + 'product_line' => 'getProductLine', + 'region' => 'getRegion', + 'usage_type' => 'getUsageType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$fastlyModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['description'] = $data['description'] ?? null; + $this->container['amount'] = $data['amount'] ?? null; + $this->container['rate'] = $data['rate'] ?? null; + $this->container['units'] = $data['units'] ?? null; + $this->container['product_name'] = $data['product_name'] ?? null; + $this->container['product_group'] = $data['product_group'] ?? null; + $this->container['product_line'] = $data['product_line'] ?? null; + $this->container['region'] = $data['region'] ?? null; + $this->container['usage_type'] = $data['usage_type'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Invoice line item transaction name. + * + * @return self + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets amount + * + * @return float|null + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param float|null $amount Billed amount for line item. + * + * @return self + */ + public function setAmount($amount) + { + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets rate + * + * @return float|null + */ + public function getRate() + { + return $this->container['rate']; + } + + /** + * Sets rate + * + * @param float|null $rate Price per unit. + * + * @return self + */ + public function setRate($rate) + { + $this->container['rate'] = $rate; + + return $this; + } + + /** + * Gets units + * + * @return float|null + */ + public function getUnits() + { + return $this->container['units']; + } + + /** + * Sets units + * + * @param float|null $units Total number of units of usage. + * + * @return self + */ + public function setUnits($units) + { + $this->container['units'] = $units; + + return $this; + } + + /** + * Gets product_name + * + * @return string|null + */ + public function getProductName() + { + return $this->container['product_name']; + } + + /** + * Sets product_name + * + * @param string|null $product_name The name of the product. + * + * @return self + */ + public function setProductName($product_name) + { + $this->container['product_name'] = $product_name; + + return $this; + } + + /** + * Gets product_group + * + * @return string|null + */ + public function getProductGroup() + { + return $this->container['product_group']; + } + + /** + * Sets product_group + * + * @param string|null $product_group The broader classification of the product (e.g., `Compute` or `Full-Site Delivery`). + * + * @return self + */ + public function setProductGroup($product_group) + { + $this->container['product_group'] = $product_group; + + return $this; + } + + /** + * Gets product_line + * + * @return string|null + */ + public function getProductLine() + { + return $this->container['product_line']; + } + + /** + * Sets product_line + * + * @param string|null $product_line The broader classification of the product (e.g., `Network Services` or `Security`). + * + * @return self + */ + public function setProductLine($product_line) + { + $this->container['product_line'] = $product_line; + + return $this; + } + + /** + * Gets region + * + * @return string|null + */ + public function getRegion() + { + return $this->container['region']; + } + + /** + * Sets region + * + * @param string|null $region The geographical area applicable for regionally based products. + * + * @return self + */ + public function setRegion($region) + { + $this->container['region'] = $region; + + return $this; + } + + /** + * Gets usage_type + * + * @return string|null + */ + public function getUsageType() + { + return $this->container['usage_type']; + } + + /** + * Sets usage_type + * + * @param string|null $usage_type The unit of measure (e.g., `requests` or `bandwidth`). + * + * @return self + */ + public function setUsageType($usage_type) + { + $this->container['usage_type'] = $usage_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/RealtimeEntryAggregated.php b/lib/Model/RealtimeEntryAggregated.php index 9f994d62..fe6243f2 100644 --- a/lib/Model/RealtimeEntryAggregated.php +++ b/lib/Model/RealtimeEntryAggregated.php @@ -301,7 +301,8 @@ class RealtimeEntryAggregated implements ModelInterface, ArrayAccess, \JsonSeria 'all_status_2xx' => 'int', 'all_status_3xx' => 'int', 'all_status_4xx' => 'int', - 'all_status_5xx' => 'int' + 'all_status_5xx' => 'int', + 'origin_offload' => 'float' ]; /** @@ -559,7 +560,8 @@ class RealtimeEntryAggregated implements ModelInterface, ArrayAccess, \JsonSeria 'all_status_2xx' => null, 'all_status_3xx' => null, 'all_status_4xx' => null, - 'all_status_5xx' => null + 'all_status_5xx' => null, + 'origin_offload' => null ]; /** @@ -836,7 +838,8 @@ public static function fastlyFormats() 'all_status_2xx' => 'all_status_2xx', 'all_status_3xx' => 'all_status_3xx', 'all_status_4xx' => 'all_status_4xx', - 'all_status_5xx' => 'all_status_5xx' + 'all_status_5xx' => 'all_status_5xx', + 'origin_offload' => 'origin_offload' ]; /** @@ -1092,7 +1095,8 @@ public static function fastlyFormats() 'all_status_2xx' => 'setAllStatus2xx', 'all_status_3xx' => 'setAllStatus3xx', 'all_status_4xx' => 'setAllStatus4xx', - 'all_status_5xx' => 'setAllStatus5xx' + 'all_status_5xx' => 'setAllStatus5xx', + 'origin_offload' => 'setOriginOffload' ]; /** @@ -1348,7 +1352,8 @@ public static function fastlyFormats() 'all_status_2xx' => 'getAllStatus2xx', 'all_status_3xx' => 'getAllStatus3xx', 'all_status_4xx' => 'getAllStatus4xx', - 'all_status_5xx' => 'getAllStatus5xx' + 'all_status_5xx' => 'getAllStatus5xx', + 'origin_offload' => 'getOriginOffload' ]; /** @@ -1656,6 +1661,7 @@ public function __construct(array $data = null) $this->container['all_status_3xx'] = $data['all_status_3xx'] ?? null; $this->container['all_status_4xx'] = $data['all_status_4xx'] ?? null; $this->container['all_status_5xx'] = $data['all_status_5xx'] ?? null; + $this->container['origin_offload'] = $data['origin_offload'] ?? null; } /** @@ -7637,6 +7643,30 @@ public function setAllStatus5xx($all_status_5xx) return $this; } + + /** + * Gets origin_offload + * + * @return float|null + */ + public function getOriginOffload() + { + return $this->container['origin_offload']; + } + + /** + * Sets origin_offload + * + * @param float|null $origin_offload Origin Offload measures the ratio of bytes served to end users that were cached by Fastly, over the bytes served to end users, between 0 and 1. ((`edge_resp_body_bytes` + `edge_resp_header_bytes`) - (`origin_fetch_resp_body_bytes` + `origin_fetch_resp_header_bytes`)) / (`edge_resp_body_bytes` + `edge_resp_header_bytes`). + * + * @return self + */ + public function setOriginOffload($origin_offload) + { + $this->container['origin_offload'] = $origin_offload; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/RealtimeMeasurements.php b/lib/Model/RealtimeMeasurements.php index d879391b..9e1e5a99 100644 --- a/lib/Model/RealtimeMeasurements.php +++ b/lib/Model/RealtimeMeasurements.php @@ -301,7 +301,8 @@ class RealtimeMeasurements implements ModelInterface, ArrayAccess, \JsonSerializ 'all_status_2xx' => 'int', 'all_status_3xx' => 'int', 'all_status_4xx' => 'int', - 'all_status_5xx' => 'int' + 'all_status_5xx' => 'int', + 'origin_offload' => 'float' ]; /** @@ -559,7 +560,8 @@ class RealtimeMeasurements implements ModelInterface, ArrayAccess, \JsonSerializ 'all_status_2xx' => null, 'all_status_3xx' => null, 'all_status_4xx' => null, - 'all_status_5xx' => null + 'all_status_5xx' => null, + 'origin_offload' => null ]; /** @@ -836,7 +838,8 @@ public static function fastlyFormats() 'all_status_2xx' => 'all_status_2xx', 'all_status_3xx' => 'all_status_3xx', 'all_status_4xx' => 'all_status_4xx', - 'all_status_5xx' => 'all_status_5xx' + 'all_status_5xx' => 'all_status_5xx', + 'origin_offload' => 'origin_offload' ]; /** @@ -1092,7 +1095,8 @@ public static function fastlyFormats() 'all_status_2xx' => 'setAllStatus2xx', 'all_status_3xx' => 'setAllStatus3xx', 'all_status_4xx' => 'setAllStatus4xx', - 'all_status_5xx' => 'setAllStatus5xx' + 'all_status_5xx' => 'setAllStatus5xx', + 'origin_offload' => 'setOriginOffload' ]; /** @@ -1348,7 +1352,8 @@ public static function fastlyFormats() 'all_status_2xx' => 'getAllStatus2xx', 'all_status_3xx' => 'getAllStatus3xx', 'all_status_4xx' => 'getAllStatus4xx', - 'all_status_5xx' => 'getAllStatus5xx' + 'all_status_5xx' => 'getAllStatus5xx', + 'origin_offload' => 'getOriginOffload' ]; /** @@ -1656,6 +1661,7 @@ public function __construct(array $data = null) $this->container['all_status_3xx'] = $data['all_status_3xx'] ?? null; $this->container['all_status_4xx'] = $data['all_status_4xx'] ?? null; $this->container['all_status_5xx'] = $data['all_status_5xx'] ?? null; + $this->container['origin_offload'] = $data['origin_offload'] ?? null; } /** @@ -7637,6 +7643,30 @@ public function setAllStatus5xx($all_status_5xx) return $this; } + + /** + * Gets origin_offload + * + * @return float|null + */ + public function getOriginOffload() + { + return $this->container['origin_offload']; + } + + /** + * Sets origin_offload + * + * @param float|null $origin_offload Origin Offload measures the ratio of bytes served to end users that were cached by Fastly, over the bytes served to end users, between 0 and 1. ((`edge_resp_body_bytes` + `edge_resp_header_bytes`) - (`origin_fetch_resp_body_bytes` + `origin_fetch_resp_header_bytes`)) / (`edge_resp_body_bytes` + `edge_resp_header_bytes`). + * + * @return self + */ + public function setOriginOffload($origin_offload) + { + $this->container['origin_offload'] = $origin_offload; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/RelationshipDefaultEcdsaTlsCertificate.php b/lib/Model/RelationshipDefaultEcdsaTlsCertificate.php new file mode 100644 index 00000000..a4176e39 --- /dev/null +++ b/lib/Model/RelationshipDefaultEcdsaTlsCertificate.php @@ -0,0 +1,314 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RelationshipDefaultEcdsaTlsCertificate implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'relationship_default_ecdsa_tls_certificate'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'default_ecdsa_certificate' => '\Fastly\Model\RelationshipDefaultEcdsaTlsCertificateDefaultEcdsaCertificate' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'default_ecdsa_certificate' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyTypes() + { + return self::$fastlyTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyFormats() + { + return self::$fastlyFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'default_ecdsa_certificate' => 'default_ecdsa_certificate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'default_ecdsa_certificate' => 'setDefaultEcdsaCertificate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'default_ecdsa_certificate' => 'getDefaultEcdsaCertificate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$fastlyModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['default_ecdsa_certificate'] = $data['default_ecdsa_certificate'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets default_ecdsa_certificate + * + * @return \Fastly\Model\RelationshipDefaultEcdsaTlsCertificateDefaultEcdsaCertificate|null + */ + public function getDefaultEcdsaCertificate() + { + return $this->container['default_ecdsa_certificate']; + } + + /** + * Sets default_ecdsa_certificate + * + * @param \Fastly\Model\RelationshipDefaultEcdsaTlsCertificateDefaultEcdsaCertificate|null $default_ecdsa_certificate default_ecdsa_certificate + * + * @return self + */ + public function setDefaultEcdsaCertificate($default_ecdsa_certificate) + { + $this->container['default_ecdsa_certificate'] = $default_ecdsa_certificate; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/RelationshipDefaultEcdsaTlsCertificateDefaultEcdsaCertificate.php b/lib/Model/RelationshipDefaultEcdsaTlsCertificateDefaultEcdsaCertificate.php new file mode 100644 index 00000000..f91a97b3 --- /dev/null +++ b/lib/Model/RelationshipDefaultEcdsaTlsCertificateDefaultEcdsaCertificate.php @@ -0,0 +1,314 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RelationshipDefaultEcdsaTlsCertificateDefaultEcdsaCertificate implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'relationship_default_ecdsa_tls_certificate_default_ecdsa_certificate'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'data' => '\Fastly\Model\RelationshipDefaultEcdsaTlsCertificateDefaultEcdsaCertificateData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyTypes() + { + return self::$fastlyTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyFormats() + { + return self::$fastlyFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$fastlyModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Fastly\Model\RelationshipDefaultEcdsaTlsCertificateDefaultEcdsaCertificateData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Fastly\Model\RelationshipDefaultEcdsaTlsCertificateDefaultEcdsaCertificateData|null $data data + * + * @return self + */ + public function setData($data) + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/RelationshipDefaultEcdsaTlsCertificateDefaultEcdsaCertificateData.php b/lib/Model/RelationshipDefaultEcdsaTlsCertificateDefaultEcdsaCertificateData.php new file mode 100644 index 00000000..1fbb6b6c --- /dev/null +++ b/lib/Model/RelationshipDefaultEcdsaTlsCertificateDefaultEcdsaCertificateData.php @@ -0,0 +1,344 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RelationshipDefaultEcdsaTlsCertificateDefaultEcdsaCertificateData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'relationship_default_ecdsa_tls_certificate_default_ecdsa_certificate_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'type' => '\Fastly\Model\TypeTlsCertificate', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'type' => null, + 'id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyTypes() + { + return self::$fastlyTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyFormats() + { + return self::$fastlyFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$fastlyModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['type'] = $data['type'] ?? null; + $this->container['id'] = $data['id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return \Fastly\Model\TypeTlsCertificate|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \Fastly\Model\TypeTlsCertificate|null $type type + * + * @return self + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Alphanumeric string identifying the default ECDSA TLS certificate. + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/RelationshipDefaultTlsCertificate.php b/lib/Model/RelationshipDefaultTlsCertificate.php new file mode 100644 index 00000000..9ce7f447 --- /dev/null +++ b/lib/Model/RelationshipDefaultTlsCertificate.php @@ -0,0 +1,314 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RelationshipDefaultTlsCertificate implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'relationship_default_tls_certificate'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'default_certificate' => '\Fastly\Model\RelationshipDefaultTlsCertificateDefaultCertificate' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'default_certificate' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyTypes() + { + return self::$fastlyTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyFormats() + { + return self::$fastlyFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'default_certificate' => 'default_certificate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'default_certificate' => 'setDefaultCertificate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'default_certificate' => 'getDefaultCertificate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$fastlyModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['default_certificate'] = $data['default_certificate'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets default_certificate + * + * @return \Fastly\Model\RelationshipDefaultTlsCertificateDefaultCertificate|null + */ + public function getDefaultCertificate() + { + return $this->container['default_certificate']; + } + + /** + * Sets default_certificate + * + * @param \Fastly\Model\RelationshipDefaultTlsCertificateDefaultCertificate|null $default_certificate default_certificate + * + * @return self + */ + public function setDefaultCertificate($default_certificate) + { + $this->container['default_certificate'] = $default_certificate; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/RelationshipDefaultTlsCertificateDefaultCertificate.php b/lib/Model/RelationshipDefaultTlsCertificateDefaultCertificate.php new file mode 100644 index 00000000..8509cd48 --- /dev/null +++ b/lib/Model/RelationshipDefaultTlsCertificateDefaultCertificate.php @@ -0,0 +1,314 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RelationshipDefaultTlsCertificateDefaultCertificate implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'relationship_default_tls_certificate_default_certificate'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'data' => '\Fastly\Model\RelationshipDefaultTlsCertificateDefaultCertificateData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyTypes() + { + return self::$fastlyTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyFormats() + { + return self::$fastlyFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$fastlyModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Fastly\Model\RelationshipDefaultTlsCertificateDefaultCertificateData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Fastly\Model\RelationshipDefaultTlsCertificateDefaultCertificateData|null $data data + * + * @return self + */ + public function setData($data) + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/RelationshipDefaultTlsCertificateDefaultCertificateData.php b/lib/Model/RelationshipDefaultTlsCertificateDefaultCertificateData.php new file mode 100644 index 00000000..9b727101 --- /dev/null +++ b/lib/Model/RelationshipDefaultTlsCertificateDefaultCertificateData.php @@ -0,0 +1,344 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RelationshipDefaultTlsCertificateDefaultCertificateData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'relationship_default_tls_certificate_default_certificate_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'type' => '\Fastly\Model\TypeTlsCertificate', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'type' => null, + 'id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyTypes() + { + return self::$fastlyTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyFormats() + { + return self::$fastlyFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$fastlyModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['type'] = $data['type'] ?? null; + $this->container['id'] = $data['id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return \Fastly\Model\TypeTlsCertificate|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \Fastly\Model\TypeTlsCertificate|null $type type + * + * @return self + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Alphanumeric string identifying the default TLS certificate. + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/RelationshipTlsDnsRecords.php b/lib/Model/RelationshipTlsDnsRecordsRequest.php similarity index 94% rename from lib/Model/RelationshipTlsDnsRecords.php rename to lib/Model/RelationshipTlsDnsRecordsRequest.php index 876978aa..35311c41 100644 --- a/lib/Model/RelationshipTlsDnsRecords.php +++ b/lib/Model/RelationshipTlsDnsRecordsRequest.php @@ -1,6 +1,6 @@ '\Fastly\Model\RelationshipTlsDnsRecordDnsRecord' + 'dns_records' => '\Fastly\Model\RelationshipTlsDnsRecordsRequestDnsRecords' ]; /** @@ -202,7 +202,7 @@ public function valid() /** * Gets dns_records * - * @return \Fastly\Model\RelationshipTlsDnsRecordDnsRecord|null + * @return \Fastly\Model\RelationshipTlsDnsRecordsRequestDnsRecords|null */ public function getDnsRecords() { @@ -212,7 +212,7 @@ public function getDnsRecords() /** * Sets dns_records * - * @param \Fastly\Model\RelationshipTlsDnsRecordDnsRecord|null $dns_records dns_records + * @param \Fastly\Model\RelationshipTlsDnsRecordsRequestDnsRecords|null $dns_records dns_records * * @return self */ diff --git a/lib/Model/RelationshipTlsDnsRecord.php b/lib/Model/RelationshipTlsDnsRecordsRequestDnsRecords.php similarity index 87% rename from lib/Model/RelationshipTlsDnsRecord.php rename to lib/Model/RelationshipTlsDnsRecordsRequestDnsRecords.php index 8f099e61..9ee39abf 100644 --- a/lib/Model/RelationshipTlsDnsRecord.php +++ b/lib/Model/RelationshipTlsDnsRecordsRequestDnsRecords.php @@ -1,6 +1,6 @@ '\Fastly\Model\RelationshipTlsDnsRecordDnsRecord' + 'data' => '\Fastly\Model\RelationshipTlsDnsRecordsRequestDnsRecordsData[]' ]; /** @@ -64,7 +64,7 @@ class RelationshipTlsDnsRecord implements ModelInterface, ArrayAccess, \JsonSeri * @psalm-var array */ protected static $fastlyFormats = [ - 'dns_record' => null + 'data' => null ]; /** @@ -94,7 +94,7 @@ public static function fastlyFormats() * @var string[] */ protected static $attributeMap = [ - 'dns_record' => 'dns_record' + 'data' => 'data' ]; /** @@ -103,7 +103,7 @@ public static function fastlyFormats() * @var string[] */ protected static $setters = [ - 'dns_record' => 'setDnsRecord' + 'data' => 'setData' ]; /** @@ -112,7 +112,7 @@ public static function fastlyFormats() * @var string[] */ protected static $getters = [ - 'dns_record' => 'getDnsRecord' + 'data' => 'getData' ]; /** @@ -172,7 +172,7 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['dns_record'] = $data['dns_record'] ?? null; + $this->container['data'] = $data['data'] ?? null; } /** @@ -200,25 +200,25 @@ public function valid() /** - * Gets dns_record + * Gets data * - * @return \Fastly\Model\RelationshipTlsDnsRecordDnsRecord|null + * @return \Fastly\Model\RelationshipTlsDnsRecordsRequestDnsRecordsData[]|null */ - public function getDnsRecord() + public function getData() { - return $this->container['dns_record']; + return $this->container['data']; } /** - * Sets dns_record + * Sets data * - * @param \Fastly\Model\RelationshipTlsDnsRecordDnsRecord|null $dns_record dns_record + * @param \Fastly\Model\RelationshipTlsDnsRecordsRequestDnsRecordsData[]|null $data data * * @return self */ - public function setDnsRecord($dns_record) + public function setData($data) { - $this->container['dns_record'] = $dns_record; + $this->container['data'] = $data; return $this; } diff --git a/lib/Model/RelationshipMemberTlsDnsRecord.php b/lib/Model/RelationshipTlsDnsRecordsRequestDnsRecordsData.php similarity index 95% rename from lib/Model/RelationshipMemberTlsDnsRecord.php rename to lib/Model/RelationshipTlsDnsRecordsRequestDnsRecordsData.php index 37fe9125..0df7d5f0 100644 --- a/lib/Model/RelationshipMemberTlsDnsRecord.php +++ b/lib/Model/RelationshipTlsDnsRecordsRequestDnsRecordsData.php @@ -1,6 +1,6 @@ + * @template TKey int|null + * @template TValue mixed|null + */ +class RelationshipTlsDnsRecordsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'relationship_tls_dns_records_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'dns_records' => '\Fastly\Model\RelationshipTlsDnsRecordsResponseDnsRecords' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'dns_records' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyTypes() + { + return self::$fastlyTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyFormats() + { + return self::$fastlyFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'dns_records' => 'dns_records' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'dns_records' => 'setDnsRecords' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'dns_records' => 'getDnsRecords' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$fastlyModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['dns_records'] = $data['dns_records'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets dns_records + * + * @return \Fastly\Model\RelationshipTlsDnsRecordsResponseDnsRecords|null + */ + public function getDnsRecords() + { + return $this->container['dns_records']; + } + + /** + * Sets dns_records + * + * @param \Fastly\Model\RelationshipTlsDnsRecordsResponseDnsRecords|null $dns_records dns_records + * + * @return self + */ + public function setDnsRecords($dns_records) + { + $this->container['dns_records'] = $dns_records; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/RelationshipTlsDnsRecordsResponseDnsRecords.php b/lib/Model/RelationshipTlsDnsRecordsResponseDnsRecords.php new file mode 100644 index 00000000..f6f48334 --- /dev/null +++ b/lib/Model/RelationshipTlsDnsRecordsResponseDnsRecords.php @@ -0,0 +1,314 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RelationshipTlsDnsRecordsResponseDnsRecords implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'relationship_tls_dns_records_response_dns_records'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'data' => '\Fastly\Model\RelationshipTlsDnsRecordsResponseDnsRecordsData[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyTypes() + { + return self::$fastlyTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyFormats() + { + return self::$fastlyFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$fastlyModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Fastly\Model\RelationshipTlsDnsRecordsResponseDnsRecordsData[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Fastly\Model\RelationshipTlsDnsRecordsResponseDnsRecordsData[]|null $data data + * + * @return self + */ + public function setData($data) + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/RelationshipTlsDnsRecordsResponseDnsRecordsData.php b/lib/Model/RelationshipTlsDnsRecordsResponseDnsRecordsData.php new file mode 100644 index 00000000..5ccddebc --- /dev/null +++ b/lib/Model/RelationshipTlsDnsRecordsResponseDnsRecordsData.php @@ -0,0 +1,344 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RelationshipTlsDnsRecordsResponseDnsRecordsData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'relationship_tls_dns_records_response_dns_records_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'type' => '\Fastly\Model\TypeTlsDnsRecord', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'type' => null, + 'id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyTypes() + { + return self::$fastlyTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyFormats() + { + return self::$fastlyFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$fastlyModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['type'] = $data['type'] ?? null; + $this->container['id'] = $data['id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return \Fastly\Model\TypeTlsDnsRecord|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \Fastly\Model\TypeTlsDnsRecord|null $type type + * + * @return self + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/Results.php b/lib/Model/Results.php index 525cd66d..23c8ab47 100644 --- a/lib/Model/Results.php +++ b/lib/Model/Results.php @@ -302,6 +302,7 @@ class Results implements ModelInterface, ArrayAccess, \JsonSerializable 'all_status_3xx' => 'int', 'all_status_4xx' => 'int', 'all_status_5xx' => 'int', + 'origin_offload' => 'float', 'service_id' => 'string', 'start_time' => 'int' ]; @@ -562,6 +563,7 @@ class Results implements ModelInterface, ArrayAccess, \JsonSerializable 'all_status_3xx' => null, 'all_status_4xx' => null, 'all_status_5xx' => null, + 'origin_offload' => null, 'service_id' => null, 'start_time' => null ]; @@ -841,6 +843,7 @@ public static function fastlyFormats() 'all_status_3xx' => 'all_status_3xx', 'all_status_4xx' => 'all_status_4xx', 'all_status_5xx' => 'all_status_5xx', + 'origin_offload' => 'origin_offload', 'service_id' => 'service_id', 'start_time' => 'start_time' ]; @@ -1099,6 +1102,7 @@ public static function fastlyFormats() 'all_status_3xx' => 'setAllStatus3xx', 'all_status_4xx' => 'setAllStatus4xx', 'all_status_5xx' => 'setAllStatus5xx', + 'origin_offload' => 'setOriginOffload', 'service_id' => 'setServiceId', 'start_time' => 'setStartTime' ]; @@ -1357,6 +1361,7 @@ public static function fastlyFormats() 'all_status_3xx' => 'getAllStatus3xx', 'all_status_4xx' => 'getAllStatus4xx', 'all_status_5xx' => 'getAllStatus5xx', + 'origin_offload' => 'getOriginOffload', 'service_id' => 'getServiceId', 'start_time' => 'getStartTime' ]; @@ -1666,6 +1671,7 @@ public function __construct(array $data = null) $this->container['all_status_3xx'] = $data['all_status_3xx'] ?? null; $this->container['all_status_4xx'] = $data['all_status_4xx'] ?? null; $this->container['all_status_5xx'] = $data['all_status_5xx'] ?? null; + $this->container['origin_offload'] = $data['origin_offload'] ?? null; $this->container['service_id'] = $data['service_id'] ?? null; $this->container['start_time'] = $data['start_time'] ?? null; } @@ -7650,6 +7656,30 @@ public function setAllStatus5xx($all_status_5xx) return $this; } + /** + * Gets origin_offload + * + * @return float|null + */ + public function getOriginOffload() + { + return $this->container['origin_offload']; + } + + /** + * Sets origin_offload + * + * @param float|null $origin_offload Origin Offload measures the ratio of bytes served to end users that were cached by Fastly, over the bytes served to end users, between 0 and 1. ((`edge_resp_body_bytes` + `edge_resp_header_bytes`) - (`origin_fetch_resp_body_bytes` + `origin_fetch_resp_header_bytes`)) / (`edge_resp_body_bytes` + `edge_resp_header_bytes`). + * + * @return self + */ + public function setOriginOffload($origin_offload) + { + $this->container['origin_offload'] = $origin_offload; + + return $this; + } + /** * Gets service_id * diff --git a/lib/Model/Serviceusagemetric.php b/lib/Model/Serviceusagemetric.php new file mode 100644 index 00000000..04632939 --- /dev/null +++ b/lib/Model/Serviceusagemetric.php @@ -0,0 +1,404 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class Serviceusagemetric implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'serviceusagemetric'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'customer_id' => 'string', + 'service_id' => 'string', + 'service_name' => 'string', + 'usage_units' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'customer_id' => null, + 'service_id' => null, + 'service_name' => null, + 'usage_units' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyTypes() + { + return self::$fastlyTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyFormats() + { + return self::$fastlyFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'customer_id' => 'customer_id', + 'service_id' => 'service_id', + 'service_name' => 'service_name', + 'usage_units' => 'usage_units' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'customer_id' => 'setCustomerId', + 'service_id' => 'setServiceId', + 'service_name' => 'setServiceName', + 'usage_units' => 'setUsageUnits' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'customer_id' => 'getCustomerId', + 'service_id' => 'getServiceId', + 'service_name' => 'getServiceName', + 'usage_units' => 'getUsageUnits' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$fastlyModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['customer_id'] = $data['customer_id'] ?? null; + $this->container['service_id'] = $data['service_id'] ?? null; + $this->container['service_name'] = $data['service_name'] ?? null; + $this->container['usage_units'] = $data['usage_units'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets customer_id + * + * @return string|null + */ + public function getCustomerId() + { + return $this->container['customer_id']; + } + + /** + * Sets customer_id + * + * @param string|null $customer_id customer_id + * + * @return self + */ + public function setCustomerId($customer_id) + { + $this->container['customer_id'] = $customer_id; + + return $this; + } + + /** + * Gets service_id + * + * @return string|null + */ + public function getServiceId() + { + return $this->container['service_id']; + } + + /** + * Sets service_id + * + * @param string|null $service_id Service ID associated with the usage. + * + * @return self + */ + public function setServiceId($service_id) + { + $this->container['service_id'] = $service_id; + + return $this; + } + + /** + * Gets service_name + * + * @return string|null + */ + public function getServiceName() + { + return $this->container['service_name']; + } + + /** + * Sets service_name + * + * @param string|null $service_name Name of the service associated with the usage. + * + * @return self + */ + public function setServiceName($service_name) + { + $this->container['service_name'] = $service_name; + + return $this; + } + + /** + * Gets usage_units + * + * @return float|null + */ + public function getUsageUnits() + { + return $this->container['usage_units']; + } + + /** + * Sets usage_units + * + * @param float|null $usage_units The quantity of the usage for the billing period. Amount will be in the units provided in the parent object (e.g., a quantity of `1.3` with a unit of `gb` would have a usage amount of 1.3 gigabytes). + * + * @return self + */ + public function setUsageUnits($usage_units) + { + $this->container['usage_units'] = $usage_units; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/Serviceusagemetrics.php b/lib/Model/Serviceusagemetrics.php new file mode 100644 index 00000000..e8366956 --- /dev/null +++ b/lib/Model/Serviceusagemetrics.php @@ -0,0 +1,314 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class Serviceusagemetrics implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'serviceusagemetrics'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'data' => '\Fastly\Model\ServiceusagemetricsData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyTypes() + { + return self::$fastlyTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyFormats() + { + return self::$fastlyFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$fastlyModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Fastly\Model\ServiceusagemetricsData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Fastly\Model\ServiceusagemetricsData|null $data data + * + * @return self + */ + public function setData($data) + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ServiceusagemetricsData.php b/lib/Model/ServiceusagemetricsData.php new file mode 100644 index 00000000..631ee232 --- /dev/null +++ b/lib/Model/ServiceusagemetricsData.php @@ -0,0 +1,494 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ServiceusagemetricsData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'serviceusagemetrics_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'customer_id' => 'string', + 'start_time' => '\DateTime', + 'end_time' => '\DateTime', + 'usage_type' => 'string', + 'unit' => 'string', + 'details' => '\Fastly\Model\Serviceusagemetric[]', + 'meta' => '\Fastly\Model\Metadata' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'customer_id' => null, + 'start_time' => 'date-time', + 'end_time' => 'date-time', + 'usage_type' => null, + 'unit' => null, + 'details' => null, + 'meta' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyTypes() + { + return self::$fastlyTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyFormats() + { + return self::$fastlyFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'customer_id' => 'customer_id', + 'start_time' => 'start_time', + 'end_time' => 'end_time', + 'usage_type' => 'usage_type', + 'unit' => 'unit', + 'details' => 'details', + 'meta' => 'meta' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'customer_id' => 'setCustomerId', + 'start_time' => 'setStartTime', + 'end_time' => 'setEndTime', + 'usage_type' => 'setUsageType', + 'unit' => 'setUnit', + 'details' => 'setDetails', + 'meta' => 'setMeta' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'customer_id' => 'getCustomerId', + 'start_time' => 'getStartTime', + 'end_time' => 'getEndTime', + 'usage_type' => 'getUsageType', + 'unit' => 'getUnit', + 'details' => 'getDetails', + 'meta' => 'getMeta' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$fastlyModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['customer_id'] = $data['customer_id'] ?? null; + $this->container['start_time'] = $data['start_time'] ?? null; + $this->container['end_time'] = $data['end_time'] ?? null; + $this->container['usage_type'] = $data['usage_type'] ?? null; + $this->container['unit'] = $data['unit'] ?? null; + $this->container['details'] = $data['details'] ?? null; + $this->container['meta'] = $data['meta'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets customer_id + * + * @return string|null + */ + public function getCustomerId() + { + return $this->container['customer_id']; + } + + /** + * Sets customer_id + * + * @param string|null $customer_id customer_id + * + * @return self + */ + public function setCustomerId($customer_id) + { + $this->container['customer_id'] = $customer_id; + + return $this; + } + + /** + * Gets start_time + * + * @return \DateTime|null + */ + public function getStartTime() + { + return $this->container['start_time']; + } + + /** + * Sets start_time + * + * @param \DateTime|null $start_time Date and time (in ISO 8601 format) for initiation point of a billing cycle, signifying the start of charges for a service or subscription. + * + * @return self + */ + public function setStartTime($start_time) + { + $this->container['start_time'] = $start_time; + + return $this; + } + + /** + * Gets end_time + * + * @return \DateTime|null + */ + public function getEndTime() + { + return $this->container['end_time']; + } + + /** + * Sets end_time + * + * @param \DateTime|null $end_time Date and time (in ISO 8601 format) for termination point of a billing cycle, signifying the end of charges for a service or subscription. + * + * @return self + */ + public function setEndTime($end_time) + { + $this->container['end_time'] = $end_time; + + return $this; + } + + /** + * Gets usage_type + * + * @return string|null + */ + public function getUsageType() + { + return $this->container['usage_type']; + } + + /** + * Sets usage_type + * + * @param string|null $usage_type The usage type identifier for the usage. This is a single, billable metric for the product. + * + * @return self + */ + public function setUsageType($usage_type) + { + $this->container['usage_type'] = $usage_type; + + return $this; + } + + /** + * Gets unit + * + * @return string|null + */ + public function getUnit() + { + return $this->container['unit']; + } + + /** + * Sets unit + * + * @param string|null $unit The unit for the usage as shown on an invoice. If there is no explicit unit, this field will be \"unit\" (e.g., a request with `product_id` of 'cdn_usage' and `usage_type` of 'North America Requests' has no unit, and will return \"unit\"). + * + * @return self + */ + public function setUnit($unit) + { + $this->container['unit'] = $unit; + + return $this; + } + + /** + * Gets details + * + * @return \Fastly\Model\Serviceusagemetric[]|null + */ + public function getDetails() + { + return $this->container['details']; + } + + /** + * Sets details + * + * @param \Fastly\Model\Serviceusagemetric[]|null $details details + * + * @return self + */ + public function setDetails($details) + { + $this->container['details'] = $details; + + return $this; + } + + /** + * Gets meta + * + * @return \Fastly\Model\Metadata|null + */ + public function getMeta() + { + return $this->container['meta']; + } + + /** + * Sets meta + * + * @param \Fastly\Model\Metadata|null $meta meta + * + * @return self + */ + public function setMeta($meta) + { + $this->container['meta'] = $meta; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/Serviceusagetype.php b/lib/Model/Serviceusagetype.php new file mode 100644 index 00000000..591618e3 --- /dev/null +++ b/lib/Model/Serviceusagetype.php @@ -0,0 +1,344 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class Serviceusagetype implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'serviceusagetype'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'product_id' => 'string', + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'product_id' => null, + 'name' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyTypes() + { + return self::$fastlyTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyFormats() + { + return self::$fastlyFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'product_id' => 'product_id', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'product_id' => 'setProductId', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'product_id' => 'getProductId', + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$fastlyModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['product_id'] = $data['product_id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets product_id + * + * @return string|null + */ + public function getProductId() + { + return $this->container['product_id']; + } + + /** + * Sets product_id + * + * @param string|null $product_id The product identifier associated with the usage type. This corresponds to a Fastly product offering. + * + * @return self + */ + public function setProductId($product_id) + { + $this->container['product_id'] = $product_id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Full name of the product usage type as it might appear on a customer's invoice. + * + * @return self + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/Serviceusagetypes.php b/lib/Model/Serviceusagetypes.php new file mode 100644 index 00000000..ae1546aa --- /dev/null +++ b/lib/Model/Serviceusagetypes.php @@ -0,0 +1,314 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class Serviceusagetypes implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'serviceusagetypes'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'data' => '\Fastly\Model\Serviceusagetype[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyTypes() + { + return self::$fastlyTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyFormats() + { + return self::$fastlyFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$fastlyModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Fastly\Model\Serviceusagetype[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Fastly\Model\Serviceusagetype[]|null $data data + * + * @return self + */ + public function setData($data) + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/TlsCertificateBlobResponse.php b/lib/Model/TlsCertificateBlobResponse.php new file mode 100644 index 00000000..d9edf4f5 --- /dev/null +++ b/lib/Model/TlsCertificateBlobResponse.php @@ -0,0 +1,314 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class TlsCertificateBlobResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'tls_certificate_blob_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'cert_blob' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'cert_blob' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyTypes() + { + return self::$fastlyTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyFormats() + { + return self::$fastlyFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'cert_blob' => 'cert_blob' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cert_blob' => 'setCertBlob' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cert_blob' => 'getCertBlob' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$fastlyModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['cert_blob'] = $data['cert_blob'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets cert_blob + * + * @return string|null + */ + public function getCertBlob() + { + return $this->container['cert_blob']; + } + + /** + * Sets cert_blob + * + * @param string|null $cert_blob A certificate blob + * + * @return self + */ + public function setCertBlob($cert_blob) + { + $this->container['cert_blob'] = $cert_blob; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/TlsDnsRecord.php b/lib/Model/TlsDnsRecord.php index ae5953c5..78376c06 100644 --- a/lib/Model/TlsDnsRecord.php +++ b/lib/Model/TlsDnsRecord.php @@ -53,7 +53,6 @@ class TlsDnsRecord implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $fastlyTypes = [ - 'id' => 'string', 'region' => 'string', 'record_type' => 'string' ]; @@ -66,7 +65,6 @@ class TlsDnsRecord implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $fastlyFormats = [ - 'id' => null, 'region' => null, 'record_type' => null ]; @@ -98,7 +96,6 @@ public static function fastlyFormats() * @var string[] */ protected static $attributeMap = [ - 'id' => 'id', 'region' => 'region', 'record_type' => 'record_type' ]; @@ -109,7 +106,6 @@ public static function fastlyFormats() * @var string[] */ protected static $setters = [ - 'id' => 'setId', 'region' => 'setRegion', 'record_type' => 'setRecordType' ]; @@ -120,7 +116,6 @@ public static function fastlyFormats() * @var string[] */ protected static $getters = [ - 'id' => 'getId', 'region' => 'getRegion', 'record_type' => 'getRecordType' ]; @@ -166,6 +161,40 @@ public function getModelName() return self::$fastlyModelName; } + const REGION_CUSTOM = 'custom'; + const REGION__GLOBAL = 'global'; + const REGION_NA_EU = 'na/eu'; + const RECORD_TYPE_CNAME = 'CNAME'; + const RECORD_TYPE_A = 'A'; + const RECORD_TYPE_AAAA = 'AAAA'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getRegionAllowableValues() + { + return [ + self::REGION_CUSTOM, + self::REGION__GLOBAL, + self::REGION_NA_EU, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getRecordTypeAllowableValues() + { + return [ + self::RECORD_TYPE_CNAME, + self::RECORD_TYPE_A, + self::RECORD_TYPE_AAAA, + ]; + } /** * Associative array for storing property values @@ -182,7 +211,6 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; $this->container['region'] = $data['region'] ?? null; $this->container['record_type'] = $data['record_type'] ?? null; } @@ -196,6 +224,24 @@ public function listInvalidProperties() { $invalidProperties = []; + $allowedValues = $this->getRegionAllowableValues(); + if (!is_null($this->container['region']) && !in_array($this->container['region'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'region', must be one of '%s'", + $this->container['region'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getRecordTypeAllowableValues(); + if (!is_null($this->container['record_type']) && !in_array($this->container['record_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'record_type', must be one of '%s'", + $this->container['record_type'], + implode("', '", $allowedValues) + ); + } + return $invalidProperties; } @@ -211,30 +257,6 @@ public function valid() } - /** - * Gets id - * - * @return string|null - */ - public function getId() - { - return $this->container['id']; - } - - /** - * Sets id - * - * @param string|null $id The IP address or hostname of the DNS record. - * - * @return self - */ - public function setId($id) - { - $this->container['id'] = $id; - - return $this; - } - /** * Gets region * @@ -248,12 +270,22 @@ public function getRegion() /** * Sets region * - * @param string|null $region Specifies the regions that will be used to route traffic. Select DNS Records with a `global` region to route traffic to the most performant point of presence (POP) worldwide (global pricing will apply). Select DNS records with a `us-eu` region to exclusively land traffic on North American and European POPs. + * @param string|null $region Specifies the regions that will be used to route traffic. Select DNS records with a `global` region to route traffic to the most performant point of presence (POP) worldwide (global pricing will apply). Select DNS records with a `na/eu` region to exclusively land traffic on North American and European POPs. * * @return self */ public function setRegion($region) { + $allowedValues = $this->getRegionAllowableValues(); + if (!is_null($region) && !in_array($region, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'region', must be one of '%s'", + $region, + implode("', '", $allowedValues) + ) + ); + } $this->container['region'] = $region; return $this; @@ -278,6 +310,16 @@ public function getRecordType() */ public function setRecordType($record_type) { + $allowedValues = $this->getRecordTypeAllowableValues(); + if (!is_null($record_type) && !in_array($record_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'record_type', must be one of '%s'", + $record_type, + implode("', '", $allowedValues) + ) + ); + } $this->container['record_type'] = $record_type; return $this; diff --git a/lib/Model/UpdateDashboardRequest.php b/lib/Model/UpdateDashboardRequest.php new file mode 100644 index 00000000..ae9ba698 --- /dev/null +++ b/lib/Model/UpdateDashboardRequest.php @@ -0,0 +1,374 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UpdateDashboardRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'update-dashboard-request'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'name' => 'string', + 'description' => 'string', + 'items' => '\Fastly\Model\DashboardItem[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'name' => null, + 'description' => null, + 'items' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyTypes() + { + return self::$fastlyTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function fastlyFormats() + { + return self::$fastlyFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'description' => 'description', + 'items' => 'items' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'description' => 'setDescription', + 'items' => 'setItems' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'description' => 'getDescription', + 'items' => 'getItems' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$fastlyModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + $this->container['description'] = $data['description'] ?? null; + $this->container['items'] = $data['items'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name A human-readable name + * + * @return self + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description A short description of the dashboard + * + * @return self + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets items + * + * @return \Fastly\Model\DashboardItem[]|null + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param \Fastly\Model\DashboardItem[]|null $items A list of [dashboard items](#dashboard-item). + * + * @return self + */ + public function setItems($items) + { + $this->container['items'] = $items; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/Values.php b/lib/Model/Values.php index 1cb2d732..2788a44d 100644 --- a/lib/Model/Values.php +++ b/lib/Model/Values.php @@ -1491,7 +1491,7 @@ public function getOriginOffload() /** * Sets origin_offload * - * @param float|null $origin_offload Ratio of response bytes delivered from the edge compared to what is delivered from origin, between 0 and 1. (`edge_resp_body_bytes` + `edge_resp_header_bytes`) / (`origin_fetch_resp_body_bytes` + `origin_fetch_resp_header_bytes` + `edge_resp_body_bytes` + `edge_resp_header_bytes`). + * @param float|null $origin_offload Origin Offload measures the ratio of bytes served to end users that were cached by Fastly, over the bytes served to end users, between 0 and 1. ((`edge_resp_body_bytes` + `edge_resp_header_bytes`) - (`origin_fetch_resp_body_bytes` + `origin_fetch_resp_header_bytes`)) / (`edge_resp_body_bytes` + `edge_resp_header_bytes`). Previously, Origin Offload used a different formula. [Learn more](https://www.fastly.com/documentation/reference/changes/2024/06/add-origin_offload-metric). * * @return self */ diff --git a/sig.json b/sig.json index 66147743..713aa7d4 100644 --- a/sig.json +++ b/sig.json @@ -1 +1 @@ -{"G": "5a2ccc65", "D": "f9e684d4"} +{"G": "01161630", "D": "e05af2db"}