diff --git a/CHANGELOG.md b/CHANGELOG.md index 0dfebfec..3e58551a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,54 @@ # Changelog +## [v3.0.0](https://github.com/fastly/fastly-php/releases/tag/release/v3.0.0) (2023-07-06) + +Substantial changes were made to the underlying OpenAPI specification that produces this API client. These changes have resulted in multiple new endpoints being supported as well as multiple breaking type changes and so we're publishing these changes as a new major release. + +**Enhancements:** + +- feat(apex_redirect): support all endpoints. +- feat(contact): support 'create' endpoint. +- feat(director): support 'update' endpoint. +- feat(domain_inspector): support all endpoints. +- feat(iam_roles): support 'add permissions' endpoint. +- feat(iam_roles): support 'create role' endpoint. +- feat(iam_roles): support 'delete permissions' endpoint. +- feat(iam_roles): support 'update role' endpoint. +- feat(iam_services): support 'add services' endpoint. +- feat(iam_services): support 'create service group' endpoint. +- feat(iam_services): support 'remove services' endpoint. +- feat(iam_services): support 'update service group' endpoint. +- feat(iam_users): support 'add members' endpoint. +- feat(iam_users): support 'add roles' endpoint. +- feat(iam_users): support 'add service groups' endpoint. +- feat(iam_users): support 'create user group' endpoint. +- feat(iam_users): support 'remove members' endpoint. +- feat(iam_users): support 'remove roles' endpoint. +- feat(iam_users): support 'remove service groups' endpoint. +- feat(iam_users): support 'update user group' endpoint. +- feat(legacy_waf): support all endpoints. +- feat(logging_kafka): support 'update' endpoint. +- feat(logging_kinesis): support 'update' endpoint. +- feat(origin_inspector): support all endpoints. +- feat(request_settings): support 'create' endpoint. +- feat(response_object): support 'create' endpoint. +- feat(response_object): support 'update' endpoint. +- feat(secret_store): support all endpoints. +- feat(service_authorizations): support 'delete' endpoint. +- feat(service_authorizations): support 'update' endpoint. +- feat(snippet): support 'update versioned snippet' endpoint. +- feat(sudo): support 'request sudo access' endpoint. +- feat(tokens): support 'revoke multiple tokens' endpoint. +- feat(tokens): support 'create token' endpoint. +- feat(waf_active_rules): support 'delete' endpoint. + +**Bug fixes:** + +- fix(content): update request/response types. +- fix(events): update metadata type. +- fix(realtime_entry): update recorded/aggregated type. +- fix(realtime_measurements): update miss_histogram type. + ## [v2.3.1](https://github.com/fastly/fastly-php/releases/tag/release/v2.3.1) (2023-07-05) **Bug fixes:** diff --git a/README.md b/README.md index 33434941..23088959 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,7 @@ Class | Method | Description [*AclEntryApi*](docs/Api/AclEntryApi.md) | [**getAclEntry**](docs/Api/AclEntryApi.md#getaclentry) | Describe an ACL entry [*AclEntryApi*](docs/Api/AclEntryApi.md) | [**listAclEntries**](docs/Api/AclEntryApi.md#listaclentries) | List ACL entries [*AclEntryApi*](docs/Api/AclEntryApi.md) | [**updateAclEntry**](docs/Api/AclEntryApi.md#updateaclentry) | Update an ACL entry +[*ApexRedirectApi*](docs/Api/ApexRedirectApi.md) | [**createApexRedirect**](docs/Api/ApexRedirectApi.md#createapexredirect) | Create an apex redirect [*ApexRedirectApi*](docs/Api/ApexRedirectApi.md) | [**deleteApexRedirect**](docs/Api/ApexRedirectApi.md#deleteapexredirect) | Delete an apex redirect [*ApexRedirectApi*](docs/Api/ApexRedirectApi.md) | [**getApexRedirect**](docs/Api/ApexRedirectApi.md#getapexredirect) | Get an apex redirect [*ApexRedirectApi*](docs/Api/ApexRedirectApi.md) | [**listApexRedirects**](docs/Api/ApexRedirectApi.md#listapexredirects) | List apex redirects @@ -133,6 +134,7 @@ Class | Method | Description [*ConfigStoreItemApi*](docs/Api/ConfigStoreItemApi.md) | [**listConfigStoreItems**](docs/Api/ConfigStoreItemApi.md#listconfigstoreitems) | List items in a config store [*ConfigStoreItemApi*](docs/Api/ConfigStoreItemApi.md) | [**updateConfigStoreItem**](docs/Api/ConfigStoreItemApi.md#updateconfigstoreitem) | Update an entry in a config store [*ConfigStoreItemApi*](docs/Api/ConfigStoreItemApi.md) | [**upsertConfigStoreItem**](docs/Api/ConfigStoreItemApi.md#upsertconfigstoreitem) | Insert or update an entry in a config store +[*ContactApi*](docs/Api/ContactApi.md) | [**createContacts**](docs/Api/ContactApi.md#createcontacts) | Add a new customer contact [*ContactApi*](docs/Api/ContactApi.md) | [**deleteContact**](docs/Api/ContactApi.md#deletecontact) | Delete a contact [*ContactApi*](docs/Api/ContactApi.md) | [**listContacts**](docs/Api/ContactApi.md#listcontacts) | List contacts [*ContentApi*](docs/Api/ContentApi.md) | [**contentCheck**](docs/Api/ContentApi.md#contentcheck) | Check status of content in each POP's cache @@ -159,6 +161,7 @@ Class | Method | Description [*DirectorApi*](docs/Api/DirectorApi.md) | [**deleteDirector**](docs/Api/DirectorApi.md#deletedirector) | Delete a director [*DirectorApi*](docs/Api/DirectorApi.md) | [**getDirector**](docs/Api/DirectorApi.md#getdirector) | Get a director [*DirectorApi*](docs/Api/DirectorApi.md) | [**listDirectors**](docs/Api/DirectorApi.md#listdirectors) | List directors +[*DirectorApi*](docs/Api/DirectorApi.md) | [**updateDirector**](docs/Api/DirectorApi.md#updatedirector) | Update a director [*DirectorBackendApi*](docs/Api/DirectorBackendApi.md) | [**createDirectorBackend**](docs/Api/DirectorBackendApi.md#createdirectorbackend) | Create a director-backend relationship [*DirectorBackendApi*](docs/Api/DirectorBackendApi.md) | [**deleteDirectorBackend**](docs/Api/DirectorBackendApi.md#deletedirectorbackend) | Delete a director-backend relationship [*DirectorBackendApi*](docs/Api/DirectorBackendApi.md) | [**getDirectorBackend**](docs/Api/DirectorBackendApi.md#getdirectorbackend) | Get a director-backend relationship @@ -169,6 +172,10 @@ Class | Method | Description [*DomainApi*](docs/Api/DomainApi.md) | [**getDomain**](docs/Api/DomainApi.md#getdomain) | Describe a domain [*DomainApi*](docs/Api/DomainApi.md) | [**listDomains**](docs/Api/DomainApi.md#listdomains) | List domains [*DomainApi*](docs/Api/DomainApi.md) | [**updateDomain**](docs/Api/DomainApi.md#updatedomain) | Update a domain +[*DomainInspectorHistoricalApi*](docs/Api/DomainInspectorHistoricalApi.md) | [**getDomainInspectorHistorical**](docs/Api/DomainInspectorHistoricalApi.md#getdomaininspectorhistorical) | Get historical domain data for a service +[*DomainInspectorRealtimeApi*](docs/Api/DomainInspectorRealtimeApi.md) | [**getDomainInspectorLast120Seconds**](docs/Api/DomainInspectorRealtimeApi.md#getdomaininspectorlast120seconds) | Get real-time domain data for the last 120 seconds +[*DomainInspectorRealtimeApi*](docs/Api/DomainInspectorRealtimeApi.md) | [**getDomainInspectorLastMaxEntries**](docs/Api/DomainInspectorRealtimeApi.md#getdomaininspectorlastmaxentries) | Get a limited number of real-time domain data entries +[*DomainInspectorRealtimeApi*](docs/Api/DomainInspectorRealtimeApi.md) | [**getDomainInspectorLastSecond**](docs/Api/DomainInspectorRealtimeApi.md#getdomaininspectorlastsecond) | Get real-time domain data from a specified time [*DomainOwnershipsApi*](docs/Api/DomainOwnershipsApi.md) | [**listDomainOwnerships**](docs/Api/DomainOwnershipsApi.md#listdomainownerships) | List domain-ownerships [*EnabledProductsApi*](docs/Api/EnabledProductsApi.md) | [**disableProduct**](docs/Api/EnabledProductsApi.md#disableproduct) | Disable a product [*EnabledProductsApi*](docs/Api/EnabledProductsApi.md) | [**enableProduct**](docs/Api/EnabledProductsApi.md#enableproduct) | Enable a product @@ -203,20 +210,36 @@ Class | Method | Description [*Http3Api*](docs/Api/Http3Api.md) | [**deleteHttp3**](docs/Api/Http3Api.md#deletehttp3) | Disable support for HTTP/3 [*Http3Api*](docs/Api/Http3Api.md) | [**getHttp3**](docs/Api/Http3Api.md#gethttp3) | Get HTTP/3 status [*IamPermissionsApi*](docs/Api/IamPermissionsApi.md) | [**listPermissions**](docs/Api/IamPermissionsApi.md#listpermissions) | List permissions +[*IamRolesApi*](docs/Api/IamRolesApi.md) | [**addRolePermissions**](docs/Api/IamRolesApi.md#addrolepermissions) | Add permissions to a role +[*IamRolesApi*](docs/Api/IamRolesApi.md) | [**createARole**](docs/Api/IamRolesApi.md#createarole) | Create a role [*IamRolesApi*](docs/Api/IamRolesApi.md) | [**deleteARole**](docs/Api/IamRolesApi.md#deletearole) | Delete a role [*IamRolesApi*](docs/Api/IamRolesApi.md) | [**getARole**](docs/Api/IamRolesApi.md#getarole) | Get a role [*IamRolesApi*](docs/Api/IamRolesApi.md) | [**listRolePermissions**](docs/Api/IamRolesApi.md#listrolepermissions) | List permissions in a role [*IamRolesApi*](docs/Api/IamRolesApi.md) | [**listRoles**](docs/Api/IamRolesApi.md#listroles) | List roles +[*IamRolesApi*](docs/Api/IamRolesApi.md) | [**removeRolePermissions**](docs/Api/IamRolesApi.md#removerolepermissions) | Remove permissions from a role +[*IamRolesApi*](docs/Api/IamRolesApi.md) | [**updateARole**](docs/Api/IamRolesApi.md#updatearole) | Update a role +[*IamServiceGroupsApi*](docs/Api/IamServiceGroupsApi.md) | [**addServiceGroupServices**](docs/Api/IamServiceGroupsApi.md#addservicegroupservices) | Add services in a service group +[*IamServiceGroupsApi*](docs/Api/IamServiceGroupsApi.md) | [**createAServiceGroup**](docs/Api/IamServiceGroupsApi.md#createaservicegroup) | Create a service group [*IamServiceGroupsApi*](docs/Api/IamServiceGroupsApi.md) | [**deleteAServiceGroup**](docs/Api/IamServiceGroupsApi.md#deleteaservicegroup) | Delete a service group [*IamServiceGroupsApi*](docs/Api/IamServiceGroupsApi.md) | [**getAServiceGroup**](docs/Api/IamServiceGroupsApi.md#getaservicegroup) | Get a service group [*IamServiceGroupsApi*](docs/Api/IamServiceGroupsApi.md) | [**listServiceGroupServices**](docs/Api/IamServiceGroupsApi.md#listservicegroupservices) | List services to a service group [*IamServiceGroupsApi*](docs/Api/IamServiceGroupsApi.md) | [**listServiceGroups**](docs/Api/IamServiceGroupsApi.md#listservicegroups) | List service groups +[*IamServiceGroupsApi*](docs/Api/IamServiceGroupsApi.md) | [**removeServiceGroupServices**](docs/Api/IamServiceGroupsApi.md#removeservicegroupservices) | Remove services from a service group +[*IamServiceGroupsApi*](docs/Api/IamServiceGroupsApi.md) | [**updateAServiceGroup**](docs/Api/IamServiceGroupsApi.md#updateaservicegroup) | Update a service group +[*IamUserGroupsApi*](docs/Api/IamUserGroupsApi.md) | [**addUserGroupMembers**](docs/Api/IamUserGroupsApi.md#addusergroupmembers) | Add members to a user group +[*IamUserGroupsApi*](docs/Api/IamUserGroupsApi.md) | [**addUserGroupRoles**](docs/Api/IamUserGroupsApi.md#addusergrouproles) | Add roles to a user group +[*IamUserGroupsApi*](docs/Api/IamUserGroupsApi.md) | [**addUserGroupServiceGroups**](docs/Api/IamUserGroupsApi.md#addusergroupservicegroups) | Add service groups to a user group +[*IamUserGroupsApi*](docs/Api/IamUserGroupsApi.md) | [**createAUserGroup**](docs/Api/IamUserGroupsApi.md#createausergroup) | Create a user group [*IamUserGroupsApi*](docs/Api/IamUserGroupsApi.md) | [**deleteAUserGroup**](docs/Api/IamUserGroupsApi.md#deleteausergroup) | Delete a user group [*IamUserGroupsApi*](docs/Api/IamUserGroupsApi.md) | [**getAUserGroup**](docs/Api/IamUserGroupsApi.md#getausergroup) | Get a user group [*IamUserGroupsApi*](docs/Api/IamUserGroupsApi.md) | [**listUserGroupMembers**](docs/Api/IamUserGroupsApi.md#listusergroupmembers) | List members of a user group [*IamUserGroupsApi*](docs/Api/IamUserGroupsApi.md) | [**listUserGroupRoles**](docs/Api/IamUserGroupsApi.md#listusergrouproles) | List roles in a user group [*IamUserGroupsApi*](docs/Api/IamUserGroupsApi.md) | [**listUserGroupServiceGroups**](docs/Api/IamUserGroupsApi.md#listusergroupservicegroups) | List service groups in a user group [*IamUserGroupsApi*](docs/Api/IamUserGroupsApi.md) | [**listUserGroups**](docs/Api/IamUserGroupsApi.md#listusergroups) | List user groups +[*IamUserGroupsApi*](docs/Api/IamUserGroupsApi.md) | [**removeUserGroupMembers**](docs/Api/IamUserGroupsApi.md#removeusergroupmembers) | Remove members of a user group +[*IamUserGroupsApi*](docs/Api/IamUserGroupsApi.md) | [**removeUserGroupRoles**](docs/Api/IamUserGroupsApi.md#removeusergrouproles) | Remove roles from a user group +[*IamUserGroupsApi*](docs/Api/IamUserGroupsApi.md) | [**removeUserGroupServiceGroups**](docs/Api/IamUserGroupsApi.md#removeusergroupservicegroups) | Remove service groups from a user group +[*IamUserGroupsApi*](docs/Api/IamUserGroupsApi.md) | [**updateAUserGroup**](docs/Api/IamUserGroupsApi.md#updateausergroup) | Update a user group [*InvitationsApi*](docs/Api/InvitationsApi.md) | [**createInvitation**](docs/Api/InvitationsApi.md#createinvitation) | Create an invitation [*InvitationsApi*](docs/Api/InvitationsApi.md) | [**deleteInvitation**](docs/Api/InvitationsApi.md#deleteinvitation) | Delete an invitation [*InvitationsApi*](docs/Api/InvitationsApi.md) | [**listInvitations**](docs/Api/InvitationsApi.md#listinvitations) | List invitations @@ -228,6 +251,34 @@ Class | Method | Description [*KvStoreItemApi*](docs/Api/KvStoreItemApi.md) | [**getKeys**](docs/Api/KvStoreItemApi.md#getkeys) | List kv store keys. [*KvStoreItemApi*](docs/Api/KvStoreItemApi.md) | [**getValueForKey**](docs/Api/KvStoreItemApi.md#getvalueforkey) | Get the value of an kv store item [*KvStoreItemApi*](docs/Api/KvStoreItemApi.md) | [**setValueForKey**](docs/Api/KvStoreItemApi.md#setvalueforkey) | Insert an item into an kv store +[*LegacyWafConfigurationSetsApi*](docs/Api/LegacyWafConfigurationSetsApi.md) | [**listWafConfigSets**](docs/Api/LegacyWafConfigurationSetsApi.md#listwafconfigsets) | List configuration sets +[*LegacyWafConfigurationSetsApi*](docs/Api/LegacyWafConfigurationSetsApi.md) | [**listWafsConfigSet**](docs/Api/LegacyWafConfigurationSetsApi.md#listwafsconfigset) | List WAFs currently using a configuration set +[*LegacyWafConfigurationSetsApi*](docs/Api/LegacyWafConfigurationSetsApi.md) | [**useWafConfigSet**](docs/Api/LegacyWafConfigurationSetsApi.md#usewafconfigset) | Apply a configuration set to a WAF +[*LegacyWafFirewallApi*](docs/Api/LegacyWafFirewallApi.md) | [**createLegacyWafFirewallService**](docs/Api/LegacyWafFirewallApi.md#createlegacywaffirewallservice) | Create a firewall +[*LegacyWafFirewallApi*](docs/Api/LegacyWafFirewallApi.md) | [**disableLegacyWafFirewall**](docs/Api/LegacyWafFirewallApi.md#disablelegacywaffirewall) | Disable a firewall +[*LegacyWafFirewallApi*](docs/Api/LegacyWafFirewallApi.md) | [**enableLegacyWafFirewall**](docs/Api/LegacyWafFirewallApi.md#enablelegacywaffirewall) | Enable a firewall +[*LegacyWafFirewallApi*](docs/Api/LegacyWafFirewallApi.md) | [**getLegacyWafFirewall**](docs/Api/LegacyWafFirewallApi.md#getlegacywaffirewall) | Get a firewall object +[*LegacyWafFirewallApi*](docs/Api/LegacyWafFirewallApi.md) | [**getLegacyWafFirewallService**](docs/Api/LegacyWafFirewallApi.md#getlegacywaffirewallservice) | Get a firewall +[*LegacyWafFirewallApi*](docs/Api/LegacyWafFirewallApi.md) | [**listLegacyWafFirewalls**](docs/Api/LegacyWafFirewallApi.md#listlegacywaffirewalls) | List active firewalls +[*LegacyWafFirewallApi*](docs/Api/LegacyWafFirewallApi.md) | [**listLegacyWafFirewallsService**](docs/Api/LegacyWafFirewallApi.md#listlegacywaffirewallsservice) | List firewalls +[*LegacyWafFirewallApi*](docs/Api/LegacyWafFirewallApi.md) | [**updateLegacyWafFirewallService**](docs/Api/LegacyWafFirewallApi.md#updatelegacywaffirewallservice) | Update a firewall +[*LegacyWafOwaspApi*](docs/Api/LegacyWafOwaspApi.md) | [**createOwaspSettings**](docs/Api/LegacyWafOwaspApi.md#createowaspsettings) | Create an OWASP settings object +[*LegacyWafOwaspApi*](docs/Api/LegacyWafOwaspApi.md) | [**getOwaspSettings**](docs/Api/LegacyWafOwaspApi.md#getowaspsettings) | Get the OWASP settings object +[*LegacyWafOwaspApi*](docs/Api/LegacyWafOwaspApi.md) | [**updateOwaspSettings**](docs/Api/LegacyWafOwaspApi.md#updateowaspsettings) | Update the OWASP settings object +[*LegacyWafRuleApi*](docs/Api/LegacyWafRuleApi.md) | [**getLegacyWafFirewallRuleVcl**](docs/Api/LegacyWafRuleApi.md#getlegacywaffirewallrulevcl) | Get VCL for a rule associated with a firewall +[*LegacyWafRuleApi*](docs/Api/LegacyWafRuleApi.md) | [**getLegacyWafRule**](docs/Api/LegacyWafRuleApi.md#getlegacywafrule) | Get a rule +[*LegacyWafRuleApi*](docs/Api/LegacyWafRuleApi.md) | [**getLegacyWafRuleVcl**](docs/Api/LegacyWafRuleApi.md#getlegacywafrulevcl) | Get VCL for a rule +[*LegacyWafRuleApi*](docs/Api/LegacyWafRuleApi.md) | [**listLegacyWafRules**](docs/Api/LegacyWafRuleApi.md#listlegacywafrules) | List rules in the latest configuration set +[*LegacyWafRuleStatusApi*](docs/Api/LegacyWafRuleStatusApi.md) | [**getWafFirewallRuleStatus**](docs/Api/LegacyWafRuleStatusApi.md#getwaffirewallrulestatus) | Get the status of a rule on a firewall +[*LegacyWafRuleStatusApi*](docs/Api/LegacyWafRuleStatusApi.md) | [**listWafFirewallRuleStatuses**](docs/Api/LegacyWafRuleStatusApi.md#listwaffirewallrulestatuses) | List rule statuses +[*LegacyWafRuleStatusApi*](docs/Api/LegacyWafRuleStatusApi.md) | [**updateWafFirewallRuleStatus**](docs/Api/LegacyWafRuleStatusApi.md#updatewaffirewallrulestatus) | Update the status of a rule +[*LegacyWafRuleStatusApi*](docs/Api/LegacyWafRuleStatusApi.md) | [**updateWafFirewallRuleStatusesTag**](docs/Api/LegacyWafRuleStatusApi.md#updatewaffirewallrulestatusestag) | Create or update status of a tagged group of rules +[*LegacyWafRulesetApi*](docs/Api/LegacyWafRulesetApi.md) | [**getWafRuleset**](docs/Api/LegacyWafRulesetApi.md#getwafruleset) | Get a WAF ruleset +[*LegacyWafRulesetApi*](docs/Api/LegacyWafRulesetApi.md) | [**getWafRulesetVcl**](docs/Api/LegacyWafRulesetApi.md#getwafrulesetvcl) | Generate WAF ruleset VCL +[*LegacyWafRulesetApi*](docs/Api/LegacyWafRulesetApi.md) | [**updateWafRuleset**](docs/Api/LegacyWafRulesetApi.md#updatewafruleset) | Update a WAF ruleset +[*LegacyWafTagApi*](docs/Api/LegacyWafTagApi.md) | [**listLegacyWafTags**](docs/Api/LegacyWafTagApi.md#listlegacywaftags) | List WAF tags +[*LegacyWafUpdateStatusApi*](docs/Api/LegacyWafUpdateStatusApi.md) | [**getWafUpdateStatus**](docs/Api/LegacyWafUpdateStatusApi.md#getwafupdatestatus) | Get the status of a WAF update +[*LegacyWafUpdateStatusApi*](docs/Api/LegacyWafUpdateStatusApi.md) | [**listWafUpdateStatuses**](docs/Api/LegacyWafUpdateStatusApi.md#listwafupdatestatuses) | List update statuses [*LoggingAzureblobApi*](docs/Api/LoggingAzureblobApi.md) | [**createLogAzure**](docs/Api/LoggingAzureblobApi.md#createlogazure) | Create an Azure Blob Storage log endpoint [*LoggingAzureblobApi*](docs/Api/LoggingAzureblobApi.md) | [**deleteLogAzure**](docs/Api/LoggingAzureblobApi.md#deletelogazure) | Delete the Azure Blob Storage log endpoint [*LoggingAzureblobApi*](docs/Api/LoggingAzureblobApi.md) | [**getLogAzure**](docs/Api/LoggingAzureblobApi.md#getlogazure) | Get an Azure Blob Storage log endpoint @@ -287,10 +338,12 @@ Class | Method | Description [*LoggingKafkaApi*](docs/Api/LoggingKafkaApi.md) | [**deleteLogKafka**](docs/Api/LoggingKafkaApi.md#deletelogkafka) | Delete the Kafka log endpoint [*LoggingKafkaApi*](docs/Api/LoggingKafkaApi.md) | [**getLogKafka**](docs/Api/LoggingKafkaApi.md#getlogkafka) | Get a Kafka log endpoint [*LoggingKafkaApi*](docs/Api/LoggingKafkaApi.md) | [**listLogKafka**](docs/Api/LoggingKafkaApi.md#listlogkafka) | List Kafka log endpoints +[*LoggingKafkaApi*](docs/Api/LoggingKafkaApi.md) | [**updateLogKafka**](docs/Api/LoggingKafkaApi.md#updatelogkafka) | Update the Kafka log endpoint [*LoggingKinesisApi*](docs/Api/LoggingKinesisApi.md) | [**createLogKinesis**](docs/Api/LoggingKinesisApi.md#createlogkinesis) | Create an Amazon Kinesis log endpoint [*LoggingKinesisApi*](docs/Api/LoggingKinesisApi.md) | [**deleteLogKinesis**](docs/Api/LoggingKinesisApi.md#deletelogkinesis) | Delete the Amazon Kinesis log endpoint [*LoggingKinesisApi*](docs/Api/LoggingKinesisApi.md) | [**getLogKinesis**](docs/Api/LoggingKinesisApi.md#getlogkinesis) | Get an Amazon Kinesis log endpoint [*LoggingKinesisApi*](docs/Api/LoggingKinesisApi.md) | [**listLogKinesis**](docs/Api/LoggingKinesisApi.md#listlogkinesis) | List Amazon Kinesis log endpoints +[*LoggingKinesisApi*](docs/Api/LoggingKinesisApi.md) | [**updateLogKinesis**](docs/Api/LoggingKinesisApi.md#updatelogkinesis) | Update the Amazon Kinesis log endpoint [*LoggingLogentriesApi*](docs/Api/LoggingLogentriesApi.md) | [**createLogLogentries**](docs/Api/LoggingLogentriesApi.md#createloglogentries) | Create a Logentries log endpoint [*LoggingLogentriesApi*](docs/Api/LoggingLogentriesApi.md) | [**deleteLogLogentries**](docs/Api/LoggingLogentriesApi.md#deleteloglogentries) | Delete a Logentries log endpoint [*LoggingLogentriesApi*](docs/Api/LoggingLogentriesApi.md) | [**getLogLogentries**](docs/Api/LoggingLogentriesApi.md#getloglogentries) | Get a Logentries log endpoint @@ -361,6 +414,10 @@ 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 +[*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 +[*OriginInspectorRealtimeApi*](docs/Api/OriginInspectorRealtimeApi.md) | [**getOriginInspectorLastSecond**](docs/Api/OriginInspectorRealtimeApi.md#getorigininspectorlastsecond) | Get real-time origin data from specific time. [*PackageApi*](docs/Api/PackageApi.md) | [**getPackage**](docs/Api/PackageApi.md#getpackage) | Get details of the service's Compute@Edge package. [*PackageApi*](docs/Api/PackageApi.md) | [**putPackage**](docs/Api/PackageApi.md#putpackage) | Upload a Compute@Edge package. [*PoolApi*](docs/Api/PoolApi.md) | [**createServerPool**](docs/Api/PoolApi.md#createserverpool) | Create a server pool @@ -383,6 +440,7 @@ Class | Method | Description [*RealtimeApi*](docs/Api/RealtimeApi.md) | [**getStatsLast120Seconds**](docs/Api/RealtimeApi.md#getstatslast120seconds) | Get real-time data for the last 120 seconds [*RealtimeApi*](docs/Api/RealtimeApi.md) | [**getStatsLast120SecondsLimitEntries**](docs/Api/RealtimeApi.md#getstatslast120secondslimitentries) | Get a limited number of real-time data entries [*RealtimeApi*](docs/Api/RealtimeApi.md) | [**getStatsLastSecond**](docs/Api/RealtimeApi.md#getstatslastsecond) | Get real-time data from specified time +[*RequestSettingsApi*](docs/Api/RequestSettingsApi.md) | [**createRequestSettings**](docs/Api/RequestSettingsApi.md#createrequestsettings) | Create a Request Settings object [*RequestSettingsApi*](docs/Api/RequestSettingsApi.md) | [**deleteRequestSettings**](docs/Api/RequestSettingsApi.md#deleterequestsettings) | Delete a Request Settings object [*RequestSettingsApi*](docs/Api/RequestSettingsApi.md) | [**getRequestSettings**](docs/Api/RequestSettingsApi.md#getrequestsettings) | Get a Request Settings object [*RequestSettingsApi*](docs/Api/RequestSettingsApi.md) | [**listRequestSettings**](docs/Api/RequestSettingsApi.md#listrequestsettings) | List Request Settings objects @@ -392,9 +450,23 @@ Class | Method | Description [*ResourceApi*](docs/Api/ResourceApi.md) | [**getResource**](docs/Api/ResourceApi.md#getresource) | Display a resource link [*ResourceApi*](docs/Api/ResourceApi.md) | [**listResources**](docs/Api/ResourceApi.md#listresources) | List resource links [*ResourceApi*](docs/Api/ResourceApi.md) | [**updateResource**](docs/Api/ResourceApi.md#updateresource) | Update a resource link +[*ResponseObjectApi*](docs/Api/ResponseObjectApi.md) | [**createResponseObject**](docs/Api/ResponseObjectApi.md#createresponseobject) | Create a Response object [*ResponseObjectApi*](docs/Api/ResponseObjectApi.md) | [**deleteResponseObject**](docs/Api/ResponseObjectApi.md#deleteresponseobject) | Delete a Response Object [*ResponseObjectApi*](docs/Api/ResponseObjectApi.md) | [**getResponseObject**](docs/Api/ResponseObjectApi.md#getresponseobject) | Get a Response object [*ResponseObjectApi*](docs/Api/ResponseObjectApi.md) | [**listResponseObjects**](docs/Api/ResponseObjectApi.md#listresponseobjects) | List Response objects +[*ResponseObjectApi*](docs/Api/ResponseObjectApi.md) | [**updateResponseObject**](docs/Api/ResponseObjectApi.md#updateresponseobject) | Update a Response object +[*SecretStoreApi*](docs/Api/SecretStoreApi.md) | [**clientKey**](docs/Api/SecretStoreApi.md#clientkey) | Create new client key +[*SecretStoreApi*](docs/Api/SecretStoreApi.md) | [**createSecretStore**](docs/Api/SecretStoreApi.md#createsecretstore) | Create new secret store +[*SecretStoreApi*](docs/Api/SecretStoreApi.md) | [**deleteSecretStore**](docs/Api/SecretStoreApi.md#deletesecretstore) | Delete secret store +[*SecretStoreApi*](docs/Api/SecretStoreApi.md) | [**getSecretStore**](docs/Api/SecretStoreApi.md#getsecretstore) | Create secret store by ID +[*SecretStoreApi*](docs/Api/SecretStoreApi.md) | [**getSecretStores**](docs/Api/SecretStoreApi.md#getsecretstores) | Get all secret stores +[*SecretStoreApi*](docs/Api/SecretStoreApi.md) | [**signingKey**](docs/Api/SecretStoreApi.md#signingkey) | Get public key +[*SecretStoreItemApi*](docs/Api/SecretStoreItemApi.md) | [**createSecret**](docs/Api/SecretStoreItemApi.md#createsecret) | Create a new secret in a store. +[*SecretStoreItemApi*](docs/Api/SecretStoreItemApi.md) | [**deleteSecret**](docs/Api/SecretStoreItemApi.md#deletesecret) | Delete a secret from a store. +[*SecretStoreItemApi*](docs/Api/SecretStoreItemApi.md) | [**getSecret**](docs/Api/SecretStoreItemApi.md#getsecret) | Get secret metadata. +[*SecretStoreItemApi*](docs/Api/SecretStoreItemApi.md) | [**getSecrets**](docs/Api/SecretStoreItemApi.md#getsecrets) | List secrets within a store. +[*SecretStoreItemApi*](docs/Api/SecretStoreItemApi.md) | [**mustRecreateSecret**](docs/Api/SecretStoreItemApi.md#mustrecreatesecret) | Recreate a secret in a store. +[*SecretStoreItemApi*](docs/Api/SecretStoreItemApi.md) | [**recreateSecret**](docs/Api/SecretStoreItemApi.md#recreatesecret) | Create or recreate a secret in a store. [*ServerApi*](docs/Api/ServerApi.md) | [**createPoolServer**](docs/Api/ServerApi.md#createpoolserver) | Add a server to a pool [*ServerApi*](docs/Api/ServerApi.md) | [**deletePoolServer**](docs/Api/ServerApi.md#deletepoolserver) | Delete a server from a pool [*ServerApi*](docs/Api/ServerApi.md) | [**getPoolServer**](docs/Api/ServerApi.md#getpoolserver) | Get a pool server @@ -410,9 +482,11 @@ Class | Method | Description [*ServiceApi*](docs/Api/ServiceApi.md) | [**updateService**](docs/Api/ServiceApi.md#updateservice) | Update a service [*ServiceAuthorizationsApi*](docs/Api/ServiceAuthorizationsApi.md) | [**createServiceAuthorization**](docs/Api/ServiceAuthorizationsApi.md#createserviceauthorization) | Create service authorization [*ServiceAuthorizationsApi*](docs/Api/ServiceAuthorizationsApi.md) | [**deleteServiceAuthorization**](docs/Api/ServiceAuthorizationsApi.md#deleteserviceauthorization) | Delete service authorization +[*ServiceAuthorizationsApi*](docs/Api/ServiceAuthorizationsApi.md) | [**deleteServiceAuthorization2**](docs/Api/ServiceAuthorizationsApi.md#deleteserviceauthorization2) | Delete service authorizations [*ServiceAuthorizationsApi*](docs/Api/ServiceAuthorizationsApi.md) | [**listServiceAuthorization**](docs/Api/ServiceAuthorizationsApi.md#listserviceauthorization) | List service authorizations [*ServiceAuthorizationsApi*](docs/Api/ServiceAuthorizationsApi.md) | [**showServiceAuthorization**](docs/Api/ServiceAuthorizationsApi.md#showserviceauthorization) | Show service authorization [*ServiceAuthorizationsApi*](docs/Api/ServiceAuthorizationsApi.md) | [**updateServiceAuthorization**](docs/Api/ServiceAuthorizationsApi.md#updateserviceauthorization) | Update service authorization +[*ServiceAuthorizationsApi*](docs/Api/ServiceAuthorizationsApi.md) | [**updateServiceAuthorization2**](docs/Api/ServiceAuthorizationsApi.md#updateserviceauthorization2) | Update service authorizations [*SettingsApi*](docs/Api/SettingsApi.md) | [**getServiceSettings**](docs/Api/SettingsApi.md#getservicesettings) | Get service settings [*SettingsApi*](docs/Api/SettingsApi.md) | [**updateServiceSettings**](docs/Api/SettingsApi.md#updateservicesettings) | Update service settings [*SnippetApi*](docs/Api/SnippetApi.md) | [**createSnippet**](docs/Api/SnippetApi.md#createsnippet) | Create a snippet @@ -420,12 +494,14 @@ Class | Method | Description [*SnippetApi*](docs/Api/SnippetApi.md) | [**getSnippet**](docs/Api/SnippetApi.md#getsnippet) | Get a versioned snippet [*SnippetApi*](docs/Api/SnippetApi.md) | [**getSnippetDynamic**](docs/Api/SnippetApi.md#getsnippetdynamic) | Get a dynamic snippet [*SnippetApi*](docs/Api/SnippetApi.md) | [**listSnippets**](docs/Api/SnippetApi.md#listsnippets) | List snippets +[*SnippetApi*](docs/Api/SnippetApi.md) | [**updateSnippet**](docs/Api/SnippetApi.md#updatesnippet) | Update a versioned snippet [*SnippetApi*](docs/Api/SnippetApi.md) | [**updateSnippetDynamic**](docs/Api/SnippetApi.md#updatesnippetdynamic) | Update a dynamic snippet [*StarApi*](docs/Api/StarApi.md) | [**createServiceStar**](docs/Api/StarApi.md#createservicestar) | Create a star [*StarApi*](docs/Api/StarApi.md) | [**deleteServiceStar**](docs/Api/StarApi.md#deleteservicestar) | Delete a star [*StarApi*](docs/Api/StarApi.md) | [**getServiceStar**](docs/Api/StarApi.md#getservicestar) | Get a star [*StarApi*](docs/Api/StarApi.md) | [**listServiceStars**](docs/Api/StarApi.md#listservicestars) | List stars [*StatsApi*](docs/Api/StatsApi.md) | [**getServiceStats**](docs/Api/StatsApi.md#getservicestats) | Get stats for a service +[*SudoApi*](docs/Api/SudoApi.md) | [**requestSudoAccess**](docs/Api/SudoApi.md#requestsudoaccess) | Request Sudo access [*TlsActivationsApi*](docs/Api/TlsActivationsApi.md) | [**createTlsActivation**](docs/Api/TlsActivationsApi.md#createtlsactivation) | Enable TLS for a domain using a custom certificate [*TlsActivationsApi*](docs/Api/TlsActivationsApi.md) | [**deleteTlsActivation**](docs/Api/TlsActivationsApi.md#deletetlsactivation) | Disable TLS on a domain [*TlsActivationsApi*](docs/Api/TlsActivationsApi.md) | [**getTlsActivation**](docs/Api/TlsActivationsApi.md#gettlsactivation) | Get a TLS activation @@ -456,6 +532,8 @@ Class | Method | Description [*TlsSubscriptionsApi*](docs/Api/TlsSubscriptionsApi.md) | [**getTlsSub**](docs/Api/TlsSubscriptionsApi.md#gettlssub) | Get a TLS subscription [*TlsSubscriptionsApi*](docs/Api/TlsSubscriptionsApi.md) | [**listTlsSubs**](docs/Api/TlsSubscriptionsApi.md#listtlssubs) | List TLS subscriptions [*TlsSubscriptionsApi*](docs/Api/TlsSubscriptionsApi.md) | [**patchTlsSub**](docs/Api/TlsSubscriptionsApi.md#patchtlssub) | Update a TLS subscription +[*TokensApi*](docs/Api/TokensApi.md) | [**bulkRevokeTokens**](docs/Api/TokensApi.md#bulkrevoketokens) | Revoke multiple tokens +[*TokensApi*](docs/Api/TokensApi.md) | [**createToken**](docs/Api/TokensApi.md#createtoken) | Create a token [*TokensApi*](docs/Api/TokensApi.md) | [**getToken**](docs/Api/TokensApi.md#gettoken) | Get a token [*TokensApi*](docs/Api/TokensApi.md) | [**getTokenCurrent**](docs/Api/TokensApi.md#gettokencurrent) | Get the current token [*TokensApi*](docs/Api/TokensApi.md) | [**listTokensCustomer**](docs/Api/TokensApi.md#listtokenscustomer) | List tokens for a customer @@ -492,6 +570,7 @@ Class | Method | Description [*VersionApi*](docs/Api/VersionApi.md) | [**lockServiceVersion**](docs/Api/VersionApi.md#lockserviceversion) | Lock a service version [*VersionApi*](docs/Api/VersionApi.md) | [**updateServiceVersion**](docs/Api/VersionApi.md#updateserviceversion) | Update a service version [*VersionApi*](docs/Api/VersionApi.md) | [**validateServiceVersion**](docs/Api/VersionApi.md#validateserviceversion) | Validate a service version +[*WafActiveRulesApi*](docs/Api/WafActiveRulesApi.md) | [**bulkDeleteWafActiveRules**](docs/Api/WafActiveRulesApi.md#bulkdeletewafactiverules) | Delete multiple active rules from a WAF [*WafActiveRulesApi*](docs/Api/WafActiveRulesApi.md) | [**bulkUpdateWafActiveRules**](docs/Api/WafActiveRulesApi.md#bulkupdatewafactiverules) | Update multiple active rules [*WafActiveRulesApi*](docs/Api/WafActiveRulesApi.md) | [**createWafActiveRule**](docs/Api/WafActiveRulesApi.md#createwafactiverule) | Add a rule to a WAF as an active rule [*WafActiveRulesApi*](docs/Api/WafActiveRulesApi.md) | [**createWafActiveRulesTag**](docs/Api/WafActiveRulesApi.md#createwafactiverulestag) | Create active rules by tag @@ -526,70 +605,12 @@ Class | Method | Description The fastly-php API client currently does not support the following endpoints: -- [`/customer/{customer_id}/contacts`](https://developer.fastly.com/reference/api/account/contact) (POST) -- [`/metrics/domains/services/{service_id}`](https://developer.fastly.com/reference/api/metrics-stats/domain-inspector/historical) (GET) -- [`/metrics/origins/services/{service_id}`](https://developer.fastly.com/reference/api/metrics-stats/origin-inspector/historical) (GET) - [`/resources/stores/kv/{store_id}/batch`](https://developer.fastly.com/reference/api/services/resources/kv-store-item) (PUT) -- [`/resources/stores/secret/client-key`](https://developer.fastly.com/reference/api/services/resources/secret-store) (POST) -- [`/resources/stores/secret/signing-key`](https://developer.fastly.com/reference/api/services/resources/secret-store) (GET) -- [`/resources/stores/secret/{store_id}/secrets/{secret_name}`](https://developer.fastly.com/reference/api/services/resources/secret) (DELETE, GET) -- [`/resources/stores/secret/{store_id}/secrets`](https://developer.fastly.com/reference/api/services/resources/secret) (GET, PATCH, POST, PUT) -- [`/resources/stores/secret/{store_id}`](https://developer.fastly.com/reference/api/services/resources/secret-store) (DELETE, GET) -- [`/resources/stores/secret`](https://developer.fastly.com/reference/api/services/resources/secret-store) (GET, POST) -- [`/roles/{role_id}/permissions`](https://developer.fastly.com/reference/api/account/roles) (DELETE, POST) -- [`/roles/{role_id}`](https://developer.fastly.com/reference/api/account/roles) (PATCH) -- [`/roles`](https://developer.fastly.com/reference/api/account/roles) (POST) -- [`/service-authorizations`](https://developer.fastly.com/reference/api/account/service-authorization) (DELETE, PATCH) -- [`/service-groups/{service_group_id}/services`](https://developer.fastly.com/reference/api/account/service-groups) (DELETE, POST) -- [`/service-groups/{service_group_id}`](https://developer.fastly.com/reference/api/account/service-groups) (PATCH) -- [`/service-groups`](https://developer.fastly.com/reference/api/account/service-groups) (POST) -- [`/service/{service_id}/version/{version_id}/apex-redirects`](https://developer.fastly.com/reference/api/vcl-services/apex-redirect) (POST) -- [`/service/{service_id}/version/{version_id}/director/{director_name}`](https://developer.fastly.com/reference/api/load-balancing/directors/director) (PUT) -- [`/service/{service_id}/version/{version_id}/logging/kafka/{logging_kafka_name}`](https://developer.fastly.com/reference/api/logging/kafka) (PUT) -- [`/service/{service_id}/version/{version_id}/logging/kinesis/{logging_kinesis_name}`](https://developer.fastly.com/reference/api/logging/kinesis) (PUT) -- [`/service/{service_id}/version/{version_id}/request_settings`](https://developer.fastly.com/reference/api/vcl-services/request-settings) (POST) -- [`/service/{service_id}/version/{version_id}/response_object/{response_object_name}`](https://developer.fastly.com/reference/api/vcl-services/response-object) (PUT) -- [`/service/{service_id}/version/{version_id}/response_object`](https://developer.fastly.com/reference/api/vcl-services/response-object) (POST) -- [`/service/{service_id}/version/{version_id}/snippet/{snippet_name}`](https://developer.fastly.com/reference/api/vcl-services/snippet) (PUT) -- [`/service/{service_id}/version/{version_id}/wafs/{firewall_id}`](https://developer.fastly.com/reference/api/legacy-waf/firewall) (GET, PATCH) -- [`/service/{service_id}/version/{version_id}/wafs`](https://developer.fastly.com/reference/api/legacy-waf/firewall) (GET, POST) -- [`/service/{service_id}/wafs/{firewall_id}/owasp`](https://developer.fastly.com/reference/api/legacy-waf/owasp) (GET, PATCH, POST) -- [`/service/{service_id}/wafs/{firewall_id}/rule_statuses`](https://developer.fastly.com/reference/api/legacy-waf/rule-status) (GET, POST) -- [`/service/{service_id}/wafs/{firewall_id}/rules/{waf_rule_id}/rule_status`](https://developer.fastly.com/reference/api/legacy-waf/rule-status) (GET, PATCH) -- [`/service/{service_id}/wafs/{firewall_id}/ruleset/preview`](https://developer.fastly.com/reference/api/legacy-waf/ruleset) (GET) -- [`/service/{service_id}/wafs/{firewall_id}/ruleset`](https://developer.fastly.com/reference/api/legacy-waf/ruleset) (GET, PATCH) -- [`/service/{service_id}/wafs/{firewall_id}/update_statuses/{update_status_id}`](https://developer.fastly.com/reference/api/legacy-waf/update-status) (GET) -- [`/service/{service_id}/wafs/{firewall_id}/update_statuses`](https://developer.fastly.com/reference/api/legacy-waf/update-status) (GET) -- [`/sudo`](https://developer.fastly.com/reference/api/utils/sudo) (POST) - [`/tls/activations/{tls_activation_id}`](https://developer.fastly.com/reference/api/tls/mutual-tls/activations) (GET, PATCH) - [`/tls/activations`](https://developer.fastly.com/reference/api/tls/mutual-tls/activations) (GET) -- [`/tokens`](https://developer.fastly.com/reference/api/auth-tokens/user) (DELETE, POST) -- [`/user-groups/{user_group_id}/members`](https://developer.fastly.com/reference/api/account/user-groups) (DELETE, POST) -- [`/user-groups/{user_group_id}/roles`](https://developer.fastly.com/reference/api/account/user-groups) (DELETE, POST) -- [`/user-groups/{user_group_id}/service-groups`](https://developer.fastly.com/reference/api/account/user-groups) (DELETE, POST) -- [`/user-groups/{user_group_id}`](https://developer.fastly.com/reference/api/account/user-groups) (PATCH) -- [`/user-groups`](https://developer.fastly.com/reference/api/account/user-groups) (POST) - [`/v1/channel/{service_id}/ts/h/limit/{max_entries}`](https://developer.fastly.com/reference/api/metrics-stats/origin-insights) (GET) - [`/v1/channel/{service_id}/ts/h`](https://developer.fastly.com/reference/api/metrics-stats/origin-insights) (GET) - [`/v1/channel/{service_id}/ts/{start_timestamp}`](https://developer.fastly.com/reference/api/metrics-stats/origin-insights) (GET) -- [`/v1/domains/{service_id}/ts/h/limit/{max_entries}`](https://developer.fastly.com/reference/api/metrics-stats/domain-inspector/real-time) (GET) -- [`/v1/domains/{service_id}/ts/h`](https://developer.fastly.com/reference/api/metrics-stats/domain-inspector/real-time) (GET) -- [`/v1/domains/{service_id}/ts/{start_timestamp}`](https://developer.fastly.com/reference/api/metrics-stats/domain-inspector/real-time) (GET) -- [`/v1/origins/{service_id}/ts/h/limit/{max_entries}`](https://developer.fastly.com/reference/api/metrics-stats/origin-inspector/real-time) (GET) -- [`/v1/origins/{service_id}/ts/h`](https://developer.fastly.com/reference/api/metrics-stats/origin-inspector/real-time) (GET) -- [`/v1/origins/{service_id}/ts/{start_timestamp}`](https://developer.fastly.com/reference/api/metrics-stats/origin-inspector/real-time) (GET) -- [`/waf/firewalls/{firewall_id}/versions/{version_id}/active-rules`](https://developer.fastly.com/reference/api/waf/rules/active) (DELETE) -- [`/wafs/configuration_sets/{configuration_set_id}/relationships/wafs`](https://developer.fastly.com/reference/api/legacy-waf/configuration-set) (GET, PATCH) -- [`/wafs/configuration_sets`](https://developer.fastly.com/reference/api/legacy-waf/configuration-set) (GET) -- [`/wafs/rules/{waf_rule_id}/vcl`](https://developer.fastly.com/reference/api/legacy-waf/rule) (GET) -- [`/wafs/rules/{waf_rule_id}`](https://developer.fastly.com/reference/api/legacy-waf/rule) (GET) -- [`/wafs/rules`](https://developer.fastly.com/reference/api/legacy-waf/rule) (GET) -- [`/wafs/tags`](https://developer.fastly.com/reference/api/legacy-waf/tag) (GET) -- [`/wafs/{firewall_id}/disable`](https://developer.fastly.com/reference/api/legacy-waf/firewall) (PATCH) -- [`/wafs/{firewall_id}/enable`](https://developer.fastly.com/reference/api/legacy-waf/firewall) (PATCH) -- [`/wafs/{firewall_id}/rules/{waf_rule_id}/vcl`](https://developer.fastly.com/reference/api/legacy-waf/rule) (GET) -- [`/wafs/{firewall_id}`](https://developer.fastly.com/reference/api/legacy-waf/firewall) (GET) -- [`/wafs`](https://developer.fastly.com/reference/api/legacy-waf/firewall) (GET) If you encounter any non-security-related bug or unexpected behavior, please [file an issue][bug] diff --git a/docs/Api/ApexRedirectApi.md b/docs/Api/ApexRedirectApi.md index 4a25d2a7..db929b2e 100644 --- a/docs/Api/ApexRedirectApi.md +++ b/docs/Api/ApexRedirectApi.md @@ -14,12 +14,65 @@ $apiInstance = new Fastly\Api\ApexRedirectApi( Method | Fastly API endpoint | Description ------------- | ------------- | ------------- +[**createApexRedirect()**](ApexRedirectApi.md#createApexRedirect) | **POST** /service/{service_id}/version/{version_id}/apex-redirects | Create an apex redirect [**deleteApexRedirect()**](ApexRedirectApi.md#deleteApexRedirect) | **DELETE** /apex-redirects/{apex_redirect_id} | Delete an apex redirect [**getApexRedirect()**](ApexRedirectApi.md#getApexRedirect) | **GET** /apex-redirects/{apex_redirect_id} | Get an apex redirect [**listApexRedirects()**](ApexRedirectApi.md#listApexRedirects) | **GET** /service/{service_id}/version/{version_id}/apex-redirects | List apex redirects [**updateApexRedirect()**](ApexRedirectApi.md#updateApexRedirect) | **PUT** /apex-redirects/{apex_redirect_id} | Update an apex redirect +## `createApexRedirect()` + +```php +createApexRedirect($options): \Fastly\Model\ApexRedirect // Create an apex redirect +``` + +Create an apex redirect for a particular service and version. + +### Example +```php + $options['service_id'] = 'service_id_example'; // string | Alphanumeric string identifying the service. +$options['version_id'] = 56; // int | Integer identifying a service version. +$options['service_id'] = 'service_id_example'; // string +$options['version'] = 56; // int +$options['created_at'] = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Date and time in ISO 8601 format. +$options['deleted_at'] = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Date and time in ISO 8601 format. +$options['updated_at'] = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Date and time in ISO 8601 format. +$options['status_code'] = 56; // int | HTTP status code used to redirect the client. +$options['domains'] = array('domains_example'); // string[] | Array of apex domains that should redirect to their WWW subdomain. +$options['feature_revision'] = 56; // int | Revision number of the apex redirect feature implementation. Defaults to the most recent revision. + +try { + $result = $apiInstance->createApexRedirect($options); +} catch (Exception $e) { + echo 'Exception when calling ApexRedirectApi->createApexRedirect: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**service_id** | **string** | Alphanumeric string identifying the service. | +**version_id** | **int** | Integer identifying a service version. | +**service_id** | **string** | | [optional] +**version** | **int** | | [optional] +**created_at** | **\DateTime** | Date and time in ISO 8601 format. | [optional] +**deleted_at** | **\DateTime** | Date and time in ISO 8601 format. | [optional] +**updated_at** | **\DateTime** | Date and time in ISO 8601 format. | [optional] +**status_code** | **int** | HTTP status code used to redirect the client. | [optional] [one of: 301, 302, 307, 308] +**domains** | [**string[]**](../Model/string.md) | Array of apex domains that should redirect to their WWW subdomain. | [optional] +**feature_revision** | **int** | Revision number of the apex redirect feature implementation. Defaults to the most recent revision. | [optional] + +### Return type + +[**\Fastly\Model\ApexRedirect**](../Model/ApexRedirect.md) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + ## `deleteApexRedirect()` ```php diff --git a/docs/Api/ContactApi.md b/docs/Api/ContactApi.md index 071a86e4..b95243a2 100644 --- a/docs/Api/ContactApi.md +++ b/docs/Api/ContactApi.md @@ -14,10 +14,57 @@ $apiInstance = new Fastly\Api\ContactApi( Method | Fastly API endpoint | Description ------------- | ------------- | ------------- +[**createContacts()**](ContactApi.md#createContacts) | **POST** /customer/{customer_id}/contacts | Add a new customer contact [**deleteContact()**](ContactApi.md#deleteContact) | **DELETE** /customer/{customer_id}/contact/{contact_id} | Delete a contact [**listContacts()**](ContactApi.md#listContacts) | **GET** /customer/{customer_id}/contacts | List contacts +## `createContacts()` + +```php +createContacts($options): \Fastly\Model\ContactResponse // Add a new customer contact +``` + +Create a contact. + +### Example +```php + $options['customer_id'] = 'customer_id_example'; // string | Alphanumeric string identifying the customer. +$options['user_id'] = 'user_id_example'; // string | The alphanumeric string representing the user for this customer contact. +$options['contact_type'] = 'contact_type_example'; // string | The type of contact. +$options['name'] = 'name_example'; // string | The name of this contact, when user_id is not provided. +$options['email'] = 'email_example'; // string | The email of this contact, when a user_id is not provided. +$options['phone'] = 'phone_example'; // string | The phone number for this contact. Required for primary, technical, and security contact types. +$options['customer_id'] = 'customer_id_example'; // string | The alphanumeric string representing the customer for this customer contact. + +try { + $result = $apiInstance->createContacts($options); +} catch (Exception $e) { + echo 'Exception when calling ContactApi->createContacts: ', $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. | +**user_id** | **string** | The alphanumeric string representing the user for this customer contact. | [optional] +**contact_type** | **string** | The type of contact. | [optional] [one of: 'primary', 'billing', 'technical', 'security', 'emergency', 'general compliance'] +**name** | **string** | The name of this contact, when user_id is not provided. | [optional] +**email** | **string** | The email of this contact, when a user_id is not provided. | [optional] +**phone** | **string** | The phone number for this contact. Required for primary, technical, and security contact types. | [optional] +**customer_id** | **string** | The alphanumeric string representing the customer for this customer contact. | [optional] + +### Return type + +[**\Fastly\Model\ContactResponse**](../Model/ContactResponse.md) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + ## `deleteContact()` ```php diff --git a/docs/Api/DirectorApi.md b/docs/Api/DirectorApi.md index d968c04a..cceb64a5 100644 --- a/docs/Api/DirectorApi.md +++ b/docs/Api/DirectorApi.md @@ -18,6 +18,7 @@ Method | Fastly API endpoint | Description [**deleteDirector()**](DirectorApi.md#deleteDirector) | **DELETE** /service/{service_id}/version/{version_id}/director/{director_name} | Delete a director [**getDirector()**](DirectorApi.md#getDirector) | **GET** /service/{service_id}/version/{version_id}/director/{director_name} | Get a director [**listDirectors()**](DirectorApi.md#listDirectors) | **GET** /service/{service_id}/version/{version_id}/director | List directors +[**updateDirector()**](DirectorApi.md#updateDirector) | **PUT** /service/{service_id}/version/{version_id}/director/{director_name} | Update a director ## `createDirector()` @@ -183,3 +184,41 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) + +## `updateDirector()` + +```php +updateDirector($options): \Fastly\Model\DirectorResponse // Update a director +``` + +Update the director for a particular service and version. + +### Example +```php + $options['service_id'] = 'service_id_example'; // string | Alphanumeric string identifying the service. +$options['version_id'] = 56; // int | Integer identifying a service version. +$options['director_name'] = 'director_name_example'; // string | Name for the Director. + +try { + $result = $apiInstance->updateDirector($options); +} catch (Exception $e) { + echo 'Exception when calling DirectorApi->updateDirector: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**service_id** | **string** | Alphanumeric string identifying the service. | +**version_id** | **int** | Integer identifying a service version. | +**director_name** | **string** | Name for the Director. | + +### Return type + +[**\Fastly\Model\DirectorResponse**](../Model/DirectorResponse.md) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) diff --git a/docs/Api/DomainInspectorHistoricalApi.md b/docs/Api/DomainInspectorHistoricalApi.md new file mode 100644 index 00000000..f0ef02e2 --- /dev/null +++ b/docs/Api/DomainInspectorHistoricalApi.md @@ -0,0 +1,72 @@ +# Fastly\Api\DomainInspectorHistoricalApi + + +```php +$apiInstance = new Fastly\Api\DomainInspectorHistoricalApi( + // 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 + +Method | Fastly API endpoint | Description +------------- | ------------- | ------------- +[**getDomainInspectorHistorical()**](DomainInspectorHistoricalApi.md#getDomainInspectorHistorical) | **GET** /metrics/domains/services/{service_id} | Get historical domain data for a service + + +## `getDomainInspectorHistorical()` + +```php +getDomainInspectorHistorical($options): \Fastly\Model\HistoricalDomainsResponse // Get historical domain data for a service +``` + +Fetches historical domain metrics for a given Fastly service, optionally filtering and grouping the results by domain, region, or POP. + +### Example +```php + $options['service_id'] = 'service_id_example'; // string | Alphanumeric string identifying the service. +$options['start'] = 2021-08-01T00:00:00.000Z; // string | A valid ISO-8601-formatted date and time, or UNIX timestamp, indicating the inclusive start of the query time range. If not provided, a default is chosen based on the provided `downsample` value. +$options['end'] = 2020-08-02T00:00:00.000Z; // string | A valid ISO-8601-formatted date and time, or UNIX timestamp, indicating the exclusive end of the query time range. If not provided, a default is chosen based on the provided `downsample` value. +$options['downsample'] = hour; // string | Duration of sample windows. +$options['metric'] = resp_body_bytes,status_2xx; // string | The metric to retrieve. Up to ten comma-separated metrics are accepted. +$options['group_by'] = domain; // string | Dimensions to return in the query. Multiple dimensions may be separated by commas. For example, `group_by=domain` will return one timeseries for every domain, as a total across all datacenters (POPs). +$options['limit'] = '100'; // string | Number of results per page. The maximum is 200. +$options['cursor'] = 'cursor_example'; // string | Cursor value from a previous response to retrieve the next page. To request the first page, this should be empty. +$options['region'] = usa; // string | Limit query to one or more specific geographic regions. Values should be comma-separated. +$options['datacenter'] = SJC,STP; // string | Limit query to one or more specific POPs. Values should be comma-separated. +$options['domain'] = domain_1.com,domain_2.com; // string | Limit query to one or more specific domains. Values should be comma-separated. + +try { + $result = $apiInstance->getDomainInspectorHistorical($options); +} catch (Exception $e) { + echo 'Exception when calling DomainInspectorHistoricalApi->getDomainInspectorHistorical: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**service_id** | **string** | Alphanumeric string identifying the service. | +**start** | **string** | A valid ISO-8601-formatted date and time, or UNIX timestamp, indicating the inclusive start of the query time range. If not provided, a default is chosen based on the provided `downsample` value. | [optional] +**end** | **string** | A valid ISO-8601-formatted date and time, or UNIX timestamp, indicating the exclusive end of the query time range. If not provided, a default is chosen based on the provided `downsample` value. | [optional] +**downsample** | **string** | Duration of sample windows. | [optional] [one of: 'hour', 'minute', 'day'] [defaults to 'hour'] +**metric** | **string** | The metric to retrieve. Up to ten comma-separated metrics are accepted. | [optional] [defaults to 'edge_requests'] +**group_by** | **string** | Dimensions to return in the query. Multiple dimensions may be separated by commas. For example, `group_by=domain` will return one timeseries for every domain, as a total across all datacenters (POPs). | [optional] [one of: 'domain', 'datacenter', 'region', 'none'] +**limit** | **string** | Number of results per page. The maximum is 200. | [optional] [defaults to '100'] +**cursor** | **string** | Cursor value from a previous response to retrieve the next page. To request the first page, this should be empty. | [optional] +**region** | **string** | Limit query to one or more specific geographic regions. Values should be comma-separated. | [optional] [one of: 'usa', 'europe', 'asia', 'asia_india', 'asia_southkorea', 'africa_std', 'southamerica_std'] +**datacenter** | **string** | Limit query to one or more specific POPs. Values should be comma-separated. | [optional] +**domain** | **string** | Limit query to one or more specific domains. Values should be comma-separated. | [optional] + +### Return type + +[**\Fastly\Model\HistoricalDomainsResponse**](../Model/HistoricalDomainsResponse.md) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) diff --git a/docs/Api/DomainInspectorRealtimeApi.md b/docs/Api/DomainInspectorRealtimeApi.md new file mode 100644 index 00000000..fd92db98 --- /dev/null +++ b/docs/Api/DomainInspectorRealtimeApi.md @@ -0,0 +1,126 @@ +# Fastly\Api\DomainInspectorRealtimeApi + + +```php +$apiInstance = new Fastly\Api\DomainInspectorRealtimeApi( + // 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 + +Method | Fastly API endpoint | Description +------------- | ------------- | ------------- +[**getDomainInspectorLast120Seconds()**](DomainInspectorRealtimeApi.md#getDomainInspectorLast120Seconds) | **GET** /v1/domains/{service_id}/ts/h | Get real-time domain data for the last 120 seconds +[**getDomainInspectorLastMaxEntries()**](DomainInspectorRealtimeApi.md#getDomainInspectorLastMaxEntries) | **GET** /v1/domains/{service_id}/ts/h/limit/{max_entries} | Get a limited number of real-time domain data entries +[**getDomainInspectorLastSecond()**](DomainInspectorRealtimeApi.md#getDomainInspectorLastSecond) | **GET** /v1/domains/{service_id}/ts/{start_timestamp} | Get real-time domain data from a specified time + + +## `getDomainInspectorLast120Seconds()` + +```php +getDomainInspectorLast120Seconds($options): \Fastly\Model\DomainInspector // Get real-time domain data for the last 120 seconds +``` + +Get data for the 120 seconds preceding the latest timestamp available for a service. + +### Example +```php + $options['service_id'] = 'service_id_example'; // string | Alphanumeric string identifying the service. + +try { + $result = $apiInstance->getDomainInspectorLast120Seconds($options); +} catch (Exception $e) { + echo 'Exception when calling DomainInspectorRealtimeApi->getDomainInspectorLast120Seconds: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**service_id** | **string** | Alphanumeric string identifying the service. | + +### Return type + +[**\Fastly\Model\DomainInspector**](../Model/DomainInspector.md) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `getDomainInspectorLastMaxEntries()` + +```php +getDomainInspectorLastMaxEntries($options): \Fastly\Model\DomainInspector // Get a limited number of real-time domain data entries +``` + +Get data for the `max_entries` seconds preceding the latest timestamp available for a service, up to a maximum of 120 entries. + +### Example +```php + $options['service_id'] = 'service_id_example'; // string | Alphanumeric string identifying the service. +$options['max_entries'] = 1; // int | Maximum number of results to show. + +try { + $result = $apiInstance->getDomainInspectorLastMaxEntries($options); +} catch (Exception $e) { + echo 'Exception when calling DomainInspectorRealtimeApi->getDomainInspectorLastMaxEntries: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**service_id** | **string** | Alphanumeric string identifying the service. | +**max_entries** | **int** | Maximum number of results to show. | + +### Return type + +[**\Fastly\Model\DomainInspector**](../Model/DomainInspector.md) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `getDomainInspectorLastSecond()` + +```php +getDomainInspectorLastSecond($options): \Fastly\Model\DomainInspector // Get real-time domain data from a specified time +``` + +Get real-time domain data for the specified reporting period. Specify `0` to get a single entry for the last complete second. The `Timestamp` field included in the response provides the time index of the latest entry in the dataset and can be provided as the `start_timestamp` of the next request for a seamless continuation of the dataset from one request to the next. Due to processing latency, the earliest entry in the response dataset may be earlier than `start_timestamp` by the value of `AggregateDelay`. + +### Example +```php + $options['service_id'] = 'service_id_example'; // string | Alphanumeric string identifying the service. +$options['start_timestamp'] = 56; // int | Timestamp in seconds (Unix epoch time). + +try { + $result = $apiInstance->getDomainInspectorLastSecond($options); +} catch (Exception $e) { + echo 'Exception when calling DomainInspectorRealtimeApi->getDomainInspectorLastSecond: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**service_id** | **string** | Alphanumeric string identifying the service. | +**start_timestamp** | **int** | Timestamp in seconds (Unix epoch time). | + +### Return type + +[**\Fastly\Model\DomainInspector**](../Model/DomainInspector.md) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) diff --git a/docs/Api/IamRolesApi.md b/docs/Api/IamRolesApi.md index 93eb5951..6d9ccd27 100644 --- a/docs/Api/IamRolesApi.md +++ b/docs/Api/IamRolesApi.md @@ -14,12 +14,86 @@ $apiInstance = new Fastly\Api\IamRolesApi( Method | Fastly API endpoint | Description ------------- | ------------- | ------------- +[**addRolePermissions()**](IamRolesApi.md#addRolePermissions) | **POST** /roles/{role_id}/permissions | Add permissions to a role +[**createARole()**](IamRolesApi.md#createARole) | **POST** /roles | Create a role [**deleteARole()**](IamRolesApi.md#deleteARole) | **DELETE** /roles/{role_id} | Delete a role [**getARole()**](IamRolesApi.md#getARole) | **GET** /roles/{role_id} | Get a role [**listRolePermissions()**](IamRolesApi.md#listRolePermissions) | **GET** /roles/{role_id}/permissions | List permissions in a role [**listRoles()**](IamRolesApi.md#listRoles) | **GET** /roles | List roles +[**removeRolePermissions()**](IamRolesApi.md#removeRolePermissions) | **DELETE** /roles/{role_id}/permissions | Remove permissions from a role +[**updateARole()**](IamRolesApi.md#updateARole) | **PATCH** /roles/{role_id} | Update a role +## `addRolePermissions()` + +```php +addRolePermissions($options): object // Add permissions to a role +``` + +Add permissions to a role. + +### Example +```php + $options['role_id'] = 'role_id_example'; // string | Alphanumeric string identifying the role. +$options['request_body'] = {"permissions":[{"id":"2bxSauWWdQ5Hmg2d7WQiPU"},{"id":"5QoWSdPgkxvL9eoDMXRDr4"}]}; // array + +try { + $result = $apiInstance->addRolePermissions($options); +} catch (Exception $e) { + echo 'Exception when calling IamRolesApi->addRolePermissions: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**role_id** | **string** | Alphanumeric string identifying the role. | +**request_body** | [**array**](../Model/object.md) | | [optional] + +### Return type + +**object** + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `createARole()` + +```php +createARole($options): object // Create a role +``` + +Create a role. + +### Example +```php + $options['request_body'] = {"name":"Security Engineer"}; // array + +try { + $result = $apiInstance->createARole($options); +} catch (Exception $e) { + echo 'Exception when calling IamRolesApi->createARole: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**request_body** | [**array**](../Model/object.md) | | [optional] + +### Return type + +**object** + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + ## `deleteARole()` ```php @@ -157,3 +231,75 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) + +## `removeRolePermissions()` + +```php +removeRolePermissions($options) // Remove permissions from a role +``` + +Remove permissions from a role. + +### Example +```php + $options['role_id'] = 'role_id_example'; // string | Alphanumeric string identifying the role. +$options['request_body'] = {"permissions":[{"id":"2bxSauWWdQ5Hmg2d7WQiPU"},{"id":"5QoWSdPgkxvL9eoDMXRDr4"}]}; // array + +try { + $apiInstance->removeRolePermissions($options); +} catch (Exception $e) { + echo 'Exception when calling IamRolesApi->removeRolePermissions: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**role_id** | **string** | Alphanumeric string identifying the role. | +**request_body** | [**array**](../Model/object.md) | | [optional] + +### Return type + +void (empty response body) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `updateARole()` + +```php +updateARole($options): object // Update a role +``` + +Update a role. + +### Example +```php + $options['role_id'] = 'role_id_example'; // string | Alphanumeric string identifying the role. +$options['request_body'] = {"name":"Account Manager","description":"Manage users."}; // array + +try { + $result = $apiInstance->updateARole($options); +} catch (Exception $e) { + echo 'Exception when calling IamRolesApi->updateARole: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**role_id** | **string** | Alphanumeric string identifying the role. | +**request_body** | [**array**](../Model/object.md) | | [optional] + +### Return type + +**object** + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) diff --git a/docs/Api/IamServiceGroupsApi.md b/docs/Api/IamServiceGroupsApi.md index e842e09c..8a656844 100644 --- a/docs/Api/IamServiceGroupsApi.md +++ b/docs/Api/IamServiceGroupsApi.md @@ -14,12 +14,86 @@ $apiInstance = new Fastly\Api\IamServiceGroupsApi( Method | Fastly API endpoint | Description ------------- | ------------- | ------------- +[**addServiceGroupServices()**](IamServiceGroupsApi.md#addServiceGroupServices) | **POST** /service-groups/{service_group_id}/services | Add services in a service group +[**createAServiceGroup()**](IamServiceGroupsApi.md#createAServiceGroup) | **POST** /service-groups | Create a service group [**deleteAServiceGroup()**](IamServiceGroupsApi.md#deleteAServiceGroup) | **DELETE** /service-groups/{service_group_id} | Delete a service group [**getAServiceGroup()**](IamServiceGroupsApi.md#getAServiceGroup) | **GET** /service-groups/{service_group_id} | Get a service group [**listServiceGroupServices()**](IamServiceGroupsApi.md#listServiceGroupServices) | **GET** /service-groups/{service_group_id}/services | List services to a service group [**listServiceGroups()**](IamServiceGroupsApi.md#listServiceGroups) | **GET** /service-groups | List service groups +[**removeServiceGroupServices()**](IamServiceGroupsApi.md#removeServiceGroupServices) | **DELETE** /service-groups/{service_group_id}/services | Remove services from a service group +[**updateAServiceGroup()**](IamServiceGroupsApi.md#updateAServiceGroup) | **PATCH** /service-groups/{service_group_id} | Update a service group +## `addServiceGroupServices()` + +```php +addServiceGroupServices($options): object // Add services in a service group +``` + +Add services in a service group. + +### Example +```php + $options['service_group_id'] = 'service_group_id_example'; // string | Alphanumeric string identifying the service group. +$options['request_body'] = {"services":[{"id":"0QbayrOodFILsM58jum2nt"},{"id":"5QoWSdPgkxvL9eoDMXRDr4"}]}; // array + +try { + $result = $apiInstance->addServiceGroupServices($options); +} catch (Exception $e) { + echo 'Exception when calling IamServiceGroupsApi->addServiceGroupServices: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**service_group_id** | **string** | Alphanumeric string identifying the service group. | +**request_body** | [**array**](../Model/object.md) | | [optional] + +### Return type + +**object** + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `createAServiceGroup()` + +```php +createAServiceGroup($options): object // Create a service group +``` + +Create a service group. + +### Example +```php + $options['request_body'] = {"name":"Prod Services"}; // array + +try { + $result = $apiInstance->createAServiceGroup($options); +} catch (Exception $e) { + echo 'Exception when calling IamServiceGroupsApi->createAServiceGroup: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**request_body** | [**array**](../Model/object.md) | | [optional] + +### Return type + +**object** + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + ## `deleteAServiceGroup()` ```php @@ -161,3 +235,75 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) + +## `removeServiceGroupServices()` + +```php +removeServiceGroupServices($options) // Remove services from a service group +``` + +Remove services from a service group. + +### Example +```php + $options['service_group_id'] = 'service_group_id_example'; // string | Alphanumeric string identifying the service group. +$options['request_body'] = {"services":[{"id":"0QbayrOodFILsM58jum2nt"},{"id":"5QoWSdPgkxvL9eoDMXRDr4"}]}; // array + +try { + $apiInstance->removeServiceGroupServices($options); +} catch (Exception $e) { + echo 'Exception when calling IamServiceGroupsApi->removeServiceGroupServices: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**service_group_id** | **string** | Alphanumeric string identifying the service group. | +**request_body** | [**array**](../Model/object.md) | | [optional] + +### Return type + +void (empty response body) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `updateAServiceGroup()` + +```php +updateAServiceGroup($options): object // Update a service group +``` + +Update a service group. + +### Example +```php + $options['service_group_id'] = 'service_group_id_example'; // string | Alphanumeric string identifying the service group. +$options['request_body'] = {"name":"Prod Services","description":"Services running in the production environment."}; // array + +try { + $result = $apiInstance->updateAServiceGroup($options); +} catch (Exception $e) { + echo 'Exception when calling IamServiceGroupsApi->updateAServiceGroup: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**service_group_id** | **string** | Alphanumeric string identifying the service group. | +**request_body** | [**array**](../Model/object.md) | | [optional] + +### Return type + +**object** + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) diff --git a/docs/Api/IamUserGroupsApi.md b/docs/Api/IamUserGroupsApi.md index 65cf0805..e431eab1 100644 --- a/docs/Api/IamUserGroupsApi.md +++ b/docs/Api/IamUserGroupsApi.md @@ -14,14 +14,164 @@ $apiInstance = new Fastly\Api\IamUserGroupsApi( Method | Fastly API endpoint | Description ------------- | ------------- | ------------- +[**addUserGroupMembers()**](IamUserGroupsApi.md#addUserGroupMembers) | **POST** /user-groups/{user_group_id}/members | Add members to a user group +[**addUserGroupRoles()**](IamUserGroupsApi.md#addUserGroupRoles) | **POST** /user-groups/{user_group_id}/roles | Add roles to a user group +[**addUserGroupServiceGroups()**](IamUserGroupsApi.md#addUserGroupServiceGroups) | **POST** /user-groups/{user_group_id}/service-groups | Add service groups to a user group +[**createAUserGroup()**](IamUserGroupsApi.md#createAUserGroup) | **POST** /user-groups | Create a user group [**deleteAUserGroup()**](IamUserGroupsApi.md#deleteAUserGroup) | **DELETE** /user-groups/{user_group_id} | Delete a user group [**getAUserGroup()**](IamUserGroupsApi.md#getAUserGroup) | **GET** /user-groups/{user_group_id} | Get a user group [**listUserGroupMembers()**](IamUserGroupsApi.md#listUserGroupMembers) | **GET** /user-groups/{user_group_id}/members | List members of a user group [**listUserGroupRoles()**](IamUserGroupsApi.md#listUserGroupRoles) | **GET** /user-groups/{user_group_id}/roles | List roles in a user group [**listUserGroupServiceGroups()**](IamUserGroupsApi.md#listUserGroupServiceGroups) | **GET** /user-groups/{user_group_id}/service-groups | List service groups in a user group [**listUserGroups()**](IamUserGroupsApi.md#listUserGroups) | **GET** /user-groups | List user groups +[**removeUserGroupMembers()**](IamUserGroupsApi.md#removeUserGroupMembers) | **DELETE** /user-groups/{user_group_id}/members | Remove members of a user group +[**removeUserGroupRoles()**](IamUserGroupsApi.md#removeUserGroupRoles) | **DELETE** /user-groups/{user_group_id}/roles | Remove roles from a user group +[**removeUserGroupServiceGroups()**](IamUserGroupsApi.md#removeUserGroupServiceGroups) | **DELETE** /user-groups/{user_group_id}/service-groups | Remove service groups from a user group +[**updateAUserGroup()**](IamUserGroupsApi.md#updateAUserGroup) | **PATCH** /user-groups/{user_group_id} | Update a user group +## `addUserGroupMembers()` + +```php +addUserGroupMembers($options): object // Add members to a user group +``` + +Add members to a user group. + +### Example +```php + $options['user_group_id'] = 'user_group_id_example'; // string | Alphanumeric string identifying the user group. +$options['request_body'] = {"members":[{"id":"0QbayrOodFILsM58jum2nt","object":"user"},{"id":"5QoWSdPgkxvL9eoDMXRDr4","object":"invitation"}]}; // array + +try { + $result = $apiInstance->addUserGroupMembers($options); +} catch (Exception $e) { + echo 'Exception when calling IamUserGroupsApi->addUserGroupMembers: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**user_group_id** | **string** | Alphanumeric string identifying the user group. | +**request_body** | [**array**](../Model/object.md) | | [optional] + +### Return type + +**object** + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `addUserGroupRoles()` + +```php +addUserGroupRoles($options): object // Add roles to a user group +``` + +Add roles to a user group. + +### Example +```php + $options['user_group_id'] = 'user_group_id_example'; // string | Alphanumeric string identifying the user group. +$options['request_body'] = {"roles":[{"id":"0QbayrOodFILsM58jum2nt"},{"id":"5QoWSdPgkxvL9eoDMXRDr4"}]}; // array + +try { + $result = $apiInstance->addUserGroupRoles($options); +} catch (Exception $e) { + echo 'Exception when calling IamUserGroupsApi->addUserGroupRoles: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**user_group_id** | **string** | Alphanumeric string identifying the user group. | +**request_body** | [**array**](../Model/object.md) | | [optional] + +### Return type + +**object** + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `addUserGroupServiceGroups()` + +```php +addUserGroupServiceGroups($options): object // Add service groups to a user group +``` + +Add service groups to a user group. + +### Example +```php + $options['user_group_id'] = 'user_group_id_example'; // string | Alphanumeric string identifying the user group. +$options['request_body'] = {"service_groups":[{"id":"0QbayrOodFILsM58jum2nt"},{"id":"5QoWSdPgkxvL9eoDMXRDr4"}]}; // array + +try { + $result = $apiInstance->addUserGroupServiceGroups($options); +} catch (Exception $e) { + echo 'Exception when calling IamUserGroupsApi->addUserGroupServiceGroups: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**user_group_id** | **string** | Alphanumeric string identifying the user group. | +**request_body** | [**array**](../Model/object.md) | | [optional] + +### Return type + +**object** + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `createAUserGroup()` + +```php +createAUserGroup($options): object // Create a user group +``` + +Create a user group. + +### Example +```php + $options['request_body'] = {"name":"Security Engineers"}; // array + +try { + $result = $apiInstance->createAUserGroup($options); +} catch (Exception $e) { + echo 'Exception when calling IamUserGroupsApi->createAUserGroup: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**request_body** | [**array**](../Model/object.md) | | [optional] + +### Return type + +**object** + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + ## `deleteAUserGroup()` ```php @@ -239,3 +389,147 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) + +## `removeUserGroupMembers()` + +```php +removeUserGroupMembers($options) // Remove members of a user group +``` + +Remove members of a user group + +### Example +```php + $options['user_group_id'] = 'user_group_id_example'; // string | Alphanumeric string identifying the user group. +$options['request_body'] = {"members":[{"id":"0QbayrOodFILsM58jum2nt","object":"user"},{"id":"5QoWSdPgkxvL9eoDMXRDr4","object":"invitation"}]}; // array + +try { + $apiInstance->removeUserGroupMembers($options); +} catch (Exception $e) { + echo 'Exception when calling IamUserGroupsApi->removeUserGroupMembers: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**user_group_id** | **string** | Alphanumeric string identifying the user group. | +**request_body** | [**array**](../Model/object.md) | | [optional] + +### Return type + +void (empty response body) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `removeUserGroupRoles()` + +```php +removeUserGroupRoles($options) // Remove roles from a user group +``` + +Remove roles from a user group. + +### Example +```php + $options['user_group_id'] = 'user_group_id_example'; // string | Alphanumeric string identifying the user group. +$options['request_body'] = {"roles":[{"id":"2bxSauWWdQ5Hmg2d7WQiPU"},{"id":"5QoWSdPgkxvL9eoDMXRDr4"}]}; // array + +try { + $apiInstance->removeUserGroupRoles($options); +} catch (Exception $e) { + echo 'Exception when calling IamUserGroupsApi->removeUserGroupRoles: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**user_group_id** | **string** | Alphanumeric string identifying the user group. | +**request_body** | [**array**](../Model/object.md) | | [optional] + +### Return type + +void (empty response body) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `removeUserGroupServiceGroups()` + +```php +removeUserGroupServiceGroups($options) // Remove service groups from a user group +``` + +Remove service groups from a user group. + +### Example +```php + $options['user_group_id'] = 'user_group_id_example'; // string | Alphanumeric string identifying the user group. +$options['request_body'] = {"service_groups":[{"id":"0QbayrOodFILsM58jum2nt"},{"id":"5QoWSdPgkxvL9eoDMXRDr4"}]}; // array + +try { + $apiInstance->removeUserGroupServiceGroups($options); +} catch (Exception $e) { + echo 'Exception when calling IamUserGroupsApi->removeUserGroupServiceGroups: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**user_group_id** | **string** | Alphanumeric string identifying the user group. | +**request_body** | [**array**](../Model/object.md) | | [optional] + +### Return type + +void (empty response body) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `updateAUserGroup()` + +```php +updateAUserGroup($options): object // Update a user group +``` + +Update a user group. + +### Example +```php + $options['user_group_id'] = 'user_group_id_example'; // string | Alphanumeric string identifying the user group. +$options['request_body'] = {"name":"Security Engineers","description":"Managing security on staging and production services."}; // array + +try { + $result = $apiInstance->updateAUserGroup($options); +} catch (Exception $e) { + echo 'Exception when calling IamUserGroupsApi->updateAUserGroup: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**user_group_id** | **string** | Alphanumeric string identifying the user group. | +**request_body** | [**array**](../Model/object.md) | | [optional] + +### Return type + +**object** + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) diff --git a/docs/Api/LegacyWafConfigurationSetsApi.md b/docs/Api/LegacyWafConfigurationSetsApi.md new file mode 100644 index 00000000..3a07952d --- /dev/null +++ b/docs/Api/LegacyWafConfigurationSetsApi.md @@ -0,0 +1,121 @@ +# Fastly\Api\LegacyWafConfigurationSetsApi + + +```php +$apiInstance = new Fastly\Api\LegacyWafConfigurationSetsApi( + // 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 + +Method | Fastly API endpoint | Description +------------- | ------------- | ------------- +[**listWafConfigSets()**](LegacyWafConfigurationSetsApi.md#listWafConfigSets) | **GET** /wafs/configuration_sets | List configuration sets +[**listWafsConfigSet()**](LegacyWafConfigurationSetsApi.md#listWafsConfigSet) | **GET** /wafs/configuration_sets/{configuration_set_id}/relationships/wafs | List WAFs currently using a configuration set +[**useWafConfigSet()**](LegacyWafConfigurationSetsApi.md#useWafConfigSet) | **PATCH** /wafs/configuration_sets/{configuration_set_id}/relationships/wafs | Apply a configuration set to a WAF + + +## `listWafConfigSets()` + +```php +listWafConfigSets($options): object // List configuration sets +``` + +List all Configuration sets. + +### Example +```php + +try { + $result = $apiInstance->listWafConfigSets($options); +} catch (Exception $e) { + echo 'Exception when calling LegacyWafConfigurationSetsApi->listWafConfigSets: ', $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 + +**object** + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `listWafsConfigSet()` + +```php +listWafsConfigSet($options): object // List WAFs currently using a configuration set +``` + +List the WAF objects currently using the specified configuration set. + +### Example +```php + $options['configuration_set_id'] = 'configuration_set_id_example'; // string | Alphanumeric string identifying a WAF configuration set. + +try { + $result = $apiInstance->listWafsConfigSet($options); +} catch (Exception $e) { + echo 'Exception when calling LegacyWafConfigurationSetsApi->listWafsConfigSet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**configuration_set_id** | **string** | Alphanumeric string identifying a WAF configuration set. | + +### Return type + +**object** + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `useWafConfigSet()` + +```php +useWafConfigSet($options): object // Apply a configuration set to a WAF +``` + +Update one or more WAF objects to use the specified configuration set. + +### Example +```php + $options['configuration_set_id'] = 'configuration_set_id_example'; // string | Alphanumeric string identifying a WAF configuration set. +$options['request_body'] = {"data":[{"id":"w4Fg2uUGZzb2W9Euo4m0Or","type":"waf"},{"id":"w4Fg2uUGZzb2W9Euo5q2Az","type":"waf"}]}; // array + +try { + $result = $apiInstance->useWafConfigSet($options); +} catch (Exception $e) { + echo 'Exception when calling LegacyWafConfigurationSetsApi->useWafConfigSet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**configuration_set_id** | **string** | Alphanumeric string identifying a WAF configuration set. | +**request_body** | [**array**](../Model/object.md) | | [optional] + +### Return type + +**object** + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) diff --git a/docs/Api/LegacyWafFirewallApi.md b/docs/Api/LegacyWafFirewallApi.md new file mode 100644 index 00000000..e6b189ff --- /dev/null +++ b/docs/Api/LegacyWafFirewallApi.md @@ -0,0 +1,331 @@ +# Fastly\Api\LegacyWafFirewallApi + + +```php +$apiInstance = new Fastly\Api\LegacyWafFirewallApi( + // 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 + +Method | Fastly API endpoint | Description +------------- | ------------- | ------------- +[**createLegacyWafFirewallService()**](LegacyWafFirewallApi.md#createLegacyWafFirewallService) | **POST** /service/{service_id}/version/{version_id}/wafs | Create a firewall +[**disableLegacyWafFirewall()**](LegacyWafFirewallApi.md#disableLegacyWafFirewall) | **PATCH** /wafs/{firewall_id}/disable | Disable a firewall +[**enableLegacyWafFirewall()**](LegacyWafFirewallApi.md#enableLegacyWafFirewall) | **PATCH** /wafs/{firewall_id}/enable | Enable a firewall +[**getLegacyWafFirewall()**](LegacyWafFirewallApi.md#getLegacyWafFirewall) | **GET** /wafs/{firewall_id} | Get a firewall object +[**getLegacyWafFirewallService()**](LegacyWafFirewallApi.md#getLegacyWafFirewallService) | **GET** /service/{service_id}/version/{version_id}/wafs/{firewall_id} | Get a firewall +[**listLegacyWafFirewalls()**](LegacyWafFirewallApi.md#listLegacyWafFirewalls) | **GET** /wafs | List active firewalls +[**listLegacyWafFirewallsService()**](LegacyWafFirewallApi.md#listLegacyWafFirewallsService) | **GET** /service/{service_id}/version/{version_id}/wafs | List firewalls +[**updateLegacyWafFirewallService()**](LegacyWafFirewallApi.md#updateLegacyWafFirewallService) | **PATCH** /service/{service_id}/version/{version_id}/wafs/{firewall_id} | Update a firewall + + +## `createLegacyWafFirewallService()` + +```php +createLegacyWafFirewallService($options): object // Create a firewall +``` + +Create a firewall object for a particular service and version. + +### Example +```php + $options['service_id'] = 'service_id_example'; // string | Alphanumeric string identifying the service. +$options['version_id'] = 56; // int | Integer identifying a service version. +$options['request_body'] = {"data":{"type":"waf","attributes":{"prefetch_condition":"WAF-Condition","response":"WAF_Error"}}}; // array + +try { + $result = $apiInstance->createLegacyWafFirewallService($options); +} catch (Exception $e) { + echo 'Exception when calling LegacyWafFirewallApi->createLegacyWafFirewallService: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**service_id** | **string** | Alphanumeric string identifying the service. | +**version_id** | **int** | Integer identifying a service version. | +**request_body** | [**array**](../Model/object.md) | | [optional] + +### Return type + +**object** + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `disableLegacyWafFirewall()` + +```php +disableLegacyWafFirewall($options): object // Disable a firewall +``` + +Disable a firewall for a particular service and version. This endpoint is intended to be used in an emergency. Disabling a firewall object for a specific service and version replaces your existing WAF ruleset with an empty ruleset. While disabled, your WAF ruleset will not be applied to your origin traffic. This endpoint is only available to users assigned the role of superuser or above. This is an asynchronous action. To check on the completion of this action, use the related link returned in the response to check on the Update Status of the action. + +### Example +```php + $options['firewall_id'] = 'firewall_id_example'; // string | Alphanumeric string identifying a Firewall. +$options['request_body'] = {"data":{"id":"w4Fg2uUGZzb2W9Euo4m0Or","type":"waf"}}; // array + +try { + $result = $apiInstance->disableLegacyWafFirewall($options); +} catch (Exception $e) { + echo 'Exception when calling LegacyWafFirewallApi->disableLegacyWafFirewall: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**firewall_id** | **string** | Alphanumeric string identifying a Firewall. | +**request_body** | [**array**](../Model/object.md) | | [optional] + +### Return type + +**object** + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `enableLegacyWafFirewall()` + +```php +enableLegacyWafFirewall($options): object // Enable a firewall +``` + +Re-enable a firewall object for a particular service and version after it has been disabled. This endpoint is intended to be used in an emergency. When a firewall object is re-enabled, a newly generated WAF ruleset VCL based on the current WAF configuration is used to replace the empty ruleset. This endpoint is only available to users assigned the role of superuser or above. This is an asynchronous action. To check on the completion of this action, use the related link returned in the response to check on the Update Status of the action. + +### Example +```php + $options['firewall_id'] = 'firewall_id_example'; // string | Alphanumeric string identifying a Firewall. +$options['request_body'] = {"data":{"id":"w4Fg2uUGZzb2W9Euo4m0Or","type":"waf"}}; // array + +try { + $result = $apiInstance->enableLegacyWafFirewall($options); +} catch (Exception $e) { + echo 'Exception when calling LegacyWafFirewallApi->enableLegacyWafFirewall: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**firewall_id** | **string** | Alphanumeric string identifying a Firewall. | +**request_body** | [**array**](../Model/object.md) | | [optional] + +### Return type + +**object** + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `getLegacyWafFirewall()` + +```php +getLegacyWafFirewall($options): object // Get a firewall object +``` + +Get a specific firewall object. + +### Example +```php + $options['firewall_id'] = 'firewall_id_example'; // string | Alphanumeric string identifying a Firewall. +$options['include'] = configuration_set; // string | Include relationships. Optional, comma separated values. Permitted values: `configuration_set`, `owasp`, `rules`, `rule_statuses`. + +try { + $result = $apiInstance->getLegacyWafFirewall($options); +} catch (Exception $e) { + echo 'Exception when calling LegacyWafFirewallApi->getLegacyWafFirewall: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**firewall_id** | **string** | Alphanumeric string identifying a Firewall. | +**include** | **string** | Include relationships. Optional, comma separated values. Permitted values: `configuration_set`, `owasp`, `rules`, `rule_statuses`. | [optional] + +### Return type + +**object** + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `getLegacyWafFirewallService()` + +```php +getLegacyWafFirewallService($options): object // Get a firewall +``` + +Get a specific firewall object. + +### Example +```php + $options['service_id'] = 'service_id_example'; // string | Alphanumeric string identifying the service. +$options['version_id'] = 56; // int | Integer identifying a service version. +$options['firewall_id'] = 'firewall_id_example'; // string | Alphanumeric string identifying a Firewall. + +try { + $result = $apiInstance->getLegacyWafFirewallService($options); +} catch (Exception $e) { + echo 'Exception when calling LegacyWafFirewallApi->getLegacyWafFirewallService: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**service_id** | **string** | Alphanumeric string identifying the service. | +**version_id** | **int** | Integer identifying a service version. | +**firewall_id** | **string** | Alphanumeric string identifying a Firewall. | + +### Return type + +**object** + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `listLegacyWafFirewalls()` + +```php +listLegacyWafFirewalls($options): object // List active firewalls +``` + +List all active firewall objects. + +### Example +```php + $options['filter_rules_rule_id'] = 'filter_rules_rule_id_example'; // string | Limit the returned firewalls to a specific rule ID. +$options['page_number'] = 1; // int | Current page. +$options['page_size'] = 20; // int | Number of records per page. +$options['include'] = configuration_set; // string | Include relationships. Optional, comma separated values. Permitted values: `configuration_set`, `owasp`. + +try { + $result = $apiInstance->listLegacyWafFirewalls($options); +} catch (Exception $e) { + echo 'Exception when calling LegacyWafFirewallApi->listLegacyWafFirewalls: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**filter_rules_rule_id** | **string** | Limit the returned firewalls to a specific rule ID. | [optional] +**page_number** | **int** | Current page. | [optional] +**page_size** | **int** | Number of records per page. | [optional] [defaults to 20] +**include** | **string** | Include relationships. Optional, comma separated values. Permitted values: `configuration_set`, `owasp`. | [optional] + +### Return type + +**object** + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `listLegacyWafFirewallsService()` + +```php +listLegacyWafFirewallsService($options): object // List firewalls +``` + +List all firewall objects for a particular service and version. + +### Example +```php + $options['service_id'] = 'service_id_example'; // string | Alphanumeric string identifying the service. +$options['version_id'] = 56; // int | Integer identifying a service version. +$options['page_number'] = 1; // int | Current page. +$options['page_size'] = 20; // int | Number of records per page. +$options['include'] = configuration_set; // string | Include relationships. Optional, comma separated values. Permitted values: `configuration_set`, `owasp`. + +try { + $result = $apiInstance->listLegacyWafFirewallsService($options); +} catch (Exception $e) { + echo 'Exception when calling LegacyWafFirewallApi->listLegacyWafFirewallsService: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**service_id** | **string** | Alphanumeric string identifying the service. | +**version_id** | **int** | Integer identifying a service version. | +**page_number** | **int** | Current page. | [optional] +**page_size** | **int** | Number of records per page. | [optional] [defaults to 20] +**include** | **string** | Include relationships. Optional, comma separated values. Permitted values: `configuration_set`, `owasp`. | [optional] + +### Return type + +**object** + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `updateLegacyWafFirewallService()` + +```php +updateLegacyWafFirewallService($options): object // Update a firewall +``` + +Update a firewall object for a particular service and version. + +### Example +```php + $options['service_id'] = 'service_id_example'; // string | Alphanumeric string identifying the service. +$options['version_id'] = 56; // int | Integer identifying a service version. +$options['firewall_id'] = 'firewall_id_example'; // string | Alphanumeric string identifying a Firewall. +$options['request_body'] = {"data":{"id":"w4Fg2uUGZzb2W9Euo4m0Or","type":"waf","attributes":{"response":"new response"}}}; // array + +try { + $result = $apiInstance->updateLegacyWafFirewallService($options); +} catch (Exception $e) { + echo 'Exception when calling LegacyWafFirewallApi->updateLegacyWafFirewallService: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**service_id** | **string** | Alphanumeric string identifying the service. | +**version_id** | **int** | Integer identifying a service version. | +**firewall_id** | **string** | Alphanumeric string identifying a Firewall. | +**request_body** | [**array**](../Model/object.md) | | [optional] + +### Return type + +**object** + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) diff --git a/docs/Api/LegacyWafOwaspApi.md b/docs/Api/LegacyWafOwaspApi.md new file mode 100644 index 00000000..53a657f7 --- /dev/null +++ b/docs/Api/LegacyWafOwaspApi.md @@ -0,0 +1,132 @@ +# Fastly\Api\LegacyWafOwaspApi + + +```php +$apiInstance = new Fastly\Api\LegacyWafOwaspApi( + // 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 + +Method | Fastly API endpoint | Description +------------- | ------------- | ------------- +[**createOwaspSettings()**](LegacyWafOwaspApi.md#createOwaspSettings) | **POST** /service/{service_id}/wafs/{firewall_id}/owasp | Create an OWASP settings object +[**getOwaspSettings()**](LegacyWafOwaspApi.md#getOwaspSettings) | **GET** /service/{service_id}/wafs/{firewall_id}/owasp | Get the OWASP settings object +[**updateOwaspSettings()**](LegacyWafOwaspApi.md#updateOwaspSettings) | **PATCH** /service/{service_id}/wafs/{firewall_id}/owasp | Update the OWASP settings object + + +## `createOwaspSettings()` + +```php +createOwaspSettings($options): object // Create an OWASP settings object +``` + +Create an OWASP settings object for a particular service and firewall. + +### Example +```php + $options['service_id'] = 'service_id_example'; // string | Alphanumeric string identifying the service. +$options['firewall_id'] = 'firewall_id_example'; // string | Alphanumeric string identifying a Firewall. +$options['request_body'] = {"data":{"type":"owasp"}}; // array + +try { + $result = $apiInstance->createOwaspSettings($options); +} catch (Exception $e) { + echo 'Exception when calling LegacyWafOwaspApi->createOwaspSettings: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**service_id** | **string** | Alphanumeric string identifying the service. | +**firewall_id** | **string** | Alphanumeric string identifying a Firewall. | +**request_body** | [**array**](../Model/object.md) | | [optional] + +### Return type + +**object** + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `getOwaspSettings()` + +```php +getOwaspSettings($options): object // Get the OWASP settings object +``` + +Get the OWASP settings object for a particular service and firewall. + +### Example +```php + $options['service_id'] = 'service_id_example'; // string | Alphanumeric string identifying the service. +$options['firewall_id'] = 'firewall_id_example'; // string | Alphanumeric string identifying a Firewall. + +try { + $result = $apiInstance->getOwaspSettings($options); +} catch (Exception $e) { + echo 'Exception when calling LegacyWafOwaspApi->getOwaspSettings: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**service_id** | **string** | Alphanumeric string identifying the service. | +**firewall_id** | **string** | Alphanumeric string identifying a Firewall. | + +### Return type + +**object** + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `updateOwaspSettings()` + +```php +updateOwaspSettings($options): object // Update the OWASP settings object +``` + +Update the OWASP settings object for a particular service and firewall. + +### Example +```php + $options['service_id'] = 'service_id_example'; // string | Alphanumeric string identifying the service. +$options['firewall_id'] = 'firewall_id_example'; // string | Alphanumeric string identifying a Firewall. +$options['request_body'] = {"data":{"id":"0W4guUGZzb2W9Euo4m0oR","type":"owasp","attributes":{"inbound_anomaly_score_threshold":42}}}; // array + +try { + $result = $apiInstance->updateOwaspSettings($options); +} catch (Exception $e) { + echo 'Exception when calling LegacyWafOwaspApi->updateOwaspSettings: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**service_id** | **string** | Alphanumeric string identifying the service. | +**firewall_id** | **string** | Alphanumeric string identifying a Firewall. | +**request_body** | [**array**](../Model/object.md) | | [optional] + +### Return type + +**object** + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) diff --git a/docs/Api/LegacyWafRuleApi.md b/docs/Api/LegacyWafRuleApi.md new file mode 100644 index 00000000..ee8a242e --- /dev/null +++ b/docs/Api/LegacyWafRuleApi.md @@ -0,0 +1,175 @@ +# Fastly\Api\LegacyWafRuleApi + + +```php +$apiInstance = new Fastly\Api\LegacyWafRuleApi( + // 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 + +Method | Fastly API endpoint | Description +------------- | ------------- | ------------- +[**getLegacyWafFirewallRuleVcl()**](LegacyWafRuleApi.md#getLegacyWafFirewallRuleVcl) | **GET** /wafs/{firewall_id}/rules/{waf_rule_id}/vcl | Get VCL for a rule associated with a firewall +[**getLegacyWafRule()**](LegacyWafRuleApi.md#getLegacyWafRule) | **GET** /wafs/rules/{waf_rule_id} | Get a rule +[**getLegacyWafRuleVcl()**](LegacyWafRuleApi.md#getLegacyWafRuleVcl) | **GET** /wafs/rules/{waf_rule_id}/vcl | Get VCL for a rule +[**listLegacyWafRules()**](LegacyWafRuleApi.md#listLegacyWafRules) | **GET** /wafs/rules | List rules in the latest configuration set + + +## `getLegacyWafFirewallRuleVcl()` + +```php +getLegacyWafFirewallRuleVcl($options): object // Get VCL for a rule associated with a firewall +``` + +Get associated VCL for a specific rule associated with a specific firewall. + +### Example +```php + $options['firewall_id'] = 'firewall_id_example'; // string | Alphanumeric string identifying a Firewall. +$options['waf_rule_id'] = 'waf_rule_id_example'; // string | Alphanumeric string identifying a WAF rule. + +try { + $result = $apiInstance->getLegacyWafFirewallRuleVcl($options); +} catch (Exception $e) { + echo 'Exception when calling LegacyWafRuleApi->getLegacyWafFirewallRuleVcl: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**firewall_id** | **string** | Alphanumeric string identifying a Firewall. | +**waf_rule_id** | **string** | Alphanumeric string identifying a WAF rule. | + +### Return type + +**object** + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `getLegacyWafRule()` + +```php +getLegacyWafRule($options): object // Get a rule +``` + +Get a specific rule. + +### Example +```php + $options['filter_configuration_set_id'] = 'filter_configuration_set_id_example'; // string | Optional. Limit rule to a specific configuration set or pass \"all\" to search all configuration sets, including stale ones. +$options['include'] = tags; // string | Include relationships. Optional. Comma separated values. Permitted values: `tags`, `rule_statuses`, `source`, and `vcl`. +$options['waf_rule_id'] = 'waf_rule_id_example'; // string | Alphanumeric string identifying a WAF rule. + +try { + $result = $apiInstance->getLegacyWafRule($options); +} catch (Exception $e) { + echo 'Exception when calling LegacyWafRuleApi->getLegacyWafRule: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**filter_configuration_set_id** | **string** | Optional. Limit rule to a specific configuration set or pass \"all\" to search all configuration sets, including stale ones. | [optional] +**include** | **string** | Include relationships. Optional. Comma separated values. Permitted values: `tags`, `rule_statuses`, `source`, and `vcl`. | [optional] +**waf_rule_id** | **string** | Alphanumeric string identifying a WAF rule. | + +### Return type + +**object** + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `getLegacyWafRuleVcl()` + +```php +getLegacyWafRuleVcl($options): object // Get VCL for a rule +``` + +Get associated VCL for a specific rule. + +### Example +```php + $options['waf_rule_id'] = 'waf_rule_id_example'; // string | Alphanumeric string identifying a WAF rule. + +try { + $result = $apiInstance->getLegacyWafRuleVcl($options); +} catch (Exception $e) { + echo 'Exception when calling LegacyWafRuleApi->getLegacyWafRuleVcl: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**waf_rule_id** | **string** | Alphanumeric string identifying a WAF rule. | + +### Return type + +**object** + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `listLegacyWafRules()` + +```php +listLegacyWafRules($options): object[] // List rules in the latest configuration set +``` + +List all rules in the latest configuration set. + +### Example +```php + $options['filter_rule_id'] = 'filter_rule_id_example'; // string | Limit the returned rules to a specific rule ID. +$options['filter_severity'] = 'filter_severity_example'; // string | Limit the returned rules to a specific severity. +$options['filter_tags_name'] = 'filter_tags_name_example'; // string | Limit the returned rules to a set linked to a tag by name. +$options['filter_configuration_set_id'] = 'filter_configuration_set_id_example'; // string | Optional. Limit rules to specific configuration set or pass \"all\" to search all configuration sets, including stale ones. +$options['page_number'] = 1; // int | Current page. +$options['page_size'] = 20; // int | Number of records per page. +$options['include'] = 'include_example'; // string | Include relationships. Optional. Comma separated values. Permitted values: `tags`, `rule_statuses`, and `source`. + +try { + $result = $apiInstance->listLegacyWafRules($options); +} catch (Exception $e) { + echo 'Exception when calling LegacyWafRuleApi->listLegacyWafRules: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**filter_rule_id** | **string** | Limit the returned rules to a specific rule ID. | [optional] +**filter_severity** | **string** | Limit the returned rules to a specific severity. | [optional] +**filter_tags_name** | **string** | Limit the returned rules to a set linked to a tag by name. | [optional] +**filter_configuration_set_id** | **string** | Optional. Limit rules to specific configuration set or pass \"all\" to search all configuration sets, including stale ones. | [optional] +**page_number** | **int** | Current page. | [optional] +**page_size** | **int** | Number of records per page. | [optional] [defaults to 20] +**include** | **string** | Include relationships. Optional. Comma separated values. Permitted values: `tags`, `rule_statuses`, and `source`. | [optional] + +### Return type + +**object[]** + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) diff --git a/docs/Api/LegacyWafRuleStatusApi.md b/docs/Api/LegacyWafRuleStatusApi.md new file mode 100644 index 00000000..5a6710d3 --- /dev/null +++ b/docs/Api/LegacyWafRuleStatusApi.md @@ -0,0 +1,193 @@ +# Fastly\Api\LegacyWafRuleStatusApi + + +```php +$apiInstance = new Fastly\Api\LegacyWafRuleStatusApi( + // 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 + +Method | Fastly API endpoint | Description +------------- | ------------- | ------------- +[**getWafFirewallRuleStatus()**](LegacyWafRuleStatusApi.md#getWafFirewallRuleStatus) | **GET** /service/{service_id}/wafs/{firewall_id}/rules/{waf_rule_id}/rule_status | Get the status of a rule on a firewall +[**listWafFirewallRuleStatuses()**](LegacyWafRuleStatusApi.md#listWafFirewallRuleStatuses) | **GET** /service/{service_id}/wafs/{firewall_id}/rule_statuses | List rule statuses +[**updateWafFirewallRuleStatus()**](LegacyWafRuleStatusApi.md#updateWafFirewallRuleStatus) | **PATCH** /service/{service_id}/wafs/{firewall_id}/rules/{waf_rule_id}/rule_status | Update the status of a rule +[**updateWafFirewallRuleStatusesTag()**](LegacyWafRuleStatusApi.md#updateWafFirewallRuleStatusesTag) | **POST** /service/{service_id}/wafs/{firewall_id}/rule_statuses | Create or update status of a tagged group of rules + + +## `getWafFirewallRuleStatus()` + +```php +getWafFirewallRuleStatus($options): object // Get the status of a rule on a firewall +``` + +Get a specific rule status object for a particular service, firewall, and rule. + +### Example +```php + $options['service_id'] = 'service_id_example'; // string | Alphanumeric string identifying the service. +$options['firewall_id'] = 'firewall_id_example'; // string | Alphanumeric string identifying a Firewall. +$options['waf_rule_id'] = 'waf_rule_id_example'; // string | Alphanumeric string identifying a WAF rule. + +try { + $result = $apiInstance->getWafFirewallRuleStatus($options); +} catch (Exception $e) { + echo 'Exception when calling LegacyWafRuleStatusApi->getWafFirewallRuleStatus: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**service_id** | **string** | Alphanumeric string identifying the service. | +**firewall_id** | **string** | Alphanumeric string identifying a Firewall. | +**waf_rule_id** | **string** | Alphanumeric string identifying a WAF rule. | + +### Return type + +**object** + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `listWafFirewallRuleStatuses()` + +```php +listWafFirewallRuleStatuses($options): object // List rule statuses +``` + +List all rule statuses for a particular service and firewall. + +### Example +```php + $options['service_id'] = 'service_id_example'; // string | Alphanumeric string identifying the service. +$options['firewall_id'] = 'firewall_id_example'; // string | Alphanumeric string identifying a Firewall. +$options['filter_status'] = 'filter_status_example'; // string | Limit results to rule statuses with the specified status. +$options['filter_rule_message'] = 'filter_rule_message_example'; // string | Limit results to rule statuses whose rules have the specified message. +$options['filter_rule_rule_id'] = 'filter_rule_rule_id_example'; // string | Limit results to rule statuses whose rules represent the specified ModSecurity rule_id. +$options['filter_rule_tags'] = 'filter_rule_tags_example'; // string | Limit results to rule statuses whose rules relate to the specified tag IDs. +$options['filter_rule_tags_name'] = application-FBC Market; // string | Limit results to rule statuses whose rules related to the named tags. +$options['include'] = 'include_example'; // string | Include relationships. Optional, comma separated values. Permitted values: `tags`. +$options['page_number'] = 1; // int | Current page. +$options['page_size'] = 20; // int | Number of records per page. + +try { + $result = $apiInstance->listWafFirewallRuleStatuses($options); +} catch (Exception $e) { + echo 'Exception when calling LegacyWafRuleStatusApi->listWafFirewallRuleStatuses: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**service_id** | **string** | Alphanumeric string identifying the service. | +**firewall_id** | **string** | Alphanumeric string identifying a Firewall. | +**filter_status** | **string** | Limit results to rule statuses with the specified status. | [optional] +**filter_rule_message** | **string** | Limit results to rule statuses whose rules have the specified message. | [optional] +**filter_rule_rule_id** | **string** | Limit results to rule statuses whose rules represent the specified ModSecurity rule_id. | [optional] +**filter_rule_tags** | **string** | Limit results to rule statuses whose rules relate to the specified tag IDs. | [optional] +**filter_rule_tags_name** | **string** | Limit results to rule statuses whose rules related to the named tags. | [optional] +**include** | **string** | Include relationships. Optional, comma separated values. Permitted values: `tags`. | [optional] +**page_number** | **int** | Current page. | [optional] +**page_size** | **int** | Number of records per page. | [optional] [defaults to 20] + +### Return type + +**object** + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `updateWafFirewallRuleStatus()` + +```php +updateWafFirewallRuleStatus($options): object // Update the status of a rule +``` + +Update a rule status for a particular service, firewall, and rule. + +### Example +```php + $options['service_id'] = 'service_id_example'; // string | Alphanumeric string identifying the service. +$options['firewall_id'] = 'firewall_id_example'; // string | Alphanumeric string identifying a Firewall. +$options['waf_rule_id'] = 'waf_rule_id_example'; // string | Alphanumeric string identifying a WAF rule. +$options['request_body'] = {"data":{"id":"RU1S0isxPaozGVKXdv0eY","type":"rule_status","attributes":{"status":"block"}}}; // array + +try { + $result = $apiInstance->updateWafFirewallRuleStatus($options); +} catch (Exception $e) { + echo 'Exception when calling LegacyWafRuleStatusApi->updateWafFirewallRuleStatus: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**service_id** | **string** | Alphanumeric string identifying the service. | +**firewall_id** | **string** | Alphanumeric string identifying a Firewall. | +**waf_rule_id** | **string** | Alphanumeric string identifying a WAF rule. | +**request_body** | [**array**](../Model/object.md) | | [optional] + +### Return type + +**object** + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `updateWafFirewallRuleStatusesTag()` + +```php +updateWafFirewallRuleStatusesTag($options): object // Create or update status of a tagged group of rules +``` + +Create or update all rule statuses for a particular service and firewall, based on tag name. By default, only rule status for enabled rules (with status log or block) will be updated. To update rule statuses for disabled rules under the specified tag, use the force attribute. + +### Example +```php + $options['service_id'] = 'service_id_example'; // string | Alphanumeric string identifying the service. +$options['firewall_id'] = 'firewall_id_example'; // string | Alphanumeric string identifying a Firewall. +$options['name'] = 'name_example'; // string | The tag name to use to determine the set of rules to update. For example, OWASP or language-php. +$options['force'] = 'force_example'; // string | Whether or not to update rule statuses for disabled rules. Optional. +$options['request_body'] = {"data":{"type":"rule_status","attributes":{"status":"block","name":"application-FBC Market","force":true}}}; // array + +try { + $result = $apiInstance->updateWafFirewallRuleStatusesTag($options); +} catch (Exception $e) { + echo 'Exception when calling LegacyWafRuleStatusApi->updateWafFirewallRuleStatusesTag: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**service_id** | **string** | Alphanumeric string identifying the service. | +**firewall_id** | **string** | Alphanumeric string identifying a Firewall. | +**name** | **string** | The tag name to use to determine the set of rules to update. For example, OWASP or language-php. | [optional] +**force** | **string** | Whether or not to update rule statuses for disabled rules. Optional. | [optional] +**request_body** | [**array**](../Model/object.md) | | [optional] + +### Return type + +**object** + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) diff --git a/docs/Api/LegacyWafRulesetApi.md b/docs/Api/LegacyWafRulesetApi.md new file mode 100644 index 00000000..1a3aae0c --- /dev/null +++ b/docs/Api/LegacyWafRulesetApi.md @@ -0,0 +1,130 @@ +# Fastly\Api\LegacyWafRulesetApi + + +```php +$apiInstance = new Fastly\Api\LegacyWafRulesetApi( + // 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 + +Method | Fastly API endpoint | Description +------------- | ------------- | ------------- +[**getWafRuleset()**](LegacyWafRulesetApi.md#getWafRuleset) | **GET** /service/{service_id}/wafs/{firewall_id}/ruleset | Get a WAF ruleset +[**getWafRulesetVcl()**](LegacyWafRulesetApi.md#getWafRulesetVcl) | **GET** /service/{service_id}/wafs/{firewall_id}/ruleset/preview | Generate WAF ruleset VCL +[**updateWafRuleset()**](LegacyWafRulesetApi.md#updateWafRuleset) | **PATCH** /service/{service_id}/wafs/{firewall_id}/ruleset | Update a WAF ruleset + + +## `getWafRuleset()` + +```php +getWafRuleset($options): object // Get a WAF ruleset +``` + +Get a WAF ruleset for a particular service and firewall object. + +### Example +```php + $options['service_id'] = 'service_id_example'; // string | Alphanumeric string identifying the service. +$options['firewall_id'] = 'firewall_id_example'; // string | Alphanumeric string identifying a Firewall. + +try { + $result = $apiInstance->getWafRuleset($options); +} catch (Exception $e) { + echo 'Exception when calling LegacyWafRulesetApi->getWafRuleset: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**service_id** | **string** | Alphanumeric string identifying the service. | +**firewall_id** | **string** | Alphanumeric string identifying a Firewall. | + +### Return type + +**object** + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `getWafRulesetVcl()` + +```php +getWafRulesetVcl($options): object // Generate WAF ruleset VCL +``` + +Get a preview of the WAF ruleset VCL for a particular service and firewall object based on changes to WAF configuration before deploying the ruleset. The response will include a link to status of the background VCL generation job. Once the background job is completed, the preview WAF ruleset VCL can be retrieved from the status response. + +### Example +```php + $options['service_id'] = 'service_id_example'; // string | Alphanumeric string identifying the service. +$options['firewall_id'] = 'firewall_id_example'; // string | Alphanumeric string identifying a Firewall. + +try { + $result = $apiInstance->getWafRulesetVcl($options); +} catch (Exception $e) { + echo 'Exception when calling LegacyWafRulesetApi->getWafRulesetVcl: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**service_id** | **string** | Alphanumeric string identifying the service. | +**firewall_id** | **string** | Alphanumeric string identifying a Firewall. | + +### Return type + +**object** + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `updateWafRuleset()` + +```php +updateWafRuleset($options): object // Update a WAF ruleset +``` + +Update the WAF ruleset for a particular service and firewall object. Use the URL in the response to view the WAF ruleset deploy status. + +### Example +```php + $options['service_id'] = 'service_id_example'; // string | Alphanumeric string identifying the service. +$options['firewall_id'] = 'firewall_id_example'; // string | Alphanumeric string identifying a Firewall. +$options['request_body'] = {"data":{"id":"r5TguUGZzb2W9EuF4mo0N","type":"ruleset"}}; // array + +try { + $result = $apiInstance->updateWafRuleset($options); +} catch (Exception $e) { + echo 'Exception when calling LegacyWafRulesetApi->updateWafRuleset: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**service_id** | **string** | Alphanumeric string identifying the service. | +**firewall_id** | **string** | Alphanumeric string identifying a Firewall. | +**request_body** | [**array**](../Model/object.md) | | [optional] + +### Return type + +**object** + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) diff --git a/docs/Api/LegacyWafTagApi.md b/docs/Api/LegacyWafTagApi.md new file mode 100644 index 00000000..bc88bd6c --- /dev/null +++ b/docs/Api/LegacyWafTagApi.md @@ -0,0 +1,58 @@ +# Fastly\Api\LegacyWafTagApi + + +```php +$apiInstance = new Fastly\Api\LegacyWafTagApi( + // 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 + +Method | Fastly API endpoint | Description +------------- | ------------- | ------------- +[**listLegacyWafTags()**](LegacyWafTagApi.md#listLegacyWafTags) | **GET** /wafs/tags | List WAF tags + + +## `listLegacyWafTags()` + +```php +listLegacyWafTags($options): object // List WAF tags +``` + +List all tags. + +### Example +```php + $options['filter_name'] = 'filter_name_example'; // string | Limit the returned tags to a specific name. +$options['page_number'] = 1; // int | Current page. +$options['page_size'] = 20; // int | Number of records per page. +$options['include'] = rules; // string | Include relationships. Optional, comma separated values. Permitted values: `rules`. + +try { + $result = $apiInstance->listLegacyWafTags($options); +} catch (Exception $e) { + echo 'Exception when calling LegacyWafTagApi->listLegacyWafTags: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**filter_name** | **string** | Limit the returned tags to a specific name. | [optional] +**page_number** | **int** | Current page. | [optional] +**page_size** | **int** | Number of records per page. | [optional] [defaults to 20] +**include** | **string** | Include relationships. Optional, comma separated values. Permitted values: `rules`. | [optional] + +### Return type + +**object** + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) diff --git a/docs/Api/LegacyWafUpdateStatusApi.md b/docs/Api/LegacyWafUpdateStatusApi.md new file mode 100644 index 00000000..239db364 --- /dev/null +++ b/docs/Api/LegacyWafUpdateStatusApi.md @@ -0,0 +1,99 @@ +# Fastly\Api\LegacyWafUpdateStatusApi + + +```php +$apiInstance = new Fastly\Api\LegacyWafUpdateStatusApi( + // 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 + +Method | Fastly API endpoint | Description +------------- | ------------- | ------------- +[**getWafUpdateStatus()**](LegacyWafUpdateStatusApi.md#getWafUpdateStatus) | **GET** /service/{service_id}/wafs/{firewall_id}/update_statuses/{update_status_id} | Get the status of a WAF update +[**listWafUpdateStatuses()**](LegacyWafUpdateStatusApi.md#listWafUpdateStatuses) | **GET** /service/{service_id}/wafs/{firewall_id}/update_statuses | List update statuses + + +## `getWafUpdateStatus()` + +```php +getWafUpdateStatus($options): object // Get the status of a WAF update +``` + +Get a specific update status object for a particular service and firewall object. + +### Example +```php + $options['service_id'] = 'service_id_example'; // string | Alphanumeric string identifying the service. +$options['firewall_id'] = 'firewall_id_example'; // string | Alphanumeric string identifying a Firewall. +$options['update_status_id'] = 'update_status_id_example'; // string | Alphanumeric string identifying a WAF update status. + +try { + $result = $apiInstance->getWafUpdateStatus($options); +} catch (Exception $e) { + echo 'Exception when calling LegacyWafUpdateStatusApi->getWafUpdateStatus: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**service_id** | **string** | Alphanumeric string identifying the service. | +**firewall_id** | **string** | Alphanumeric string identifying a Firewall. | +**update_status_id** | **string** | Alphanumeric string identifying a WAF update status. | + +### Return type + +**object** + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `listWafUpdateStatuses()` + +```php +listWafUpdateStatuses($options): object // List update statuses +``` + +List all update statuses for a particular service and firewall object. + +### Example +```php + $options['page_number'] = 1; // int | Current page. +$options['page_size'] = 20; // int | Number of records per page. +$options['include'] = waf; // string | Include relationships. Optional, comma separated values. Permitted values: `waf`. +$options['service_id'] = 'service_id_example'; // string | Alphanumeric string identifying the service. +$options['firewall_id'] = 'firewall_id_example'; // string | Alphanumeric string identifying a Firewall. + +try { + $result = $apiInstance->listWafUpdateStatuses($options); +} catch (Exception $e) { + echo 'Exception when calling LegacyWafUpdateStatusApi->listWafUpdateStatuses: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**page_number** | **int** | Current page. | [optional] +**page_size** | **int** | Number of records per page. | [optional] [defaults to 20] +**include** | **string** | Include relationships. Optional, comma separated values. Permitted values: `waf`. | [optional] +**service_id** | **string** | Alphanumeric string identifying the service. | +**firewall_id** | **string** | Alphanumeric string identifying a Firewall. | + +### Return type + +**object** + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) diff --git a/docs/Api/LoggingKafkaApi.md b/docs/Api/LoggingKafkaApi.md index 6c5f4434..c573adf5 100644 --- a/docs/Api/LoggingKafkaApi.md +++ b/docs/Api/LoggingKafkaApi.md @@ -18,6 +18,7 @@ Method | Fastly API endpoint | Description [**deleteLogKafka()**](LoggingKafkaApi.md#deleteLogKafka) | **DELETE** /service/{service_id}/version/{version_id}/logging/kafka/{logging_kafka_name} | Delete the Kafka log endpoint [**getLogKafka()**](LoggingKafkaApi.md#getLogKafka) | **GET** /service/{service_id}/version/{version_id}/logging/kafka/{logging_kafka_name} | Get a Kafka log endpoint [**listLogKafka()**](LoggingKafkaApi.md#listLogKafka) | **GET** /service/{service_id}/version/{version_id}/logging/kafka | List Kafka log endpoints +[**updateLogKafka()**](LoggingKafkaApi.md#updateLogKafka) | **PUT** /service/{service_id}/version/{version_id}/logging/kafka/{logging_kafka_name} | Update the Kafka log endpoint ## `createLogKafka()` @@ -205,3 +206,41 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) + +## `updateLogKafka()` + +```php +updateLogKafka($options): \Fastly\Model\LoggingKafkaResponse // Update the Kafka log endpoint +``` + +Update the Kafka logging endpoint for a particular service and version. + +### Example +```php + $options['service_id'] = 'service_id_example'; // string | Alphanumeric string identifying the service. +$options['version_id'] = 56; // int | Integer identifying a service version. +$options['logging_kafka_name'] = 'logging_kafka_name_example'; // string | The name for the real-time logging configuration. + +try { + $result = $apiInstance->updateLogKafka($options); +} catch (Exception $e) { + echo 'Exception when calling LoggingKafkaApi->updateLogKafka: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**service_id** | **string** | Alphanumeric string identifying the service. | +**version_id** | **int** | Integer identifying a service version. | +**logging_kafka_name** | **string** | The name for the real-time logging configuration. | + +### Return type + +[**\Fastly\Model\LoggingKafkaResponse**](../Model/LoggingKafkaResponse.md) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) diff --git a/docs/Api/LoggingKinesisApi.md b/docs/Api/LoggingKinesisApi.md index ef8fa5fe..a1d767e1 100644 --- a/docs/Api/LoggingKinesisApi.md +++ b/docs/Api/LoggingKinesisApi.md @@ -18,6 +18,7 @@ Method | Fastly API endpoint | Description [**deleteLogKinesis()**](LoggingKinesisApi.md#deleteLogKinesis) | **DELETE** /service/{service_id}/version/{version_id}/logging/kinesis/{logging_kinesis_name} | Delete the Amazon Kinesis log endpoint [**getLogKinesis()**](LoggingKinesisApi.md#getLogKinesis) | **GET** /service/{service_id}/version/{version_id}/logging/kinesis/{logging_kinesis_name} | Get an Amazon Kinesis log endpoint [**listLogKinesis()**](LoggingKinesisApi.md#listLogKinesis) | **GET** /service/{service_id}/version/{version_id}/logging/kinesis | List Amazon Kinesis log endpoints +[**updateLogKinesis()**](LoggingKinesisApi.md#updateLogKinesis) | **PUT** /service/{service_id}/version/{version_id}/logging/kinesis/{logging_kinesis_name} | Update the Amazon Kinesis log endpoint ## `createLogKinesis()` @@ -185,3 +186,41 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) + +## `updateLogKinesis()` + +```php +updateLogKinesis($options): \Fastly\Model\LoggingKinesisResponse // Update the Amazon Kinesis log endpoint +``` + +Update an Amazon Kinesis Data Streams logging object for a particular service and version. + +### Example +```php + $options['service_id'] = 'service_id_example'; // string | Alphanumeric string identifying the service. +$options['version_id'] = 56; // int | Integer identifying a service version. +$options['logging_kinesis_name'] = 'logging_kinesis_name_example'; // string | The name for the real-time logging configuration. + +try { + $result = $apiInstance->updateLogKinesis($options); +} catch (Exception $e) { + echo 'Exception when calling LoggingKinesisApi->updateLogKinesis: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**service_id** | **string** | Alphanumeric string identifying the service. | +**version_id** | **int** | Integer identifying a service version. | +**logging_kinesis_name** | **string** | The name for the real-time logging configuration. | + +### Return type + +[**\Fastly\Model\LoggingKinesisResponse**](../Model/LoggingKinesisResponse.md) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) diff --git a/docs/Api/OriginInspectorHistoricalApi.md b/docs/Api/OriginInspectorHistoricalApi.md new file mode 100644 index 00000000..9c018ddb --- /dev/null +++ b/docs/Api/OriginInspectorHistoricalApi.md @@ -0,0 +1,72 @@ +# Fastly\Api\OriginInspectorHistoricalApi + + +```php +$apiInstance = new Fastly\Api\OriginInspectorHistoricalApi( + // 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 + +Method | Fastly API endpoint | Description +------------- | ------------- | ------------- +[**getOriginInspectorHistorical()**](OriginInspectorHistoricalApi.md#getOriginInspectorHistorical) | **GET** /metrics/origins/services/{service_id} | Get historical origin data for a service + + +## `getOriginInspectorHistorical()` + +```php +getOriginInspectorHistorical($options): \Fastly\Model\HistoricalOriginsResponse // Get historical origin data for a service +``` + +Fetches historical origin metrics for a given Fastly service, optionally filtering and grouping the results by origin host, region, or POP. + +### Example +```php + $options['service_id'] = 'service_id_example'; // string | Alphanumeric string identifying the service. +$options['start'] = 2021-08-01T00:00:00.000Z; // string | A valid ISO-8601-formatted date and time, or UNIX timestamp, indicating the inclusive start of the query time range. If not provided, a default is chosen based on the provided `downsample` value. +$options['end'] = 2020-08-02T00:00:00.000Z; // string | A valid ISO-8601-formatted date and time, or UNIX timestamp, indicating the exclusive end of the query time range. If not provided, a default is chosen based on the provided `downsample` value. +$options['downsample'] = hour; // string | Duration of sample windows. +$options['metric'] = resp_body_bytes,status_2xx; // string | The metric to retrieve. Up to ten comma-separated metrics are accepted. +$options['group_by'] = host; // string | Dimensions to return in the query. Multiple dimensions may be separated by commas. For example, `group_by=host` will return one timeseries for every origin host, as a total across all POPs. +$options['limit'] = '100'; // string | Number of results per page. The maximum is 200. +$options['cursor'] = 'cursor_example'; // string | Cursor value from a previous response to retrieve the next page. To request the first page, this should be empty. +$options['region'] = usa; // string | Limit query to one or more specific geographic regions. Values should be comma-separated. +$options['datacenter'] = SJC,STP; // string | Limit query to one or more specific POPs. Values should be comma-separated. +$options['host'] = origin_1,origin_2; // string | Limit query to one or more specific origin hosts. Values should be comma-separated. + +try { + $result = $apiInstance->getOriginInspectorHistorical($options); +} catch (Exception $e) { + echo 'Exception when calling OriginInspectorHistoricalApi->getOriginInspectorHistorical: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**service_id** | **string** | Alphanumeric string identifying the service. | +**start** | **string** | A valid ISO-8601-formatted date and time, or UNIX timestamp, indicating the inclusive start of the query time range. If not provided, a default is chosen based on the provided `downsample` value. | [optional] +**end** | **string** | A valid ISO-8601-formatted date and time, or UNIX timestamp, indicating the exclusive end of the query time range. If not provided, a default is chosen based on the provided `downsample` value. | [optional] +**downsample** | **string** | Duration of sample windows. | [optional] [one of: 'hour', 'minute', 'day'] [defaults to 'hour'] +**metric** | **string** | The metric to retrieve. Up to ten comma-separated metrics are accepted. | [optional] [defaults to 'responses'] +**group_by** | **string** | Dimensions to return in the query. Multiple dimensions may be separated by commas. For example, `group_by=host` will return one timeseries for every origin host, as a total across all POPs. | [optional] [one of: 'host', 'datacenter', 'region', 'none'] +**limit** | **string** | Number of results per page. The maximum is 200. | [optional] [defaults to '100'] +**cursor** | **string** | Cursor value from a previous response to retrieve the next page. To request the first page, this should be empty. | [optional] +**region** | **string** | Limit query to one or more specific geographic regions. Values should be comma-separated. | [optional] [one of: 'usa', 'europe', 'asia', 'asia_india', 'asia_southkorea', 'africa_std', 'southamerica_std'] +**datacenter** | **string** | Limit query to one or more specific POPs. Values should be comma-separated. | [optional] +**host** | **string** | Limit query to one or more specific origin hosts. Values should be comma-separated. | [optional] + +### Return type + +[**\Fastly\Model\HistoricalOriginsResponse**](../Model/HistoricalOriginsResponse.md) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) diff --git a/docs/Api/OriginInspectorRealtimeApi.md b/docs/Api/OriginInspectorRealtimeApi.md new file mode 100644 index 00000000..6f9c9224 --- /dev/null +++ b/docs/Api/OriginInspectorRealtimeApi.md @@ -0,0 +1,126 @@ +# Fastly\Api\OriginInspectorRealtimeApi + + +```php +$apiInstance = new Fastly\Api\OriginInspectorRealtimeApi( + // 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 + +Method | Fastly API endpoint | Description +------------- | ------------- | ------------- +[**getOriginInspectorLast120Seconds()**](OriginInspectorRealtimeApi.md#getOriginInspectorLast120Seconds) | **GET** /v1/origins/{service_id}/ts/h | Get real-time origin data for the last 120 seconds +[**getOriginInspectorLastMaxEntries()**](OriginInspectorRealtimeApi.md#getOriginInspectorLastMaxEntries) | **GET** /v1/origins/{service_id}/ts/h/limit/{max_entries} | Get a limited number of real-time origin data entries +[**getOriginInspectorLastSecond()**](OriginInspectorRealtimeApi.md#getOriginInspectorLastSecond) | **GET** /v1/origins/{service_id}/ts/{start_timestamp} | Get real-time origin data from specific time. + + +## `getOriginInspectorLast120Seconds()` + +```php +getOriginInspectorLast120Seconds($options): \Fastly\Model\OriginInspector // Get real-time origin data for the last 120 seconds +``` + +Get data for the 120 seconds preceding the latest timestamp available for a service. + +### Example +```php + $options['service_id'] = 'service_id_example'; // string | Alphanumeric string identifying the service. + +try { + $result = $apiInstance->getOriginInspectorLast120Seconds($options); +} catch (Exception $e) { + echo 'Exception when calling OriginInspectorRealtimeApi->getOriginInspectorLast120Seconds: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**service_id** | **string** | Alphanumeric string identifying the service. | + +### Return type + +[**\Fastly\Model\OriginInspector**](../Model/OriginInspector.md) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `getOriginInspectorLastMaxEntries()` + +```php +getOriginInspectorLastMaxEntries($options): \Fastly\Model\OriginInspector // Get a limited number of real-time origin data entries +``` + +Get data for the `max_entries` seconds preceding the latest timestamp available for a service, up to a maximum of 120 entries. + +### Example +```php + $options['service_id'] = 'service_id_example'; // string | Alphanumeric string identifying the service. +$options['max_entries'] = 1; // int | Maximum number of results to display. + +try { + $result = $apiInstance->getOriginInspectorLastMaxEntries($options); +} catch (Exception $e) { + echo 'Exception when calling OriginInspectorRealtimeApi->getOriginInspectorLastMaxEntries: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**service_id** | **string** | Alphanumeric string identifying the service. | +**max_entries** | **int** | Maximum number of results to display. | + +### Return type + +[**\Fastly\Model\OriginInspector**](../Model/OriginInspector.md) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `getOriginInspectorLastSecond()` + +```php +getOriginInspectorLastSecond($options): \Fastly\Model\OriginInspector // Get real-time origin data from specific time. +``` + +Get real-time origin data for the specified reporting period. Specify `0` to get a single entry for the last complete second. The `Timestamp` field included in the response provides the time index of the latest entry in the dataset and can be provided as the `start_timestamp` of the next request for a seamless continuation of the dataset from one request to the next. Due to processing latency, the earliest entry in the response dataset may be earlier than `start_timestamp` by the value of `AggregateDelay`. + +### Example +```php + $options['service_id'] = 'service_id_example'; // string | Alphanumeric string identifying the service. +$options['start_timestamp'] = 56; // int | Timestamp in seconds (Unix epoch time). + +try { + $result = $apiInstance->getOriginInspectorLastSecond($options); +} catch (Exception $e) { + echo 'Exception when calling OriginInspectorRealtimeApi->getOriginInspectorLastSecond: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**service_id** | **string** | Alphanumeric string identifying the service. | +**start_timestamp** | **int** | Timestamp in seconds (Unix epoch time). | + +### Return type + +[**\Fastly\Model\OriginInspector**](../Model/OriginInspector.md) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) diff --git a/docs/Api/RequestSettingsApi.md b/docs/Api/RequestSettingsApi.md index 2c5f2428..d33228d0 100644 --- a/docs/Api/RequestSettingsApi.md +++ b/docs/Api/RequestSettingsApi.md @@ -14,12 +14,49 @@ $apiInstance = new Fastly\Api\RequestSettingsApi( Method | Fastly API endpoint | Description ------------- | ------------- | ------------- +[**createRequestSettings()**](RequestSettingsApi.md#createRequestSettings) | **POST** /service/{service_id}/version/{version_id}/request_settings | Create a Request Settings object [**deleteRequestSettings()**](RequestSettingsApi.md#deleteRequestSettings) | **DELETE** /service/{service_id}/version/{version_id}/request_settings/{request_settings_name} | Delete a Request Settings object [**getRequestSettings()**](RequestSettingsApi.md#getRequestSettings) | **GET** /service/{service_id}/version/{version_id}/request_settings/{request_settings_name} | Get a Request Settings object [**listRequestSettings()**](RequestSettingsApi.md#listRequestSettings) | **GET** /service/{service_id}/version/{version_id}/request_settings | List Request Settings objects [**updateRequestSettings()**](RequestSettingsApi.md#updateRequestSettings) | **PUT** /service/{service_id}/version/{version_id}/request_settings/{request_settings_name} | Update a Request Settings object +## `createRequestSettings()` + +```php +createRequestSettings($options): \Fastly\Model\RequestSettingsResponse // Create a Request Settings object +``` + +Creates a new Request Settings object. + +### Example +```php + $options['service_id'] = 'service_id_example'; // string | Alphanumeric string identifying the service. +$options['version_id'] = 56; // int | Integer identifying a service version. + +try { + $result = $apiInstance->createRequestSettings($options); +} catch (Exception $e) { + echo 'Exception when calling RequestSettingsApi->createRequestSettings: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**service_id** | **string** | Alphanumeric string identifying the service. | +**version_id** | **int** | Integer identifying a service version. | + +### Return type + +[**\Fastly\Model\RequestSettingsResponse**](../Model/RequestSettingsResponse.md) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + ## `deleteRequestSettings()` ```php diff --git a/docs/Api/ResponseObjectApi.md b/docs/Api/ResponseObjectApi.md index 98aafb0c..3c54fd1c 100644 --- a/docs/Api/ResponseObjectApi.md +++ b/docs/Api/ResponseObjectApi.md @@ -14,11 +14,49 @@ $apiInstance = new Fastly\Api\ResponseObjectApi( Method | Fastly API endpoint | Description ------------- | ------------- | ------------- +[**createResponseObject()**](ResponseObjectApi.md#createResponseObject) | **POST** /service/{service_id}/version/{version_id}/response_object | Create a Response object [**deleteResponseObject()**](ResponseObjectApi.md#deleteResponseObject) | **DELETE** /service/{service_id}/version/{version_id}/response_object/{response_object_name} | Delete a Response Object [**getResponseObject()**](ResponseObjectApi.md#getResponseObject) | **GET** /service/{service_id}/version/{version_id}/response_object/{response_object_name} | Get a Response object [**listResponseObjects()**](ResponseObjectApi.md#listResponseObjects) | **GET** /service/{service_id}/version/{version_id}/response_object | List Response objects +[**updateResponseObject()**](ResponseObjectApi.md#updateResponseObject) | **PUT** /service/{service_id}/version/{version_id}/response_object/{response_object_name} | Update a Response object +## `createResponseObject()` + +```php +createResponseObject($options): \Fastly\Model\ResponseObjectResponse // Create a Response object +``` + +Creates a new Response Object. + +### Example +```php + $options['service_id'] = 'service_id_example'; // string | Alphanumeric string identifying the service. +$options['version_id'] = 56; // int | Integer identifying a service version. + +try { + $result = $apiInstance->createResponseObject($options); +} catch (Exception $e) { + echo 'Exception when calling ResponseObjectApi->createResponseObject: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**service_id** | **string** | Alphanumeric string identifying the service. | +**version_id** | **int** | Integer identifying a service version. | + +### Return type + +[**\Fastly\Model\ResponseObjectResponse**](../Model/ResponseObjectResponse.md) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + ## `deleteResponseObject()` ```php @@ -130,3 +168,41 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) + +## `updateResponseObject()` + +```php +updateResponseObject($options): \Fastly\Model\ResponseObjectResponse // Update a Response object +``` + +Updates the specified Response Object. + +### Example +```php + $options['service_id'] = 'service_id_example'; // string | Alphanumeric string identifying the service. +$options['version_id'] = 56; // int | Integer identifying a service version. +$options['response_object_name'] = 'response_object_name_example'; // string | Name for the request settings. + +try { + $result = $apiInstance->updateResponseObject($options); +} catch (Exception $e) { + echo 'Exception when calling ResponseObjectApi->updateResponseObject: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**service_id** | **string** | Alphanumeric string identifying the service. | +**version_id** | **int** | Integer identifying a service version. | +**response_object_name** | **string** | Name for the request settings. | + +### Return type + +[**\Fastly\Model\ResponseObjectResponse**](../Model/ResponseObjectResponse.md) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) diff --git a/docs/Api/SecretStoreApi.md b/docs/Api/SecretStoreApi.md new file mode 100644 index 00000000..7afc4791 --- /dev/null +++ b/docs/Api/SecretStoreApi.md @@ -0,0 +1,223 @@ +# Fastly\Api\SecretStoreApi + + +```php +$apiInstance = new Fastly\Api\SecretStoreApi( + // 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 + +Method | Fastly API endpoint | Description +------------- | ------------- | ------------- +[**clientKey()**](SecretStoreApi.md#clientKey) | **POST** /resources/stores/secret/client-key | Create new client key +[**createSecretStore()**](SecretStoreApi.md#createSecretStore) | **POST** /resources/stores/secret | Create new secret store +[**deleteSecretStore()**](SecretStoreApi.md#deleteSecretStore) | **DELETE** /resources/stores/secret/{store_id} | Delete secret store +[**getSecretStore()**](SecretStoreApi.md#getSecretStore) | **GET** /resources/stores/secret/{store_id} | Create secret store by ID +[**getSecretStores()**](SecretStoreApi.md#getSecretStores) | **GET** /resources/stores/secret | Get all secret stores +[**signingKey()**](SecretStoreApi.md#signingKey) | **GET** /resources/stores/secret/signing-key | Get public key + + +## `clientKey()` + +```php +clientKey($options): \Fastly\Model\ClientKey // Create new client key +``` + +Create a new client key for encrypting secrets locally before uploading. + +### Example +```php + +try { + $result = $apiInstance->clientKey($options); +} catch (Exception $e) { + echo 'Exception when calling SecretStoreApi->clientKey: ', $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\ClientKey**](../Model/ClientKey.md) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `createSecretStore()` + +```php +createSecretStore($options): \Fastly\Model\SecretStoreResponse // Create new secret store +``` + +Create a new secret store. + +### Example +```php + $options['secret_store'] = new \Fastly\Model\SecretStore(); // \Fastly\Model\SecretStore + +try { + $result = $apiInstance->createSecretStore($options); +} catch (Exception $e) { + echo 'Exception when calling SecretStoreApi->createSecretStore: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**secret_store** | [**\Fastly\Model\SecretStore**](../Model/SecretStore.md) | | [optional] + +### Return type + +[**\Fastly\Model\SecretStoreResponse**](../Model/SecretStoreResponse.md) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `deleteSecretStore()` + +```php +deleteSecretStore($options) // Delete secret store +``` + +Delete a secret store and all of its contents. + +### Example +```php + $options['store_id'] = 'store_id_example'; // string + +try { + $apiInstance->deleteSecretStore($options); +} catch (Exception $e) { + echo 'Exception when calling SecretStoreApi->deleteSecretStore: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**store_id** | **string** | | + +### Return type + +void (empty response body) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `getSecretStore()` + +```php +getSecretStore($options): \Fastly\Model\SecretStoreResponse // Create secret store by ID +``` + +Get a secret store by ID. + +### Example +```php + $options['store_id'] = 'store_id_example'; // string + +try { + $result = $apiInstance->getSecretStore($options); +} catch (Exception $e) { + echo 'Exception when calling SecretStoreApi->getSecretStore: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**store_id** | **string** | | + +### Return type + +[**\Fastly\Model\SecretStoreResponse**](../Model/SecretStoreResponse.md) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `getSecretStores()` + +```php +getSecretStores($options): \Fastly\Model\InlineResponse2005 // Get all secret stores +``` + +Get all secret stores. + +### Example +```php + $options['cursor'] = 'cursor_example'; // string | Cursor value from a previous response to retrieve the next page. To request the first page, this should be empty. +$options['limit'] = '100'; // string | Number of results per page. The maximum is 200. + +try { + $result = $apiInstance->getSecretStores($options); +} catch (Exception $e) { + echo 'Exception when calling SecretStoreApi->getSecretStores: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**cursor** | **string** | Cursor value from a previous response to retrieve the next page. To request the first page, this should be empty. | [optional] +**limit** | **string** | Number of results per page. The maximum is 200. | [optional] [defaults to '100'] + +### Return type + +[**\Fastly\Model\InlineResponse2005**](../Model/InlineResponse2005.md) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `signingKey()` + +```php +signingKey($options): \Fastly\Model\SigningKey // Get public key +``` + +Get the public key used for signing client keys. + +### Example +```php + +try { + $result = $apiInstance->signingKey($options); +} catch (Exception $e) { + echo 'Exception when calling SecretStoreApi->signingKey: ', $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\SigningKey**](../Model/SigningKey.md) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) diff --git a/docs/Api/SecretStoreItemApi.md b/docs/Api/SecretStoreItemApi.md new file mode 100644 index 00000000..18e7c537 --- /dev/null +++ b/docs/Api/SecretStoreItemApi.md @@ -0,0 +1,241 @@ +# Fastly\Api\SecretStoreItemApi + + +```php +$apiInstance = new Fastly\Api\SecretStoreItemApi( + // 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 + +Method | Fastly API endpoint | Description +------------- | ------------- | ------------- +[**createSecret()**](SecretStoreItemApi.md#createSecret) | **POST** /resources/stores/secret/{store_id}/secrets | Create a new secret in a store. +[**deleteSecret()**](SecretStoreItemApi.md#deleteSecret) | **DELETE** /resources/stores/secret/{store_id}/secrets/{secret_name} | Delete a secret from a store. +[**getSecret()**](SecretStoreItemApi.md#getSecret) | **GET** /resources/stores/secret/{store_id}/secrets/{secret_name} | Get secret metadata. +[**getSecrets()**](SecretStoreItemApi.md#getSecrets) | **GET** /resources/stores/secret/{store_id}/secrets | List secrets within a store. +[**mustRecreateSecret()**](SecretStoreItemApi.md#mustRecreateSecret) | **PATCH** /resources/stores/secret/{store_id}/secrets | Recreate a secret in a store. +[**recreateSecret()**](SecretStoreItemApi.md#recreateSecret) | **PUT** /resources/stores/secret/{store_id}/secrets | Create or recreate a secret in a store. + + +## `createSecret()` + +```php +createSecret($options): \Fastly\Model\SecretResponse // Create a new secret in a store. +``` + +Create a new secret in a store. Returns an error if a secret already exists with the same name. See `PUT` and `PATCH` methods for ways to recreate an existing secret. The `secret` field must be Base64-encoded because a secret can contain binary data. In the example below, the unencoded secret is \"Hello, world!\" + +### Example +```php + $options['store_id'] = 'store_id_example'; // string +$options['secret'] = new \Fastly\Model\Secret(); // \Fastly\Model\Secret + +try { + $result = $apiInstance->createSecret($options); +} catch (Exception $e) { + echo 'Exception when calling SecretStoreItemApi->createSecret: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**store_id** | **string** | | +**secret** | [**\Fastly\Model\Secret**](../Model/Secret.md) | | [optional] + +### Return type + +[**\Fastly\Model\SecretResponse**](../Model/SecretResponse.md) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `deleteSecret()` + +```php +deleteSecret($options) // Delete a secret from a store. +``` + +Delete a secret from a store by name. + +### Example +```php + $options['store_id'] = 'store_id_example'; // string +$options['secret_name'] = 'secret_name_example'; // string + +try { + $apiInstance->deleteSecret($options); +} catch (Exception $e) { + echo 'Exception when calling SecretStoreItemApi->deleteSecret: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**store_id** | **string** | | +**secret_name** | **string** | | + +### Return type + +void (empty response body) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `getSecret()` + +```php +getSecret($options): \Fastly\Model\SecretResponse // Get secret metadata. +``` + +Get metadata about a secret by name. + +### Example +```php + $options['store_id'] = 'store_id_example'; // string +$options['secret_name'] = 'secret_name_example'; // string + +try { + $result = $apiInstance->getSecret($options); +} catch (Exception $e) { + echo 'Exception when calling SecretStoreItemApi->getSecret: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**store_id** | **string** | | +**secret_name** | **string** | | + +### Return type + +[**\Fastly\Model\SecretResponse**](../Model/SecretResponse.md) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `getSecrets()` + +```php +getSecrets($options): \Fastly\Model\InlineResponse2006 // List secrets within a store. +``` + +List all secrets within a store. + +### Example +```php + $options['store_id'] = 'store_id_example'; // string +$options['cursor'] = 'cursor_example'; // string | Cursor value from a previous response to retrieve the next page. To request the first page, this should be empty. +$options['limit'] = '100'; // string | Number of results per page. The maximum is 200. + +try { + $result = $apiInstance->getSecrets($options); +} catch (Exception $e) { + echo 'Exception when calling SecretStoreItemApi->getSecrets: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**store_id** | **string** | | +**cursor** | **string** | Cursor value from a previous response to retrieve the next page. To request the first page, this should be empty. | [optional] +**limit** | **string** | Number of results per page. The maximum is 200. | [optional] [defaults to '100'] + +### Return type + +[**\Fastly\Model\InlineResponse2006**](../Model/InlineResponse2006.md) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `mustRecreateSecret()` + +```php +mustRecreateSecret($options): \Fastly\Model\SecretResponse // Recreate a secret in a store. +``` + +Recreate a secret based on the secret's name. Returns an error if there is no existing secret with the same name. The `secret` field must be Base64-encoded because a secret can contain binary data. In the example below, the unencoded secret is \"Hello, world!\" + +### Example +```php + $options['store_id'] = 'store_id_example'; // string +$options['secret'] = new \Fastly\Model\Secret(); // \Fastly\Model\Secret + +try { + $result = $apiInstance->mustRecreateSecret($options); +} catch (Exception $e) { + echo 'Exception when calling SecretStoreItemApi->mustRecreateSecret: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**store_id** | **string** | | +**secret** | [**\Fastly\Model\Secret**](../Model/Secret.md) | | [optional] + +### Return type + +[**\Fastly\Model\SecretResponse**](../Model/SecretResponse.md) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `recreateSecret()` + +```php +recreateSecret($options): \Fastly\Model\SecretResponse // Create or recreate a secret in a store. +``` + +Create or recreate a secret based on the secret's name. The response object's `recreated` field will be true if the secret was recreated. The `secret` field must be Base64-encoded because a secret can contain binary data. In the example below, the unencoded secret is \"Hello, world!\" + +### Example +```php + $options['store_id'] = 'store_id_example'; // string +$options['secret'] = new \Fastly\Model\Secret(); // \Fastly\Model\Secret + +try { + $result = $apiInstance->recreateSecret($options); +} catch (Exception $e) { + echo 'Exception when calling SecretStoreItemApi->recreateSecret: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**store_id** | **string** | | +**secret** | [**\Fastly\Model\Secret**](../Model/Secret.md) | | [optional] + +### Return type + +[**\Fastly\Model\SecretResponse**](../Model/SecretResponse.md) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) diff --git a/docs/Api/ServiceAuthorizationsApi.md b/docs/Api/ServiceAuthorizationsApi.md index 2c2415de..5d26715b 100644 --- a/docs/Api/ServiceAuthorizationsApi.md +++ b/docs/Api/ServiceAuthorizationsApi.md @@ -16,9 +16,11 @@ Method | Fastly API endpoint | Description ------------- | ------------- | ------------- [**createServiceAuthorization()**](ServiceAuthorizationsApi.md#createServiceAuthorization) | **POST** /service-authorizations | Create service authorization [**deleteServiceAuthorization()**](ServiceAuthorizationsApi.md#deleteServiceAuthorization) | **DELETE** /service-authorizations/{service_authorization_id} | Delete service authorization +[**deleteServiceAuthorization2()**](ServiceAuthorizationsApi.md#deleteServiceAuthorization2) | **DELETE** /service-authorizations | Delete service authorizations [**listServiceAuthorization()**](ServiceAuthorizationsApi.md#listServiceAuthorization) | **GET** /service-authorizations | List service authorizations [**showServiceAuthorization()**](ServiceAuthorizationsApi.md#showServiceAuthorization) | **GET** /service-authorizations/{service_authorization_id} | Show service authorization [**updateServiceAuthorization()**](ServiceAuthorizationsApi.md#updateServiceAuthorization) | **PATCH** /service-authorizations/{service_authorization_id} | Update service authorization +[**updateServiceAuthorization2()**](ServiceAuthorizationsApi.md#updateServiceAuthorization2) | **PATCH** /service-authorizations | Update service authorizations ## `createServiceAuthorization()` @@ -89,6 +91,40 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) +## `deleteServiceAuthorization2()` + +```php +deleteServiceAuthorization2($options): \Fastly\Model\InlineResponse2007 // Delete service authorizations +``` + +Delete service authorizations. + +### Example +```php + $options['request_body'] = {"data":[{"id":"3krg2uUGZzb2W9Euo4moOY","type":"service_authorization"},{"id":"71ZA6hv2FO6tGEQIE203Xj","type":"service_authorization"}]}; // array + +try { + $result = $apiInstance->deleteServiceAuthorization2($options); +} catch (Exception $e) { + echo 'Exception when calling ServiceAuthorizationsApi->deleteServiceAuthorization2: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**request_body** | [**array**](../Model/object.md) | | [optional] + +### Return type + +[**\Fastly\Model\InlineResponse2007**](../Model/InlineResponse2007.md) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + ## `listServiceAuthorization()` ```php @@ -194,3 +230,37 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) + +## `updateServiceAuthorization2()` + +```php +updateServiceAuthorization2($options): \Fastly\Model\ServiceAuthorizationsResponse // Update service authorizations +``` + +Update service authorizations. + +### Example +```php + $options['request_body'] = {"data":[{"id":"3krg2uUGZzb2W9Euo4moOY","type":"service_authorization","attributes":{"permission":"read_only"}},{"id":"71ZA6hv2FO6tGEQIE203Xj","type":"service_authorization","attributes":{"permission":"purge_all"}}]}; // array + +try { + $result = $apiInstance->updateServiceAuthorization2($options); +} catch (Exception $e) { + echo 'Exception when calling ServiceAuthorizationsApi->updateServiceAuthorization2: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**request_body** | [**array**](../Model/object.md) | | [optional] + +### Return type + +[**\Fastly\Model\ServiceAuthorizationsResponse**](../Model/ServiceAuthorizationsResponse.md) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) diff --git a/docs/Api/SnippetApi.md b/docs/Api/SnippetApi.md index 8274a0ed..e7e6bd6a 100644 --- a/docs/Api/SnippetApi.md +++ b/docs/Api/SnippetApi.md @@ -19,6 +19,7 @@ Method | Fastly API endpoint | Description [**getSnippet()**](SnippetApi.md#getSnippet) | **GET** /service/{service_id}/version/{version_id}/snippet/{snippet_name} | Get a versioned snippet [**getSnippetDynamic()**](SnippetApi.md#getSnippetDynamic) | **GET** /service/{service_id}/snippet/{snippet_id} | Get a dynamic snippet [**listSnippets()**](SnippetApi.md#listSnippets) | **GET** /service/{service_id}/version/{version_id}/snippet | List snippets +[**updateSnippet()**](SnippetApi.md#updateSnippet) | **PUT** /service/{service_id}/version/{version_id}/snippet/{snippet_name} | Update a versioned snippet [**updateSnippetDynamic()**](SnippetApi.md#updateSnippetDynamic) | **PUT** /service/{service_id}/snippet/{snippet_id} | Update a dynamic snippet @@ -216,6 +217,44 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) +## `updateSnippet()` + +```php +updateSnippet($options): \Fastly\Model\SnippetResponse // Update a versioned snippet +``` + +Update a specific snippet for a particular service and version. + +### Example +```php + $options['service_id'] = 'service_id_example'; // string | Alphanumeric string identifying the service. +$options['version_id'] = 56; // int | Integer identifying a service version. +$options['snippet_name'] = 'snippet_name_example'; // string | The name for the snippet. + +try { + $result = $apiInstance->updateSnippet($options); +} catch (Exception $e) { + echo 'Exception when calling SnippetApi->updateSnippet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**service_id** | **string** | Alphanumeric string identifying the service. | +**version_id** | **int** | Integer identifying a service version. | +**snippet_name** | **string** | The name for the snippet. | + +### Return type + +[**\Fastly\Model\SnippetResponse**](../Model/SnippetResponse.md) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + ## `updateSnippetDynamic()` ```php diff --git a/docs/Api/SudoApi.md b/docs/Api/SudoApi.md new file mode 100644 index 00000000..b41d86fc --- /dev/null +++ b/docs/Api/SudoApi.md @@ -0,0 +1,52 @@ +# Fastly\Api\SudoApi + + +```php +$apiInstance = new Fastly\Api\SudoApi( + // 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 + +Method | Fastly API endpoint | Description +------------- | ------------- | ------------- +[**requestSudoAccess()**](SudoApi.md#requestSudoAccess) | **POST** /sudo | Request Sudo access + + +## `requestSudoAccess()` + +```php +requestSudoAccess($options): \Fastly\Model\SudoResponse // Request Sudo access +``` + +Re-authenticate to allow the provided user to obtain sudo access. + +### Example +```php + $options['sudo_request'] = new \Fastly\Model\SudoRequest(); // \Fastly\Model\SudoRequest + +try { + $result = $apiInstance->requestSudoAccess($options); +} catch (Exception $e) { + echo 'Exception when calling SudoApi->requestSudoAccess: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**sudo_request** | [**\Fastly\Model\SudoRequest**](../Model/SudoRequest.md) | | [optional] + +### Return type + +[**\Fastly\Model\SudoResponse**](../Model/SudoResponse.md) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) diff --git a/docs/Api/TokensApi.md b/docs/Api/TokensApi.md index 47b6efdd..cf5f4b3a 100644 --- a/docs/Api/TokensApi.md +++ b/docs/Api/TokensApi.md @@ -14,6 +14,8 @@ $apiInstance = new Fastly\Api\TokensApi( Method | Fastly API endpoint | Description ------------- | ------------- | ------------- +[**bulkRevokeTokens()**](TokensApi.md#bulkRevokeTokens) | **DELETE** /tokens | Revoke multiple tokens +[**createToken()**](TokensApi.md#createToken) | **POST** /tokens | Create a token [**getToken()**](TokensApi.md#getToken) | **GET** /tokens/{token_id} | Get a token [**getTokenCurrent()**](TokensApi.md#getTokenCurrent) | **GET** /tokens/self | Get the current token [**listTokensCustomer()**](TokensApi.md#listTokensCustomer) | **GET** /customer/{customer_id}/tokens | List tokens for a customer @@ -22,6 +24,71 @@ Method | Fastly API endpoint | Description [**revokeTokenCurrent()**](TokensApi.md#revokeTokenCurrent) | **DELETE** /tokens/self | Revoke the current token +## `bulkRevokeTokens()` + +```php +bulkRevokeTokens($options) // Revoke multiple tokens +``` + +Revoke Tokens in bulk format. Users may only revoke their own tokens. Superusers may revoke tokens of others. + +### Example +```php + $options['request_body'] = {"data":[{"id":"3krg2uUGZzb2W9Euo4moOY","type":"token"},{"id":"71ZA6hv2FO6tGEQIE203Xj","type":"token"}]}; // array + +try { + $apiInstance->bulkRevokeTokens($options); +} catch (Exception $e) { + echo 'Exception when calling TokensApi->bulkRevokeTokens: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**request_body** | [**array**](../Model/object.md) | | [optional] + +### Return type + +void (empty response body) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + +## `createToken()` + +```php +createToken($options): \Fastly\Model\TokenCreatedResponse // Create a token +``` + +Create an API token. If two-factor authentication is enabled for your account, review [the instructions](/reference/api/auth-tokens/user/) for including a one-time password in the request. + +### Example +```php + +try { + $result = $apiInstance->createToken($options); +} catch (Exception $e) { + echo 'Exception when calling TokensApi->createToken: ', $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\TokenCreatedResponse**](../Model/TokenCreatedResponse.md) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + ## `getToken()` ```php diff --git a/docs/Api/WafActiveRulesApi.md b/docs/Api/WafActiveRulesApi.md index 06bd326f..7d729471 100644 --- a/docs/Api/WafActiveRulesApi.md +++ b/docs/Api/WafActiveRulesApi.md @@ -14,6 +14,7 @@ $apiInstance = new Fastly\Api\WafActiveRulesApi( Method | Fastly API endpoint | Description ------------- | ------------- | ------------- +[**bulkDeleteWafActiveRules()**](WafActiveRulesApi.md#bulkDeleteWafActiveRules) | **DELETE** /waf/firewalls/{firewall_id}/versions/{version_id}/active-rules | Delete multiple active rules from a WAF [**bulkUpdateWafActiveRules()**](WafActiveRulesApi.md#bulkUpdateWafActiveRules) | **PATCH** /waf/firewalls/{firewall_id}/versions/{version_id}/active-rules/bulk | Update multiple active rules [**createWafActiveRule()**](WafActiveRulesApi.md#createWafActiveRule) | **POST** /waf/firewalls/{firewall_id}/versions/{version_id}/active-rules | Add a rule to a WAF as an active rule [**createWafActiveRulesTag()**](WafActiveRulesApi.md#createWafActiveRulesTag) | **POST** /waf/firewalls/{firewall_id}/versions/{version_id}/tags/{waf_tag_name}/active-rules | Create active rules by tag @@ -23,6 +24,44 @@ Method | Fastly API endpoint | Description [**updateWafActiveRule()**](WafActiveRulesApi.md#updateWafActiveRule) | **PATCH** /waf/firewalls/{firewall_id}/versions/{version_id}/active-rules/{waf_rule_id} | Update an active rule +## `bulkDeleteWafActiveRules()` + +```php +bulkDeleteWafActiveRules($options) // Delete multiple active rules from a WAF +``` + +Delete many active rules on a particular firewall version using the active rule ID. Limited to 500 rules per request. + +### Example +```php + $options['firewall_id'] = 'firewall_id_example'; // string | Alphanumeric string identifying a WAF Firewall. +$options['version_id'] = 56; // int | Integer identifying a service version. +$options['request_body'] = {"data":[{"type":"waf_active_rule","id":"3krg2uUGZzb2W9Euo4moOR"}]}; // array + +try { + $apiInstance->bulkDeleteWafActiveRules($options); +} catch (Exception $e) { + echo 'Exception when calling WafActiveRulesApi->bulkDeleteWafActiveRules: ', $e->getMessage(), PHP_EOL; +} +``` + +### Options + +Note: the input parameter is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**firewall_id** | **string** | Alphanumeric string identifying a WAF Firewall. | +**version_id** | **int** | Integer identifying a service version. | +**request_body** | [**array**](../Model/object.md) | | [optional] + +### Return type + +void (empty response body) + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to README]](../../README.md) + ## `bulkUpdateWafActiveRules()` ```php diff --git a/docs/Model/ClientKey.md b/docs/Model/ClientKey.md new file mode 100644 index 00000000..7bd8a770 --- /dev/null +++ b/docs/Model/ClientKey.md @@ -0,0 +1,12 @@ +# # ClientKey + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client_key** | **string** | A Base64-encoded X25519 public key that can be used with a [libsodium-compatible sealed box](https://libsodium.gitbook.io/doc/public-key_cryptography/sealed_boxes) to encrypt secrets before upload. | [optional] +**signature** | **string** | A Base64-encoded signature of the client key. The signature is generated using the signing key and must be verified before using the client key. | [optional] +**expires_at** | **\DateTime** | Date and time in ISO 8601 format. | [optional] [readonly] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Content.md b/docs/Model/Content.md index f1bd771a..ada14beb 100644 --- a/docs/Model/Content.md +++ b/docs/Model/Content.md @@ -5,8 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **hash** | **string** | | [optional] -**request** | **object** | | [optional] -**response** | **object** | | [optional] +**request** | **array<string,object>** | | [optional] +**response** | **array<string,object>** | | [optional] **response_time** | **float** | | [optional] **server** | **string** | | [optional] **pop** | **string** | | [optional] diff --git a/docs/Model/DomainInspector.md b/docs/Model/DomainInspector.md new file mode 100644 index 00000000..daea9ff1 --- /dev/null +++ b/docs/Model/DomainInspector.md @@ -0,0 +1,12 @@ +# # DomainInspector + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | [**\Fastly\Model\SubsequentRequestTimestamp**](SubsequentRequestTimestamp.md) | | [optional] +**aggregate_delay** | **int** | Offset of entry timestamps from the current time due to processing time. | [optional] +**data** | [**\Fastly\Model\DomainInspectorRealtimeEntry[]**](DomainInspectorRealtimeEntry.md) | A list of report [entries](#entry-data-model), each representing one second of time. | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DomainInspectorEntry.md b/docs/Model/DomainInspectorEntry.md new file mode 100644 index 00000000..0d776165 --- /dev/null +++ b/docs/Model/DomainInspectorEntry.md @@ -0,0 +1,11 @@ +# # DomainInspectorEntry + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dimensions** | [**\Fastly\Model\DomainInspectorEntryDimensions**](DomainInspectorEntryDimensions.md) | | [optional] +**values** | [**\Fastly\Model\Values[]**](Values.md) | An array of values representing the metric values at each point in time. Note that this dataset is sparse: only the keys with non-zero values will be included in the record. | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DomainInspectorEntryDimensions.md b/docs/Model/DomainInspectorEntryDimensions.md new file mode 100644 index 00000000..4d255a17 --- /dev/null +++ b/docs/Model/DomainInspectorEntryDimensions.md @@ -0,0 +1,12 @@ +# # DomainInspectorEntryDimensions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**region** | **string** | The geographic region from which the edge responses in this data entry were delivered. If unspecified, results are aggregated across regions. | [optional] +**datacenter** | **string** | The POP from which the edge responses in this data entry were delivered. If unspecified, results are aggregated across POPs. | [optional] +**domain** | **string** | The domain from which the edge responses in this data entry were delivered. If unspecified, results are aggregated across domains. | [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 new file mode 100644 index 00000000..a1c73c2f --- /dev/null +++ b/docs/Model/DomainInspectorMeasurements.md @@ -0,0 +1,71 @@ +# # DomainInspectorMeasurements + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**edge_requests** | **int** | Number of requests sent by end users to Fastly. | [optional] +**edge_resp_header_bytes** | **int** | Total header bytes delivered from Fastly to the end user. | [optional] +**edge_resp_body_bytes** | **int** | Total body bytes delivered from Fastly to the end user. | [optional] +**status_1xx** | **int** | Number of 1xx \"Informational\" category status codes delivered. | [optional] +**status_2xx** | **int** | Number of 2xx \"Success\" status codes delivered. | [optional] +**status_3xx** | **int** | Number of 3xx \"Redirection\" codes delivered. | [optional] +**status_4xx** | **int** | Number of 4xx \"Client Error\" codes delivered. | [optional] +**status_5xx** | **int** | Number of 5xx \"Server Error\" codes delivered. | [optional] +**status_200** | **int** | Number of responses delivered with status code 200 (Success). | [optional] +**status_204** | **int** | Number of responses delivered with status code 204 (No Content). | [optional] +**status_206** | **int** | Number of responses delivered with status code 206 (Partial Content). | [optional] +**status_301** | **int** | Number of responses delivered with status code 301 (Moved Permanently). | [optional] +**status_302** | **int** | Number of responses delivered with status code 302 (Found). | [optional] +**status_304** | **int** | Number of responses delivered with status code 304 (Not Modified). | [optional] +**status_400** | **int** | Number of responses delivered with status code 400 (Bad Request). | [optional] +**status_401** | **int** | Number of responses delivered with status code 401 (Unauthorized). | [optional] +**status_403** | **int** | Number of responses delivered with status code 403 (Forbidden). | [optional] +**status_404** | **int** | Number of responses delivered with status code 404 (Not Found). | [optional] +**status_416** | **int** | Number of responses delivered with status code 416 (Range Not Satisfiable). | [optional] +**status_429** | **int** | Number of responses delivered with status code 429 (Too Many Requests). | [optional] +**status_500** | **int** | Number of responses delivered with status code 500 (Internal Server Error). | [optional] +**status_501** | **int** | Number of responses delivered with status code 501 (Not Implemented). | [optional] +**status_502** | **int** | Number of responses delivered with status code 502 (Bad Gateway). | [optional] +**status_503** | **int** | Number of responses delivered with status code 503 (Service Unavailable). | [optional] +**status_504** | **int** | Number of responses delivered with status code 504 (Gateway Timeout). | [optional] +**status_505** | **int** | Number of responses delivered with status code 505 (HTTP Version Not Supported). | [optional] +**requests** | **int** | Number of requests processed. | [optional] +**resp_header_bytes** | **int** | Total header bytes delivered. | [optional] +**resp_body_bytes** | **int** | Total body bytes delivered. | [optional] +**bereq_header_bytes** | **int** | Total header bytes sent to origin. | [optional] +**bereq_body_bytes** | **int** | Total body bytes sent to origin. | [optional] +**edge_hit_requests** | **int** | Number of requests sent by end users to Fastly that resulted in a hit at the edge. | [optional] +**edge_miss_requests** | **int** | Number of requests sent by end users to Fastly that resulted in a miss at the edge. | [optional] +**origin_fetches** | **int** | Number of requests sent to origin. | [optional] +**origin_fetch_resp_header_bytes** | **int** | Total header bytes received from origin. | [optional] +**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_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] +**origin_status_301** | **int** | Number of responses received from origin with status code 301 (Moved Permanently). | [optional] +**origin_status_302** | **int** | Number of responses received from origin with status code 302 (Found). | [optional] +**origin_status_304** | **int** | Number of responses received from origin with status code 304 (Not Modified). | [optional] +**origin_status_400** | **int** | Number of responses received from origin with status code 400 (Bad Request). | [optional] +**origin_status_401** | **int** | Number of responses received from origin with status code 401 (Unauthorized). | [optional] +**origin_status_403** | **int** | Number of responses received from origin with status code 403 (Forbidden). | [optional] +**origin_status_404** | **int** | Number of responses received from origin with status code 404 (Not Found). | [optional] +**origin_status_416** | **int** | Number of responses received from origin with status code 416 (Range Not Satisfiable). | [optional] +**origin_status_429** | **int** | Number of responses received from origin with status code 429 (Too Many Requests). | [optional] +**origin_status_500** | **int** | Number of responses received from origin with status code 500 (Internal Server Error). | [optional] +**origin_status_501** | **int** | Number of responses received from origin with status code 501 (Not Implemented). | [optional] +**origin_status_502** | **int** | Number of responses received from origin with status code 502 (Bad Gateway). | [optional] +**origin_status_503** | **int** | Number of responses received from origin with status code 503 (Service Unavailable). | [optional] +**origin_status_504** | **int** | Number of responses received from origin with status code 504 (Gateway Timeout). | [optional] +**origin_status_505** | **int** | Number of responses received from origin with status code 505 (HTTP Version Not Supported). | [optional] +**origin_status_1xx** | **int** | Number of \"Informational\" category status codes received from origin. | [optional] +**origin_status_2xx** | **int** | Number of \"Success\" status codes received from origin. | [optional] +**origin_status_3xx** | **int** | Number of \"Redirection\" codes received from origin. | [optional] +**origin_status_4xx** | **int** | Number of \"Client Error\" codes received from origin. | [optional] +**origin_status_5xx** | **int** | Number of \"Server Error\" codes received from origin. | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DomainInspectorRealtimeEntry.md b/docs/Model/DomainInspectorRealtimeEntry.md new file mode 100644 index 00000000..e6f05628 --- /dev/null +++ b/docs/Model/DomainInspectorRealtimeEntry.md @@ -0,0 +1,12 @@ +# # DomainInspectorRealtimeEntry + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**recorded** | [**\Fastly\Model\RecordedTimestamp**](RecordedTimestamp.md) | | [optional] +**aggregated** | [**array<string,DomainInspectorMeasurements>**](DomainInspectorMeasurements.md) | Groups [measurements](#measurements-data-model) by backend name and then by IP address. | [optional] +**datacenter** | **array<string,array<string,DomainInspectorMeasurements>>** | Groups [measurements](#measurements-data-model) by POP, then backend name, and then IP address. See the [POPs API](/reference/api/utils/pops/) for details about POP identifiers. | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EventAttributes.md b/docs/Model/EventAttributes.md index 67e43cb9..4128aab7 100644 --- a/docs/Model/EventAttributes.md +++ b/docs/Model/EventAttributes.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **description** | **string** | Description of the event. | [optional] **event_type** | **string** | Type of event. Can be used with `filter[event_type]` | [optional] [one of: 'api_key.create', 'acl.create', 'acl.delete', 'acl.update', 'address.create', 'address.delete', 'address.update', 'backend.create', 'backend.delete', 'backend.update', 'billing.contact_update', 'cache_settings.create', 'cache_settings.delete', 'cache_settings.update', 'customer.create', 'customer.pricing', 'customer.update', 'customer_feature.create', 'customer_feature.delete', 'director.create', 'director.delete', 'director.update', 'director_backend.create', 'director_backend.delete', 'domain.create', 'domain.delete', 'domain.update', 'gzip.create', 'gzip.delete', 'gzip.update', 'header.create', 'header.delete', 'header.update', 'healthcheck.create', 'healthcheck.delete', 'healthcheck.update', 'invitation.accept', 'invitation.sent', 'invoice.failed_payment', 'invoice.payment', 'io_settings.create', 'io_settings.delete', 'io_settings.update', 'logging.create', 'logging.delete', 'logging.update', 'pool.create', 'pool.delete', 'pool.update', 'request_settings.create', 'request_settings.delete', 'request_settings.update', 'response_object.create', 'response_object.delete', 'response_object.update', 'rule_status.update', 'rule_status.upsert', 'server.create', 'server.delete', 'server.update', 'service.create', 'service.delete', 'service.move', 'service.move_destination', 'service.move_source', 'service.purge_all', 'service.update', 'service_authorization.create', 'service_authorization.delete', 'service_authorization.update', 'tls.bulk_certificate.create', 'tls.bulk_certificate.delete', 'tls.bulk_certificate.update', 'tls.certificate.create', 'tls.certificate.expiration_email', 'tls.certificate.update', 'tls.certificate.delete', 'tls.configuration.update', 'tls.private_key.create', 'tls.private_key.delete', 'tls.activation.enable', 'tls.activation.update', 'tls.activation.disable', 'tls.globalsign.domain.create', 'tls.globalsign.domain.verify', 'tls.globalsign.domain.delete', 'tls.subscription.create', 'tls.subscription.delete', 'tls.subscription.dns_check_email', 'token.create', 'token.destroy', 'two_factor_auth.disable', 'two_factor_auth.enable', 'user.create', 'user.destroy', 'user.lock', 'user.login', 'user.login_failure', 'user.logout', 'user.password_update', 'user.unlock', 'user.update', 'vcl.create', 'vcl.delete', 'vcl.update', 'version.activate', 'version.clone', 'version.copy', 'version.copy_destination', 'version.copy_source', 'version.create', 'version.deactivate', 'version.lock', 'version.update', 'waf.configuration_set_update', 'waf.create', 'waf.delete', 'waf.update', 'waf.enable', 'waf.disable', 'waf.owasp.create', 'waf.owasp.update', 'waf.ruleset.deploy', 'waf.ruleset.deploy_failure', 'wordpress.create', 'wordpress.delete', 'wordpress.update'] **ip** | **string** | IP addresses that the event was requested from. | [optional] -**metadata** | **object** | Hash of key value pairs of additional information. | [optional] +**metadata** | **array<string,object>** | Hash of key value pairs of additional information. | [optional] **service_id** | **string** | | [optional] [readonly] **user_id** | **string** | | [optional] [readonly] **token_id** | **string** | | [optional] [readonly] diff --git a/docs/Model/EventsResponseAllOf.md b/docs/Model/EventData.md similarity index 91% rename from docs/Model/EventsResponseAllOf.md rename to docs/Model/EventData.md index b8134498..cf329453 100644 --- a/docs/Model/EventsResponseAllOf.md +++ b/docs/Model/EventData.md @@ -1,4 +1,4 @@ -# # EventsResponseAllOf +# # EventData ## Properties diff --git a/docs/Model/HistoricalDomains.md b/docs/Model/HistoricalDomains.md new file mode 100644 index 00000000..7cb19d7e --- /dev/null +++ b/docs/Model/HistoricalDomains.md @@ -0,0 +1,13 @@ +# # HistoricalDomains + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **string** | Whether or not we were able to successfully execute the query. | [optional] +**meta** | [**\Fastly\Model\HistoricalDomainsMeta**](HistoricalDomainsMeta.md) | | [optional] +**msg** | **string** | If the query was not successful, this will provide a string that explains why. | [optional] +**data** | [**\Fastly\Model\HistoricalDomainsData[]**](HistoricalDomainsData.md) | A list of [entries](#entry-data-model), each representing one unique combination of dimensions, such as domain, region, or POP. | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/HistoricalDomainsData.md b/docs/Model/HistoricalDomainsData.md new file mode 100644 index 00000000..54eb57db --- /dev/null +++ b/docs/Model/HistoricalDomainsData.md @@ -0,0 +1,11 @@ +# # HistoricalDomainsData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dimensions** | [**\Fastly\Model\DomainInspectorEntryDimensions**](DomainInspectorEntryDimensions.md) | | [optional] +**values** | [**\Fastly\Model\Values[]**](Values.md) | An array of values representing the metric values at each point in time. Note that this dataset is sparse: only the keys with non-zero values will be included in the record. | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/HistoricalDomainsMeta.md b/docs/Model/HistoricalDomainsMeta.md new file mode 100644 index 00000000..3fafb41b --- /dev/null +++ b/docs/Model/HistoricalDomainsMeta.md @@ -0,0 +1,18 @@ +# # HistoricalDomainsMeta + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**start** | **string** | Start time that was used to perform the query as an ISO-8601-formatted date and time. | [optional] +**end** | **string** | End time that was used to perform the query as an ISO-8601-formatted date and time. | [optional] +**downsample** | **string** | Downsample that was used to perform the query. One of `minute`, `hour`, or `day`. | [optional] +**metrics** | **string** | A comma-separated list of the metrics that were requested. | [optional] +**limit** | **float** | The maximum number of results shown per page. | [optional] +**next_cursor** | **string** | A string that can be used to request the next page of results, if any. | [optional] +**sort** | **string** | A comma-separated list of keys the results are sorted by. | [optional] +**group_by** | **string** | A comma-separated list of dimensions being summed over in the query. | [optional] +**filters** | [**\Fastly\Model\HistoricalDomainsMetaFilters**](HistoricalDomainsMetaFilters.md) | | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/HistoricalDomainsMetaFilters.md b/docs/Model/HistoricalDomainsMetaFilters.md new file mode 100644 index 00000000..03e3c0ff --- /dev/null +++ b/docs/Model/HistoricalDomainsMetaFilters.md @@ -0,0 +1,12 @@ +# # HistoricalDomainsMetaFilters + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**region** | **string** | | [optional] +**datacenter** | **string** | | [optional] +**domain** | **string** | | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/HistoricalDomainsResponse.md b/docs/Model/HistoricalDomainsResponse.md new file mode 100644 index 00000000..cacd4b1a --- /dev/null +++ b/docs/Model/HistoricalDomainsResponse.md @@ -0,0 +1,13 @@ +# # HistoricalDomainsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **string** | Whether or not we were able to successfully execute the query. | [optional] +**meta** | [**\Fastly\Model\HistoricalDomainsMeta**](HistoricalDomainsMeta.md) | | [optional] +**msg** | **string** | If the query was not successful, this will provide a string that explains why. | [optional] +**data** | [**\Fastly\Model\DomainInspectorEntry[]**](DomainInspectorEntry.md) | A list of timeseries. Each individual timeseries represents a unique combination of dimensions, such as domain, region or POP. | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/HistoricalDomainsResponseAllOf.md b/docs/Model/HistoricalDomainsResponseAllOf.md new file mode 100644 index 00000000..3532a828 --- /dev/null +++ b/docs/Model/HistoricalDomainsResponseAllOf.md @@ -0,0 +1,10 @@ +# # HistoricalDomainsResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Fastly\Model\DomainInspectorEntry[]**](DomainInspectorEntry.md) | A list of timeseries. Each individual timeseries represents a unique combination of dimensions, such as domain, region or POP. | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/HistoricalFieldResultsAttributesAllOf.md b/docs/Model/HistoricalFieldResultsAttributesAdditional.md similarity index 87% rename from docs/Model/HistoricalFieldResultsAttributesAllOf.md rename to docs/Model/HistoricalFieldResultsAttributesAdditional.md index 60971ad3..a7ad1192 100644 --- a/docs/Model/HistoricalFieldResultsAttributesAllOf.md +++ b/docs/Model/HistoricalFieldResultsAttributesAdditional.md @@ -1,4 +1,4 @@ -# # HistoricalFieldResultsAttributesAllOf +# # HistoricalFieldResultsAttributesAdditional ## Properties diff --git a/docs/Model/HistoricalOriginsResponse.md b/docs/Model/HistoricalOriginsResponse.md new file mode 100644 index 00000000..e214287a --- /dev/null +++ b/docs/Model/HistoricalOriginsResponse.md @@ -0,0 +1,13 @@ +# # HistoricalOriginsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **string** | Whether or not we were able to successfully execute the query. | [optional] +**meta** | [**\Fastly\Model\OriginInspectorHistoricalMeta**](OriginInspectorHistoricalMeta.md) | | [optional] +**msg** | **string** | If the query was not successful, this will provide a string that explains why. | [optional] +**data** | [**\Fastly\Model\OriginInspectorEntry[]**](OriginInspectorEntry.md) | A list of timeseries. Each individual timeseries represents a unique combination of dimensions, such as origin host, region or POP. | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/HistoricalOriginsResponseAllOf.md b/docs/Model/HistoricalOriginsResponseAllOf.md new file mode 100644 index 00000000..8aa3a1be --- /dev/null +++ b/docs/Model/HistoricalOriginsResponseAllOf.md @@ -0,0 +1,10 @@ +# # HistoricalOriginsResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Fastly\Model\OriginInspectorEntry[]**](OriginInspectorEntry.md) | A list of timeseries. Each individual timeseries represents a unique combination of dimensions, such as origin host, region or POP. | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/InlineResponse2005.md b/docs/Model/InlineResponse2005.md new file mode 100644 index 00000000..5fe489f7 --- /dev/null +++ b/docs/Model/InlineResponse2005.md @@ -0,0 +1,11 @@ +# # InlineResponse2005 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Fastly\Model\SecretStoreResponse[]**](SecretStoreResponse.md) | | [optional] +**meta** | [**\Fastly\Model\PaginationCursorMeta**](PaginationCursorMeta.md) | | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/InlineResponse2006.md b/docs/Model/InlineResponse2006.md new file mode 100644 index 00000000..3fbb62f4 --- /dev/null +++ b/docs/Model/InlineResponse2006.md @@ -0,0 +1,11 @@ +# # InlineResponse2006 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Fastly\Model\SecretResponse[]**](SecretResponse.md) | | [optional] +**meta** | [**\Fastly\Model\PaginationCursorMeta**](PaginationCursorMeta.md) | | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/InlineResponse2007.md b/docs/Model/InlineResponse2007.md new file mode 100644 index 00000000..98fb2fdc --- /dev/null +++ b/docs/Model/InlineResponse2007.md @@ -0,0 +1,10 @@ +# # InlineResponse2007 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Fastly\Model\ServiceAuthorizationResponseData[]**](ServiceAuthorizationResponseData.md) | | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/InlineResponse400.md b/docs/Model/InlineResponse400.md new file mode 100644 index 00000000..3ca4d3ae --- /dev/null +++ b/docs/Model/InlineResponse400.md @@ -0,0 +1,10 @@ +# # InlineResponse400 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **string** | | [optional] [one of: 'invalid_grant', 'invalid_request', 'invalid_scope', 'account_locked', '2fa.verify'] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LegacyWafConfigurationSet.md b/docs/Model/LegacyWafConfigurationSet.md new file mode 100644 index 00000000..503b7d8a --- /dev/null +++ b/docs/Model/LegacyWafConfigurationSet.md @@ -0,0 +1,11 @@ +# # LegacyWafConfigurationSet + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**active** | **bool** | The active configuration set is the default configuration set when creating a new WAF. When Fastly adds configuration sets, the new versions become the default (active). | [optional] +**name** | **string** | The name of the configuration set. | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LegacyWafFirewall.md b/docs/Model/LegacyWafFirewall.md new file mode 100644 index 00000000..27f38f99 --- /dev/null +++ b/docs/Model/LegacyWafFirewall.md @@ -0,0 +1,18 @@ +# # LegacyWafFirewall + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**last_push** | **string** | Date and time that VCL was last pushed to cache nodes. | [optional] +**prefetch_condition** | **string** | Name of the corresponding condition object. | [optional] +**response** | **string** | Name of the corresponding response object. | [optional] +**version** | [**\Fastly\Model\ReadOnlyVersion**](ReadOnlyVersion.md) | | [optional] +**service_id** | [**\Fastly\Model\ReadOnlyServiceId**](ReadOnlyServiceId.md) | | [optional] +**disabled** | **bool** | The status of the firewall. | [optional] [defaults to false] +**rule_statuses_log_count** | **int** | The number of rule statuses set to log. | [optional] +**rule_statuses_block_count** | **int** | The number of rule statuses set to block. | [optional] +**rule_statuses_disabled_count** | **int** | The number of rule statuses set to disabled. | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LegacyWafOwasp.md b/docs/Model/LegacyWafOwasp.md new file mode 100644 index 00000000..f75f4e81 --- /dev/null +++ b/docs/Model/LegacyWafOwasp.md @@ -0,0 +1,38 @@ +# # LegacyWafOwasp + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**allowed_http_versions** | **string** | Allowed HTTP versions. | [optional] [defaults to 'HTTP/1.0 HTTP/1.1 HTTP/2'] +**allowed_methods** | **string** | A space-separated list of HTTP method names. | [optional] [defaults to 'GET HEAD POST OPTIONS PUT PATCH DELETE'] +**allowed_request_content_type** | **string** | Allowed request content types. | [optional] [defaults to 'application/x-www-form-urlencoded|multipart/form-data|text/xml|application/xml|application/x-amf|application/json|text/plain'] +**arg_length** | **int** | The maximum allowed length of an argument. | [optional] [defaults to 400] +**arg_name_length** | **int** | The maximum allowed argument name length. | [optional] [defaults to 100] +**combined_file_sizes** | **int** | The maximum allowed size of all files (in bytes). | [optional] [defaults to 10000000] +**created_at** | **string** | Date and time that the settings object was created. | [optional] +**critical_anomaly_score** | **int** | Score value to add for critical anomalies. | [optional] [defaults to 6] +**crs_validate_utf8_encoding** | **bool** | CRS validate UTF8 encoding. | [optional] +**error_anomaly_score** | **int** | Score value to add for error anomalies. | [optional] [defaults to 5] +**high_risk_country_codes** | **string** | A space-separated list of country codes in ISO 3166-1 (two-letter) format. | [optional] +**http_violation_score_threshold** | **int** | HTTP violation threshold. | [optional] +**inbound_anomaly_score_threshold** | **int** | Inbound anomaly threshold. | [optional] +**lfi_score_threshold** | **int** | Local file inclusion attack threshold. | [optional] +**max_file_size** | **int** | The maximum allowed file size (in bytes). | [optional] [defaults to 10000000] +**max_num_args** | **int** | The maximum number of arguments allowed. | [optional] [defaults to 255] +**notice_anomaly_score** | **int** | Score value to add for notice anomalies. | [optional] [defaults to 4] +**paranoia_level** | **int** | The configured paranoia level. | [optional] [defaults to 1] +**php_injection_score_threshold** | **int** | PHP injection threshold. | [optional] +**rce_score_threshold** | **int** | Remote code execution threshold. | [optional] +**restricted_extensions** | **string** | A space-separated list of disallowed file extensions. | [optional] [defaults to '.asa/ .asax/ .ascx/ .axd/ .backup/ .bak/ .bat/ .cdx/ .cer/ .cfg/ .cmd/ .com/ .config/ .conf/ .cs/ .csproj/ .csr/ .dat/ .db/ .dbf/ .dll/ .dos/ .htr/ .htw/ .ida/ .idc/ .idq/ .inc/ .ini/ .key/ .licx/ .lnk/ .log/ .mdb/ .old/ .pass/ .pdb/ .pol/ .printer/ .pwd/ .resources/ .resx/ .sql/ .sys/ .vb/ .vbs/ .vbproj/ .vsdisco/ .webinfo/ .xsd/ .xsx'] +**restricted_headers** | **string** | A space-separated list of disallowed header names. | [optional] [defaults to '/proxy/ /lock-token/ /content-range/ /translate/ /if/'] +**rfi_score_threshold** | **int** | Remote file inclusion attack threshold. | [optional] +**session_fixation_score_threshold** | **int** | Session fixation attack threshold. | [optional] +**sql_injection_score_threshold** | **int** | SQL injection attack threshold. | [optional] +**total_arg_length** | **int** | The maximum size of argument names and values. | [optional] [defaults to 6400] +**updated_at** | **string** | Date and time that the settings object was last updated. | [optional] +**warning_anomaly_score** | **int** | Score value to add for warning anomalies. | [optional] +**xss_score_threshold** | **int** | XSS attack threshold. | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LegacyWafRule.md b/docs/Model/LegacyWafRule.md new file mode 100644 index 00000000..ada45870 --- /dev/null +++ b/docs/Model/LegacyWafRule.md @@ -0,0 +1,14 @@ +# # LegacyWafRule + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **string** | Message metadata for the rule. | [optional] +**rule_id** | **string** | Corresponding ModSecurity rule ID. | [optional] +**severity** | **int** | Severity metadata for the rule. | [optional] +**source** | **string** | The ModSecurity rule logic. | [optional] +**vcl** | **string** | The VCL representation of the rule logic. | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LegacyWafRuleStatus.md b/docs/Model/LegacyWafRuleStatus.md new file mode 100644 index 00000000..8fa4aade --- /dev/null +++ b/docs/Model/LegacyWafRuleStatus.md @@ -0,0 +1,12 @@ +# # LegacyWafRuleStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **string** | Describes the behavior for the particular rule within this firewall. Permitted values: `log`, `block`, and `disabled`. | [optional] +**modsec_rule_id** | **string** | The ModSecurity rule ID. | [optional] +**unique_rule_id** | **string** | The Rule ID. | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LegacyWafRuleset.md b/docs/Model/LegacyWafRuleset.md new file mode 100644 index 00000000..d0d05213 --- /dev/null +++ b/docs/Model/LegacyWafRuleset.md @@ -0,0 +1,11 @@ +# # LegacyWafRuleset + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**last_push** | **string** | Date and time WAF ruleset VCL was last deployed. | [optional] +**vcl** | **string** | The WAF ruleset VCL currently deployed. | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LegacyWafTag.md b/docs/Model/LegacyWafTag.md new file mode 100644 index 00000000..3b750a6d --- /dev/null +++ b/docs/Model/LegacyWafTag.md @@ -0,0 +1,10 @@ +# # LegacyWafTag + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | Name of the tag. | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LegacyWafUpdateStatus.md b/docs/Model/LegacyWafUpdateStatus.md new file mode 100644 index 00000000..4f4ee8ec --- /dev/null +++ b/docs/Model/LegacyWafUpdateStatus.md @@ -0,0 +1,15 @@ +# # LegacyWafUpdateStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**completed_at** | **string** | Date and time that job was completed. | [optional] +**created_at** | **string** | Date and time that job was created. | [optional] +**data** | **string** | This field can contain data passed to the background worker as well as output from the background job. | [optional] +**message** | **string** | Message with information about the status of the update. | [optional] +**status** | **string** | Current status of the update. | [optional] +**updated_at** | **string** | Date and time that job was last updated. | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OriginInspector.md b/docs/Model/OriginInspector.md new file mode 100644 index 00000000..cf22a867 --- /dev/null +++ b/docs/Model/OriginInspector.md @@ -0,0 +1,12 @@ +# # OriginInspector + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | [**\Fastly\Model\OriginInspectorSubsequentRequestTimestamp**](OriginInspectorSubsequentRequestTimestamp.md) | | [optional] +**aggregate_delay** | **int** | Offset of entry timestamps from the current time due to processing time. | [optional] +**data** | [**\Fastly\Model\OriginInspectorRealtimeEntry[]**](OriginInspectorRealtimeEntry.md) | A list of report [entries](#entry-data-model), each representing one second of time. | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OriginInspectorDimensions.md b/docs/Model/OriginInspectorDimensions.md new file mode 100644 index 00000000..9e318b77 --- /dev/null +++ b/docs/Model/OriginInspectorDimensions.md @@ -0,0 +1,12 @@ +# # OriginInspectorDimensions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**region** | **string** | The geographic region from which the edge responses in this data entry were delivered. If unspecified, results are aggregated across regions. | [optional] +**datacenter** | **string** | The POP from which the edge responses in this data entry were delivered. If unspecified, results are aggregated across POPs. | [optional] +**host** | **string** | The origin host from which the edge responses in this data entry were delivered. If unspecified, results are aggregated across origin hosts. | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OriginInspectorEntry.md b/docs/Model/OriginInspectorEntry.md new file mode 100644 index 00000000..fccdfed0 --- /dev/null +++ b/docs/Model/OriginInspectorEntry.md @@ -0,0 +1,11 @@ +# # OriginInspectorEntry + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dimensions** | [**\Fastly\Model\OriginInspectorDimensions**](OriginInspectorDimensions.md) | | [optional] +**values** | [**\Fastly\Model\OriginInspectorValues[]**](OriginInspectorValues.md) | An array of values representing the metric values at each point in time. Note that this dataset is sparse: only the keys with non-zero values will be included in the record. | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OriginInspectorHistorical.md b/docs/Model/OriginInspectorHistorical.md new file mode 100644 index 00000000..a1b8afa7 --- /dev/null +++ b/docs/Model/OriginInspectorHistorical.md @@ -0,0 +1,13 @@ +# # OriginInspectorHistorical + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **string** | Whether or not we were able to successfully execute the query. | [optional] +**meta** | [**\Fastly\Model\OriginInspectorHistoricalMeta**](OriginInspectorHistoricalMeta.md) | | [optional] +**msg** | **string** | If the query was not successful, this will provide a string that explains why. | [optional] +**data** | [**\Fastly\Model\OriginInspectorHistoricalData[]**](OriginInspectorHistoricalData.md) | A list of [entries](#entry-data-model), each representing one unique combination of dimensions, such as origin host, region or POP. | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OriginInspectorHistoricalData.md b/docs/Model/OriginInspectorHistoricalData.md new file mode 100644 index 00000000..38d1b3ca --- /dev/null +++ b/docs/Model/OriginInspectorHistoricalData.md @@ -0,0 +1,11 @@ +# # OriginInspectorHistoricalData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dimensions** | [**\Fastly\Model\OriginInspectorDimensions**](OriginInspectorDimensions.md) | | [optional] +**values** | [**\Fastly\Model\Values**](Values.md) | | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OriginInspectorHistoricalMeta.md b/docs/Model/OriginInspectorHistoricalMeta.md new file mode 100644 index 00000000..44bf174e --- /dev/null +++ b/docs/Model/OriginInspectorHistoricalMeta.md @@ -0,0 +1,18 @@ +# # OriginInspectorHistoricalMeta + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**start** | **string** | Start time that was used to perform the query as an ISO-8601-formatted date and time. | [optional] +**end** | **string** | End time that was used to perform the query as an ISO-8601-formatted date and time. | [optional] +**downsample** | **string** | Downsample that was used to perform the query. One of `minute`, `hour` or `day`. | [optional] +**metrics** | **string** | A comma-separated list of the metrics that were requested. | [optional] +**limit** | **float** | The maximum number of results shown per page. | [optional] +**next_cursor** | **string** | A string that can be used to request the next page of results, if any. | [optional] +**sort** | **string** | A comma-separated list of keys the results are sorted by. | [optional] +**group_by** | **string** | A comma-separated list of dimensions being summed over in the query. | [optional] +**filters** | [**\Fastly\Model\OriginInspectorHistoricalMetaFilters**](OriginInspectorHistoricalMetaFilters.md) | | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OriginInspectorHistoricalMetaFilters.md b/docs/Model/OriginInspectorHistoricalMetaFilters.md new file mode 100644 index 00000000..7fbfa40c --- /dev/null +++ b/docs/Model/OriginInspectorHistoricalMetaFilters.md @@ -0,0 +1,12 @@ +# # OriginInspectorHistoricalMetaFilters + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**region** | **string** | | [optional] +**datacenter** | **string** | | [optional] +**host** | **string** | | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OriginInspectorMeasurements.md b/docs/Model/OriginInspectorMeasurements.md new file mode 100644 index 00000000..8f782a9f --- /dev/null +++ b/docs/Model/OriginInspectorMeasurements.md @@ -0,0 +1,161 @@ +# # OriginInspectorMeasurements + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**responses** | **int** | Number of responses from origin. | [optional] +**resp_header_bytes** | **int** | Number of header bytes from origin. | [optional] +**resp_body_bytes** | **int** | Number of body bytes from origin. | [optional] +**status_1xx** | **int** | Number of 1xx \"Informational\" status codes delivered from origin. | [optional] +**status_2xx** | **int** | Number of 2xx \"Success\" status codes delivered from origin. | [optional] +**status_3xx** | **int** | Number of 3xx \"Redirection\" codes delivered from origin. | [optional] +**status_4xx** | **int** | Number of 4xx \"Client Error\" codes delivered from origin. | [optional] +**status_5xx** | **int** | Number of 5xx \"Server Error\" codes delivered from origin. | [optional] +**status_200** | **int** | Number of responses received with status code 200 (Success) from origin. | [optional] +**status_204** | **int** | Number of responses received with status code 204 (No Content) from origin. | [optional] +**status_206** | **int** | Number of responses received with status code 206 (Partial Content) from origin. | [optional] +**status_301** | **int** | Number of responses received with status code 301 (Moved Permanently) from origin. | [optional] +**status_302** | **int** | Number of responses received with status code 302 (Found) from origin. | [optional] +**status_304** | **int** | Number of responses received with status code 304 (Not Modified) from origin. | [optional] +**status_400** | **int** | Number of responses received with status code 400 (Bad Request) from origin. | [optional] +**status_401** | **int** | Number of responses received with status code 401 (Unauthorized) from origin. | [optional] +**status_403** | **int** | Number of responses received with status code 403 (Forbidden) from origin. | [optional] +**status_404** | **int** | Number of responses received with status code 404 (Not Found) from origin. | [optional] +**status_416** | **int** | Number of responses received with status code 416 (Range Not Satisfiable) from origin. | [optional] +**status_429** | **int** | Number of responses received with status code 429 (Too Many Requests) from origin. | [optional] +**status_500** | **int** | Number of responses received with status code 500 (Internal Server Error) from origin. | [optional] +**status_501** | **int** | Number of responses received with status code 501 (Not Implemented) from origin. | [optional] +**status_502** | **int** | Number of responses received with status code 502 (Bad Gateway) from origin. | [optional] +**status_503** | **int** | Number of responses received with status code 503 (Service Unavailable) from origin. | [optional] +**status_504** | **int** | Number of responses received with status code 504 (Gateway Timeout) from origin. | [optional] +**status_505** | **int** | Number of responses received with status code 505 (HTTP Version Not Supported) from origin. | [optional] +**latency_0_to_1ms** | **int** | Number of responses from origin with latency between 0 and 1 millisecond. | [optional] +**latency_1_to_5ms** | **int** | Number of responses from origin with latency between 1 and 5 milliseconds. | [optional] +**latency_5_to_10ms** | **int** | Number of responses from origin with latency between 5 and 10 milliseconds. | [optional] +**latency_10_to_50ms** | **int** | Number of responses from origin with latency between 10 and 50 milliseconds. | [optional] +**latency_50_to_100ms** | **int** | Number of responses from origin with latency between 50 and 100 milliseconds. | [optional] +**latency_100_to_250ms** | **int** | Number of responses from origin with latency between 100 and 250 milliseconds. | [optional] +**latency_250_to_500ms** | **int** | Number of responses from origin with latency between 250 and 500 milliseconds. | [optional] +**latency_500_to_1000ms** | **int** | Number of responses from origin with latency between 500 and 1,000 milliseconds. | [optional] +**latency_1000_to_5000ms** | **int** | Number of responses from origin with latency between 1,000 and 5,000 milliseconds. | [optional] +**latency_5000_to_10000ms** | **int** | Number of responses from origin with latency between 5,000 and 10,000 milliseconds. | [optional] +**latency_10000_to_60000ms** | **int** | Number of responses from origin with latency between 10,000 and 60,000 milliseconds. | [optional] +**latency_60000ms** | **int** | Number of responses from origin with latency of 60,000 milliseconds and above. | [optional] +**waf_responses** | **int** | Number of responses received for origin requests made by the Fastly WAF. | [optional] +**waf_resp_header_bytes** | **int** | Number of header bytes received for origin requests made by the Fastly WAF. | [optional] +**waf_resp_body_bytes** | **int** | Number of body bytes received for origin requests made by the Fastly WAF. | [optional] +**waf_status_1xx** | **int** | Number of 1xx \"Informational\" status codes received for origin requests made by the Fastly WAF. | [optional] +**waf_status_2xx** | **int** | Number of 2xx \"Success\" status codes received for origin requests made by the Fastly WAF. | [optional] +**waf_status_3xx** | **int** | Number of 3xx \"Redirection\" codes received for origin requests made by the Fastly WAF. | [optional] +**waf_status_4xx** | **int** | Number of 4xx \"Client Error\" codes received for origin requests made by the Fastly WAF. | [optional] +**waf_status_5xx** | **int** | Number of 5xx \"Server Error\" codes received for origin requests made by the Fastly WAF. | [optional] +**waf_status_200** | **int** | Number of responses received with status code 200 (Success) received for origin requests made by the Fastly WAF. | [optional] +**waf_status_204** | **int** | Number of responses received with status code 204 (No Content) received for origin requests made by the Fastly WAF. | [optional] +**waf_status_206** | **int** | Number of responses received with status code 206 (Partial Content) received for origin requests made by the Fastly WAF. | [optional] +**waf_status_301** | **int** | Number of responses received with status code 301 (Moved Permanently) received for origin requests made by the Fastly WAF. | [optional] +**waf_status_302** | **int** | Number of responses received with status code 302 (Found) received for origin requests made by the Fastly WAF. | [optional] +**waf_status_304** | **int** | Number of responses received with status code 304 (Not Modified) received for origin requests made by the Fastly WAF. | [optional] +**waf_status_400** | **int** | Number of responses received with status code 400 (Bad Request) received for origin requests made by the Fastly WAF. | [optional] +**waf_status_401** | **int** | Number of responses received with status code 401 (Unauthorized) received for origin requests made by the Fastly WAF. | [optional] +**waf_status_403** | **int** | Number of responses received with status code 403 (Forbidden) received for origin requests made by the Fastly WAF. | [optional] +**waf_status_404** | **int** | Number of responses received with status code 404 (Not Found) received for origin requests made by the Fastly WAF. | [optional] +**waf_status_416** | **int** | Number of responses received with status code 416 (Range Not Satisfiable) received for origin requests made by the Fastly WAF. | [optional] +**waf_status_429** | **int** | Number of responses received with status code 429 (Too Many Requests) received for origin requests made by the Fastly WAF. | [optional] +**waf_status_500** | **int** | Number of responses received with status code 500 (Internal Server Error) received for origin requests made by the Fastly WAF. | [optional] +**waf_status_501** | **int** | Number of responses received with status code 501 (Not Implemented) received for origin requests made by the Fastly WAF. | [optional] +**waf_status_502** | **int** | Number of responses received with status code 502 (Bad Gateway) received for origin requests made by the Fastly WAF. | [optional] +**waf_status_503** | **int** | Number of responses received with status code 503 (Service Unavailable) received for origin requests made by the Fastly WAF. | [optional] +**waf_status_504** | **int** | Number of responses received with status code 504 (Gateway Timeout) received for origin requests made by the Fastly WAF. | [optional] +**waf_status_505** | **int** | Number of responses received with status code 505 (HTTP Version Not Supported) received for origin requests made by the Fastly WAF. | [optional] +**waf_latency_0_to_1ms** | **int** | Number of responses with latency between 0 and 1 millisecond received for origin requests made by the Fastly WAF. | [optional] +**waf_latency_1_to_5ms** | **int** | Number of responses with latency between 1 and 5 milliseconds received for origin requests made by the Fastly WAF. | [optional] +**waf_latency_5_to_10ms** | **int** | Number of responses with latency between 5 and 10 milliseconds received for origin requests made by the Fastly WAF. | [optional] +**waf_latency_10_to_50ms** | **int** | Number of responses with latency between 10 and 50 milliseconds received for origin requests made by the Fastly WAF. | [optional] +**waf_latency_50_to_100ms** | **int** | Number of responses with latency between 50 and 100 milliseconds received for origin requests made by the Fastly WAF. | [optional] +**waf_latency_100_to_250ms** | **int** | Number of responses with latency between 100 and 250 milliseconds received for origin requests made by the Fastly WAF. | [optional] +**waf_latency_250_to_500ms** | **int** | Number of responses with latency between 250 and 500 milliseconds received for origin requests made by the Fastly WAF. | [optional] +**waf_latency_500_to_1000ms** | **int** | Number of responses with latency between 500 and 1,000 milliseconds received for origin requests made by the Fastly WAF. | [optional] +**waf_latency_1000_to_5000ms** | **int** | Number of responses with latency between 1,000 and 5,000 milliseconds received for origin requests made by the Fastly WAF. | [optional] +**waf_latency_5000_to_10000ms** | **int** | Number of responses with latency between 5,000 and 10,000 milliseconds received for origin requests made by the Fastly WAF. | [optional] +**waf_latency_10000_to_60000ms** | **int** | Number of responses with latency between 10,000 and 60,000 milliseconds received for origin requests made by the Fastly WAF. | [optional] +**waf_latency_60000ms** | **int** | Number of responses with latency of 60,000 milliseconds and above received for origin requests made by the Fastly WAF. | [optional] +**compute_responses** | **int** | Number of responses for origin received by Compute@Edge. | [optional] +**compute_resp_header_bytes** | **int** | Number of header bytes for origin received by Compute@Edge. | [optional] +**compute_resp_body_bytes** | **int** | Number of body bytes for origin received by Compute@Edge. | [optional] +**compute_status_1xx** | **int** | Number of 1xx \"Informational\" status codes for origin received by Compute@Edge. | [optional] +**compute_status_2xx** | **int** | Number of 2xx \"Success\" status codes for origin received by Compute@Edge. | [optional] +**compute_status_3xx** | **int** | Number of 3xx \"Redirection\" codes for origin received by Compute@Edge. | [optional] +**compute_status_4xx** | **int** | Number of 4xx \"Client Error\" codes for origin received by Compute@Edge. | [optional] +**compute_status_5xx** | **int** | Number of 5xx \"Server Error\" codes for origin received by Compute@Edge. | [optional] +**compute_status_200** | **int** | Number of responses received with status code 200 (Success) for origin received by Compute@Edge. | [optional] +**compute_status_204** | **int** | Number of responses received with status code 204 (No Content) for origin received by Compute@Edge. | [optional] +**compute_status_206** | **int** | Number of responses received with status code 206 (Partial Content) for origin received by Compute@Edge. | [optional] +**compute_status_301** | **int** | Number of responses received with status code 301 (Moved Permanently) for origin received by Compute@Edge. | [optional] +**compute_status_302** | **int** | Number of responses received with status code 302 (Found) for origin received by Compute@Edge. | [optional] +**compute_status_304** | **int** | Number of responses received with status code 304 (Not Modified) for origin received by Compute@Edge. | [optional] +**compute_status_400** | **int** | Number of responses received with status code 400 (Bad Request) for origin received by Compute@Edge. | [optional] +**compute_status_401** | **int** | Number of responses received with status code 401 (Unauthorized) for origin received by Compute@Edge. | [optional] +**compute_status_403** | **int** | Number of responses received with status code 403 (Forbidden) for origin received by Compute@Edge. | [optional] +**compute_status_404** | **int** | Number of responses received with status code 404 (Not Found) for origin received by Compute@Edge. | [optional] +**compute_status_416** | **int** | Number of responses received with status code 416 (Range Not Satisfiable) for origin received by Compute@Edge. | [optional] +**compute_status_429** | **int** | Number of responses received with status code 429 (Too Many Requests) for origin received by Compute@Edge. | [optional] +**compute_status_500** | **int** | Number of responses received with status code 500 (Internal Server Error) for origin received by Compute@Edge. | [optional] +**compute_status_501** | **int** | Number of responses received with status code 501 (Not Implemented) for origin received by Compute@Edge. | [optional] +**compute_status_502** | **int** | Number of responses received with status code 502 (Bad Gateway) for origin received by Compute@Edge. | [optional] +**compute_status_503** | **int** | Number of responses received with status code 503 (Service Unavailable) for origin received by Compute@Edge. | [optional] +**compute_status_504** | **int** | Number of responses received with status code 504 (Gateway Timeout) for origin received by Compute@Edge. | [optional] +**compute_status_505** | **int** | Number of responses received with status code 505 (HTTP Version Not Supported) for origin received by Compute@Edge. | [optional] +**compute_latency_0_to_1ms** | **int** | Number of responses with latency between 0 and 1 millisecond for origin received by Compute@Edge. | [optional] +**compute_latency_1_to_5ms** | **int** | Number of responses with latency between 1 and 5 milliseconds for origin received by Compute@Edge. | [optional] +**compute_latency_5_to_10ms** | **int** | Number of responses with latency between 5 and 10 milliseconds for origin received by Compute@Edge. | [optional] +**compute_latency_10_to_50ms** | **int** | Number of responses with latency between 10 and 50 milliseconds for origin received by Compute@Edge. | [optional] +**compute_latency_50_to_100ms** | **int** | Number of responses with latency between 50 and 100 milliseconds for origin received by Compute@Edge. | [optional] +**compute_latency_100_to_250ms** | **int** | Number of responses with latency between 100 and 250 milliseconds for origin received by Compute@Edge. | [optional] +**compute_latency_250_to_500ms** | **int** | Number of responses with latency between 250 and 500 milliseconds for origin received by Compute@Edge. | [optional] +**compute_latency_500_to_1000ms** | **int** | Number of responses with latency between 500 and 1,000 milliseconds for origin received by Compute@Edge. | [optional] +**compute_latency_1000_to_5000ms** | **int** | Number of responses with latency between 1,000 and 5,000 milliseconds for origin received by Compute@Edge. | [optional] +**compute_latency_5000_to_10000ms** | **int** | Number of responses with latency between 5,000 and 10,000 milliseconds for origin received by Compute@Edge. | [optional] +**compute_latency_10000_to_60000ms** | **int** | Number of responses with latency between 10,000 and 60,000 milliseconds for origin received by Compute@Edge. | [optional] +**compute_latency_60000ms** | **int** | Number of responses with latency of 60,000 milliseconds and above for origin received by Compute@Edge. | [optional] +**all_responses** | **int** | Number of responses received for origin requests made by all sources. | [optional] +**all_resp_header_bytes** | **int** | Number of header bytes received for origin requests made by all sources. | [optional] +**all_resp_body_bytes** | **int** | Number of body bytes received for origin requests made by all sources. | [optional] +**all_status_1xx** | **int** | Number of 1xx \"Informational\" category status codes delivered received for origin requests made by all sources. | [optional] +**all_status_2xx** | **int** | Number of 2xx \"Success\" status codes received for origin requests made by all sources. | [optional] +**all_status_3xx** | **int** | Number of 3xx \"Redirection\" codes received for origin requests made by all sources. | [optional] +**all_status_4xx** | **int** | Number of 4xx \"Client Error\" codes received for origin requests made by all sources. | [optional] +**all_status_5xx** | **int** | Number of 5xx \"Server Error\" codes received for origin requests made by all sources. | [optional] +**all_status_200** | **int** | Number of responses received with status code 200 (Success) received for origin requests made by all sources. | [optional] +**all_status_204** | **int** | Number of responses received with status code 204 (No Content) received for origin requests made by all sources. | [optional] +**all_status_206** | **int** | Number of responses received with status code 206 (Partial Content) received for origin requests made by all sources. | [optional] +**all_status_301** | **int** | Number of responses received with status code 301 (Moved Permanently) received for origin requests made by all sources. | [optional] +**all_status_302** | **int** | Number of responses received with status code 302 (Found) received for origin requests made by all sources. | [optional] +**all_status_304** | **int** | Number of responses received with status code 304 (Not Modified) received for origin requests made by all sources. | [optional] +**all_status_400** | **int** | Number of responses received with status code 400 (Bad Request) received for origin requests made by all sources. | [optional] +**all_status_401** | **int** | Number of responses received with status code 401 (Unauthorized) received for origin requests made by all sources. | [optional] +**all_status_403** | **int** | Number of responses received with status code 403 (Forbidden) received for origin requests made by all sources. | [optional] +**all_status_404** | **int** | Number of responses received with status code 404 (Not Found) received for origin requests made by all sources. | [optional] +**all_status_416** | **int** | Number of responses received with status code 416 (Range Not Satisfiable) received for origin requests made by all sources. | [optional] +**all_status_429** | **int** | Number of responses received with status code 429 (Too Many Requests) received for origin requests made by all sources. | [optional] +**all_status_500** | **int** | Number of responses received with status code 500 (Internal Server Error) received for origin requests made by all sources. | [optional] +**all_status_501** | **int** | Number of responses received with status code 501 (Not Implemented) received for origin requests made by all sources. | [optional] +**all_status_502** | **int** | Number of responses received with status code 502 (Bad Gateway) received for origin requests made by all sources. | [optional] +**all_status_503** | **int** | Number of responses received with status code 503 (Service Unavailable) received for origin requests made by all sources. | [optional] +**all_status_504** | **int** | Number of responses received with status code 504 (Gateway Timeout) received for origin requests made by all sources. | [optional] +**all_status_505** | **int** | Number of responses received with status code 505 (HTTP Version Not Supported) received for origin requests made by all sources. | [optional] +**all_latency_0_to_1ms** | **int** | Number of responses with latency between 0 and 1 millisecond received for origin requests made by all sources. | [optional] +**all_latency_1_to_5ms** | **int** | Number of responses with latency between 1 and 5 milliseconds received for origin requests made by all sources. | [optional] +**all_latency_5_to_10ms** | **int** | Number of responses with latency between 5 and 10 milliseconds received for origin requests made by all sources. | [optional] +**all_latency_10_to_50ms** | **int** | Number of responses with latency between 10 and 50 milliseconds received for origin requests made by all sources. | [optional] +**all_latency_50_to_100ms** | **int** | Number of responses with latency between 50 and 100 milliseconds received for origin requests made by all sources. | [optional] +**all_latency_100_to_250ms** | **int** | Number of responses with latency between 100 and 250 milliseconds received for origin requests made by all sources. | [optional] +**all_latency_250_to_500ms** | **int** | Number of responses with latency between 250 and 500 milliseconds received for origin requests made by all sources. | [optional] +**all_latency_500_to_1000ms** | **int** | Number of responses with latency between 500 and 1,000 milliseconds received for origin requests made by all sources. | [optional] +**all_latency_1000_to_5000ms** | **int** | Number of responses with latency between 1,000 and 5,000 milliseconds received for origin requests made by all sources. | [optional] +**all_latency_5000_to_10000ms** | **int** | Number of responses with latency between 5,000 and 10,000 milliseconds received for origin requests made by all sources. | [optional] +**all_latency_10000_to_60000ms** | **int** | Number of responses with latency between 10,000 and 60,000 milliseconds received for origin requests made by all sources. | [optional] +**all_latency_60000ms** | **int** | Number of responses with latency of 60,000 milliseconds and above received for origin requests made by all sources. | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OriginInspectorRealtimeEntry.md b/docs/Model/OriginInspectorRealtimeEntry.md new file mode 100644 index 00000000..8718d275 --- /dev/null +++ b/docs/Model/OriginInspectorRealtimeEntry.md @@ -0,0 +1,12 @@ +# # OriginInspectorRealtimeEntry + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**recorded** | [**\Fastly\Model\OriginInspectorRealtimeEntryRecorded**](OriginInspectorRealtimeEntryRecorded.md) | | [optional] +**aggregated** | [**array<string,\Fastly\Model\OriginInspectorMeasurements>**](OriginInspectorMeasurements.md) | Groups [measurements](#measurements-data-model) by backend name. | [optional] +**datacenter** | **array<string,array<string,\Fastly\Model\OriginInspectorMeasurements>>** | Groups [measurements](#measurements-data-model) by POP, then backend name. See the [POPs API](/reference/api/utils/pops/) for details about POP identifiers. | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OriginInspectorRealtimeEntryRecorded.md b/docs/Model/OriginInspectorRealtimeEntryRecorded.md new file mode 100644 index 00000000..5bd81136 --- /dev/null +++ b/docs/Model/OriginInspectorRealtimeEntryRecorded.md @@ -0,0 +1,9 @@ +# # OriginInspectorRealtimeEntryRecorded + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OriginInspectorSubsequentRequestTimestamp.md b/docs/Model/OriginInspectorSubsequentRequestTimestamp.md new file mode 100644 index 00000000..2c532691 --- /dev/null +++ b/docs/Model/OriginInspectorSubsequentRequestTimestamp.md @@ -0,0 +1,9 @@ +# # OriginInspectorSubsequentRequestTimestamp + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OriginInspectorValues.md b/docs/Model/OriginInspectorValues.md new file mode 100644 index 00000000..7abbe946 --- /dev/null +++ b/docs/Model/OriginInspectorValues.md @@ -0,0 +1,161 @@ +# # OriginInspectorValues + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**responses** | **int** | Number of responses from origin. | [optional] +**resp_header_bytes** | **int** | Number of header bytes from origin. | [optional] +**resp_body_bytes** | **int** | Number of body bytes from origin. | [optional] +**status_1xx** | **int** | Number of 1xx \"Informational\" status codes delivered from origin. | [optional] +**status_2xx** | **int** | Number of 2xx \"Success\" status codes delivered from origin. | [optional] +**status_3xx** | **int** | Number of 3xx \"Redirection\" codes delivered from origin. | [optional] +**status_4xx** | **int** | Number of 4xx \"Client Error\" codes delivered from origin. | [optional] +**status_5xx** | **int** | Number of 5xx \"Server Error\" codes delivered from origin. | [optional] +**status_200** | **int** | Number of responses received with status code 200 (Success) from origin. | [optional] +**status_204** | **int** | Number of responses received with status code 204 (No Content) from origin. | [optional] +**status_206** | **int** | Number of responses received with status code 206 (Partial Content) from origin. | [optional] +**status_301** | **int** | Number of responses received with status code 301 (Moved Permanently) from origin. | [optional] +**status_302** | **int** | Number of responses received with status code 302 (Found) from origin. | [optional] +**status_304** | **int** | Number of responses received with status code 304 (Not Modified) from origin. | [optional] +**status_400** | **int** | Number of responses received with status code 400 (Bad Request) from origin. | [optional] +**status_401** | **int** | Number of responses received with status code 401 (Unauthorized) from origin. | [optional] +**status_403** | **int** | Number of responses received with status code 403 (Forbidden) from origin. | [optional] +**status_404** | **int** | Number of responses received with status code 404 (Not Found) from origin. | [optional] +**status_416** | **int** | Number of responses received with status code 416 (Range Not Satisfiable) from origin. | [optional] +**status_429** | **int** | Number of responses received with status code 429 (Too Many Requests) from origin. | [optional] +**status_500** | **int** | Number of responses received with status code 500 (Internal Server Error) from origin. | [optional] +**status_501** | **int** | Number of responses received with status code 501 (Not Implemented) from origin. | [optional] +**status_502** | **int** | Number of responses received with status code 502 (Bad Gateway) from origin. | [optional] +**status_503** | **int** | Number of responses received with status code 503 (Service Unavailable) from origin. | [optional] +**status_504** | **int** | Number of responses received with status code 504 (Gateway Timeout) from origin. | [optional] +**status_505** | **int** | Number of responses received with status code 505 (HTTP Version Not Supported) from origin. | [optional] +**latency_0_to_1ms** | **int** | Number of responses from origin with latency between 0 and 1 millisecond. | [optional] +**latency_1_to_5ms** | **int** | Number of responses from origin with latency between 1 and 5 milliseconds. | [optional] +**latency_5_to_10ms** | **int** | Number of responses from origin with latency between 5 and 10 milliseconds. | [optional] +**latency_10_to_50ms** | **int** | Number of responses from origin with latency between 10 and 50 milliseconds. | [optional] +**latency_50_to_100ms** | **int** | Number of responses from origin with latency between 50 and 100 milliseconds. | [optional] +**latency_100_to_250ms** | **int** | Number of responses from origin with latency between 100 and 250 milliseconds. | [optional] +**latency_250_to_500ms** | **int** | Number of responses from origin with latency between 250 and 500 milliseconds. | [optional] +**latency_500_to_1000ms** | **int** | Number of responses from origin with latency between 500 and 1,000 milliseconds. | [optional] +**latency_1000_to_5000ms** | **int** | Number of responses from origin with latency between 1,000 and 5,000 milliseconds. | [optional] +**latency_5000_to_10000ms** | **int** | Number of responses from origin with latency between 5,000 and 10,000 milliseconds. | [optional] +**latency_10000_to_60000ms** | **int** | Number of responses from origin with latency between 10,000 and 60,000 milliseconds. | [optional] +**latency_60000ms** | **int** | Number of responses from origin with latency of 60,000 milliseconds and above. | [optional] +**waf_responses** | **int** | Number of responses received for origin requests made by the Fastly WAF. | [optional] +**waf_resp_header_bytes** | **int** | Number of header bytes received for origin requests made by the Fastly WAF. | [optional] +**waf_resp_body_bytes** | **int** | Number of body bytes received for origin requests made by the Fastly WAF. | [optional] +**waf_status_1xx** | **int** | Number of 1xx \"Informational\" status codes received for origin requests made by the Fastly WAF. | [optional] +**waf_status_2xx** | **int** | Number of 2xx \"Success\" status codes received for origin requests made by the Fastly WAF. | [optional] +**waf_status_3xx** | **int** | Number of 3xx \"Redirection\" codes received for origin requests made by the Fastly WAF. | [optional] +**waf_status_4xx** | **int** | Number of 4xx \"Client Error\" codes received for origin requests made by the Fastly WAF. | [optional] +**waf_status_5xx** | **int** | Number of 5xx \"Server Error\" codes received for origin requests made by the Fastly WAF. | [optional] +**waf_status_200** | **int** | Number of responses received with status code 200 (Success) received for origin requests made by the Fastly WAF. | [optional] +**waf_status_204** | **int** | Number of responses received with status code 204 (No Content) received for origin requests made by the Fastly WAF. | [optional] +**waf_status_206** | **int** | Number of responses received with status code 206 (Partial Content) received for origin requests made by the Fastly WAF. | [optional] +**waf_status_301** | **int** | Number of responses received with status code 301 (Moved Permanently) received for origin requests made by the Fastly WAF. | [optional] +**waf_status_302** | **int** | Number of responses received with status code 302 (Found) received for origin requests made by the Fastly WAF. | [optional] +**waf_status_304** | **int** | Number of responses received with status code 304 (Not Modified) received for origin requests made by the Fastly WAF. | [optional] +**waf_status_400** | **int** | Number of responses received with status code 400 (Bad Request) received for origin requests made by the Fastly WAF. | [optional] +**waf_status_401** | **int** | Number of responses received with status code 401 (Unauthorized) received for origin requests made by the Fastly WAF. | [optional] +**waf_status_403** | **int** | Number of responses received with status code 403 (Forbidden) received for origin requests made by the Fastly WAF. | [optional] +**waf_status_404** | **int** | Number of responses received with status code 404 (Not Found) received for origin requests made by the Fastly WAF. | [optional] +**waf_status_416** | **int** | Number of responses received with status code 416 (Range Not Satisfiable) received for origin requests made by the Fastly WAF. | [optional] +**waf_status_429** | **int** | Number of responses received with status code 429 (Too Many Requests) received for origin requests made by the Fastly WAF. | [optional] +**waf_status_500** | **int** | Number of responses received with status code 500 (Internal Server Error) received for origin requests made by the Fastly WAF. | [optional] +**waf_status_501** | **int** | Number of responses received with status code 501 (Not Implemented) received for origin requests made by the Fastly WAF. | [optional] +**waf_status_502** | **int** | Number of responses received with status code 502 (Bad Gateway) received for origin requests made by the Fastly WAF. | [optional] +**waf_status_503** | **int** | Number of responses received with status code 503 (Service Unavailable) received for origin requests made by the Fastly WAF. | [optional] +**waf_status_504** | **int** | Number of responses received with status code 504 (Gateway Timeout) received for origin requests made by the Fastly WAF. | [optional] +**waf_status_505** | **int** | Number of responses received with status code 505 (HTTP Version Not Supported) received for origin requests made by the Fastly WAF. | [optional] +**waf_latency_0_to_1ms** | **int** | Number of responses with latency between 0 and 1 millisecond received for origin requests made by the Fastly WAF. | [optional] +**waf_latency_1_to_5ms** | **int** | Number of responses with latency between 1 and 5 milliseconds received for origin requests made by the Fastly WAF. | [optional] +**waf_latency_5_to_10ms** | **int** | Number of responses with latency between 5 and 10 milliseconds received for origin requests made by the Fastly WAF. | [optional] +**waf_latency_10_to_50ms** | **int** | Number of responses with latency between 10 and 50 milliseconds received for origin requests made by the Fastly WAF. | [optional] +**waf_latency_50_to_100ms** | **int** | Number of responses with latency between 50 and 100 milliseconds received for origin requests made by the Fastly WAF. | [optional] +**waf_latency_100_to_250ms** | **int** | Number of responses with latency between 100 and 250 milliseconds received for origin requests made by the Fastly WAF. | [optional] +**waf_latency_250_to_500ms** | **int** | Number of responses with latency between 250 and 500 milliseconds received for origin requests made by the Fastly WAF. | [optional] +**waf_latency_500_to_1000ms** | **int** | Number of responses with latency between 500 and 1,000 milliseconds received for origin requests made by the Fastly WAF. | [optional] +**waf_latency_1000_to_5000ms** | **int** | Number of responses with latency between 1,000 and 5,000 milliseconds received for origin requests made by the Fastly WAF. | [optional] +**waf_latency_5000_to_10000ms** | **int** | Number of responses with latency between 5,000 and 10,000 milliseconds received for origin requests made by the Fastly WAF. | [optional] +**waf_latency_10000_to_60000ms** | **int** | Number of responses with latency between 10,000 and 60,000 milliseconds received for origin requests made by the Fastly WAF. | [optional] +**waf_latency_60000ms** | **int** | Number of responses with latency of 60,000 milliseconds and above received for origin requests made by the Fastly WAF. | [optional] +**compute_responses** | **int** | Number of responses for origin received by Compute@Edge. | [optional] +**compute_resp_header_bytes** | **int** | Number of header bytes for origin received by Compute@Edge. | [optional] +**compute_resp_body_bytes** | **int** | Number of body bytes for origin received by Compute@Edge. | [optional] +**compute_status_1xx** | **int** | Number of 1xx \"Informational\" status codes for origin received by Compute@Edge. | [optional] +**compute_status_2xx** | **int** | Number of 2xx \"Success\" status codes for origin received by Compute@Edge. | [optional] +**compute_status_3xx** | **int** | Number of 3xx \"Redirection\" codes for origin received by Compute@Edge. | [optional] +**compute_status_4xx** | **int** | Number of 4xx \"Client Error\" codes for origin received by Compute@Edge. | [optional] +**compute_status_5xx** | **int** | Number of 5xx \"Server Error\" codes for origin received by Compute@Edge. | [optional] +**compute_status_200** | **int** | Number of responses received with status code 200 (Success) for origin received by Compute@Edge. | [optional] +**compute_status_204** | **int** | Number of responses received with status code 204 (No Content) for origin received by Compute@Edge. | [optional] +**compute_status_206** | **int** | Number of responses received with status code 206 (Partial Content) for origin received by Compute@Edge. | [optional] +**compute_status_301** | **int** | Number of responses received with status code 301 (Moved Permanently) for origin received by Compute@Edge. | [optional] +**compute_status_302** | **int** | Number of responses received with status code 302 (Found) for origin received by Compute@Edge. | [optional] +**compute_status_304** | **int** | Number of responses received with status code 304 (Not Modified) for origin received by Compute@Edge. | [optional] +**compute_status_400** | **int** | Number of responses received with status code 400 (Bad Request) for origin received by Compute@Edge. | [optional] +**compute_status_401** | **int** | Number of responses received with status code 401 (Unauthorized) for origin received by Compute@Edge. | [optional] +**compute_status_403** | **int** | Number of responses received with status code 403 (Forbidden) for origin received by Compute@Edge. | [optional] +**compute_status_404** | **int** | Number of responses received with status code 404 (Not Found) for origin received by Compute@Edge. | [optional] +**compute_status_416** | **int** | Number of responses received with status code 416 (Range Not Satisfiable) for origin received by Compute@Edge. | [optional] +**compute_status_429** | **int** | Number of responses received with status code 429 (Too Many Requests) for origin received by Compute@Edge. | [optional] +**compute_status_500** | **int** | Number of responses received with status code 500 (Internal Server Error) for origin received by Compute@Edge. | [optional] +**compute_status_501** | **int** | Number of responses received with status code 501 (Not Implemented) for origin received by Compute@Edge. | [optional] +**compute_status_502** | **int** | Number of responses received with status code 502 (Bad Gateway) for origin received by Compute@Edge. | [optional] +**compute_status_503** | **int** | Number of responses received with status code 503 (Service Unavailable) for origin received by Compute@Edge. | [optional] +**compute_status_504** | **int** | Number of responses received with status code 504 (Gateway Timeout) for origin received by Compute@Edge. | [optional] +**compute_status_505** | **int** | Number of responses received with status code 505 (HTTP Version Not Supported) for origin received by Compute@Edge. | [optional] +**compute_latency_0_to_1ms** | **int** | Number of responses with latency between 0 and 1 millisecond for origin received by Compute@Edge. | [optional] +**compute_latency_1_to_5ms** | **int** | Number of responses with latency between 1 and 5 milliseconds for origin received by Compute@Edge. | [optional] +**compute_latency_5_to_10ms** | **int** | Number of responses with latency between 5 and 10 milliseconds for origin received by Compute@Edge. | [optional] +**compute_latency_10_to_50ms** | **int** | Number of responses with latency between 10 and 50 milliseconds for origin received by Compute@Edge. | [optional] +**compute_latency_50_to_100ms** | **int** | Number of responses with latency between 50 and 100 milliseconds for origin received by Compute@Edge. | [optional] +**compute_latency_100_to_250ms** | **int** | Number of responses with latency between 100 and 250 milliseconds for origin received by Compute@Edge. | [optional] +**compute_latency_250_to_500ms** | **int** | Number of responses with latency between 250 and 500 milliseconds for origin received by Compute@Edge. | [optional] +**compute_latency_500_to_1000ms** | **int** | Number of responses with latency between 500 and 1,000 milliseconds for origin received by Compute@Edge. | [optional] +**compute_latency_1000_to_5000ms** | **int** | Number of responses with latency between 1,000 and 5,000 milliseconds for origin received by Compute@Edge. | [optional] +**compute_latency_5000_to_10000ms** | **int** | Number of responses with latency between 5,000 and 10,000 milliseconds for origin received by Compute@Edge. | [optional] +**compute_latency_10000_to_60000ms** | **int** | Number of responses with latency between 10,000 and 60,000 milliseconds for origin received by Compute@Edge. | [optional] +**compute_latency_60000ms** | **int** | Number of responses with latency of 60,000 milliseconds and above for origin received by Compute@Edge. | [optional] +**all_responses** | **int** | Number of responses received for origin requests made by all sources. | [optional] +**all_resp_header_bytes** | **int** | Number of header bytes received for origin requests made by all sources. | [optional] +**all_resp_body_bytes** | **int** | Number of body bytes received for origin requests made by all sources. | [optional] +**all_status_1xx** | **int** | Number of 1xx \"Informational\" category status codes delivered received for origin requests made by all sources. | [optional] +**all_status_2xx** | **int** | Number of 2xx \"Success\" status codes received for origin requests made by all sources. | [optional] +**all_status_3xx** | **int** | Number of 3xx \"Redirection\" codes received for origin requests made by all sources. | [optional] +**all_status_4xx** | **int** | Number of 4xx \"Client Error\" codes received for origin requests made by all sources. | [optional] +**all_status_5xx** | **int** | Number of 5xx \"Server Error\" codes received for origin requests made by all sources. | [optional] +**all_status_200** | **int** | Number of responses received with status code 200 (Success) received for origin requests made by all sources. | [optional] +**all_status_204** | **int** | Number of responses received with status code 204 (No Content) received for origin requests made by all sources. | [optional] +**all_status_206** | **int** | Number of responses received with status code 206 (Partial Content) received for origin requests made by all sources. | [optional] +**all_status_301** | **int** | Number of responses received with status code 301 (Moved Permanently) received for origin requests made by all sources. | [optional] +**all_status_302** | **int** | Number of responses received with status code 302 (Found) received for origin requests made by all sources. | [optional] +**all_status_304** | **int** | Number of responses received with status code 304 (Not Modified) received for origin requests made by all sources. | [optional] +**all_status_400** | **int** | Number of responses received with status code 400 (Bad Request) received for origin requests made by all sources. | [optional] +**all_status_401** | **int** | Number of responses received with status code 401 (Unauthorized) received for origin requests made by all sources. | [optional] +**all_status_403** | **int** | Number of responses received with status code 403 (Forbidden) received for origin requests made by all sources. | [optional] +**all_status_404** | **int** | Number of responses received with status code 404 (Not Found) received for origin requests made by all sources. | [optional] +**all_status_416** | **int** | Number of responses received with status code 416 (Range Not Satisfiable) received for origin requests made by all sources. | [optional] +**all_status_429** | **int** | Number of responses received with status code 429 (Too Many Requests) received for origin requests made by all sources. | [optional] +**all_status_500** | **int** | Number of responses received with status code 500 (Internal Server Error) received for origin requests made by all sources. | [optional] +**all_status_501** | **int** | Number of responses received with status code 501 (Not Implemented) received for origin requests made by all sources. | [optional] +**all_status_502** | **int** | Number of responses received with status code 502 (Bad Gateway) received for origin requests made by all sources. | [optional] +**all_status_503** | **int** | Number of responses received with status code 503 (Service Unavailable) received for origin requests made by all sources. | [optional] +**all_status_504** | **int** | Number of responses received with status code 504 (Gateway Timeout) received for origin requests made by all sources. | [optional] +**all_status_505** | **int** | Number of responses received with status code 505 (HTTP Version Not Supported) received for origin requests made by all sources. | [optional] +**all_latency_0_to_1ms** | **int** | Number of responses with latency between 0 and 1 millisecond received for origin requests made by all sources. | [optional] +**all_latency_1_to_5ms** | **int** | Number of responses with latency between 1 and 5 milliseconds received for origin requests made by all sources. | [optional] +**all_latency_5_to_10ms** | **int** | Number of responses with latency between 5 and 10 milliseconds received for origin requests made by all sources. | [optional] +**all_latency_10_to_50ms** | **int** | Number of responses with latency between 10 and 50 milliseconds received for origin requests made by all sources. | [optional] +**all_latency_50_to_100ms** | **int** | Number of responses with latency between 50 and 100 milliseconds received for origin requests made by all sources. | [optional] +**all_latency_100_to_250ms** | **int** | Number of responses with latency between 100 and 250 milliseconds received for origin requests made by all sources. | [optional] +**all_latency_250_to_500ms** | **int** | Number of responses with latency between 250 and 500 milliseconds received for origin requests made by all sources. | [optional] +**all_latency_500_to_1000ms** | **int** | Number of responses with latency between 500 and 1,000 milliseconds received for origin requests made by all sources. | [optional] +**all_latency_1000_to_5000ms** | **int** | Number of responses with latency between 1,000 and 5,000 milliseconds received for origin requests made by all sources. | [optional] +**all_latency_5000_to_10000ms** | **int** | Number of responses with latency between 5,000 and 10,000 milliseconds received for origin requests made by all sources. | [optional] +**all_latency_10000_to_60000ms** | **int** | Number of responses with latency between 10,000 and 60,000 milliseconds received for origin requests made by all sources. | [optional] +**all_latency_60000ms** | **int** | Number of responses with latency of 60,000 milliseconds and above received for origin requests made by all sources. | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PaginationCursorMeta.md b/docs/Model/PaginationCursorMeta.md new file mode 100644 index 00000000..72b7a52b --- /dev/null +++ b/docs/Model/PaginationCursorMeta.md @@ -0,0 +1,11 @@ +# # PaginationCursorMeta + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**next_cursor** | **string** | Cursor for the next page. | [optional] +**limit** | **int** | Maximum number of results returned. | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ReadOnlyServiceId.md b/docs/Model/ReadOnlyServiceId.md new file mode 100644 index 00000000..569e8f3d --- /dev/null +++ b/docs/Model/ReadOnlyServiceId.md @@ -0,0 +1,9 @@ +# # ReadOnlyServiceId + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ReadOnlyVersion.md b/docs/Model/ReadOnlyVersion.md new file mode 100644 index 00000000..51e7173d --- /dev/null +++ b/docs/Model/ReadOnlyVersion.md @@ -0,0 +1,9 @@ +# # ReadOnlyVersion + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RealtimeEntry.md b/docs/Model/RealtimeEntry.md index 60368f13..357ab144 100644 --- a/docs/Model/RealtimeEntry.md +++ b/docs/Model/RealtimeEntry.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**recorded** | **int** | The Unix timestamp at which this record's data was generated. | [optional] -**aggregated** | [**RealtimeMeasurements**](RealtimeMeasurements.md) | Aggregates [measurements](#measurements-data-model) across all Fastly POPs. | [optional] +**recorded** | [**\Fastly\Model\RealtimeEntryRecorded**](RealtimeEntryRecorded.md) | | [optional] +**aggregated** | [**\Fastly\Model\RealtimeEntryAggregated**](RealtimeEntryAggregated.md) | | [optional] **datacenter** | [**array<string,\Fastly\Model\RealtimeMeasurements>**](RealtimeMeasurements.md) | Groups [measurements](#measurements-data-model) by POP. See the [POPs API](/reference/api/utils/pops/) for details of POP identifiers. | [optional] diff --git a/docs/Model/RealtimeEntryAggregated.md b/docs/Model/RealtimeEntryAggregated.md new file mode 100644 index 00000000..462cc2df --- /dev/null +++ b/docs/Model/RealtimeEntryAggregated.md @@ -0,0 +1,227 @@ +# # RealtimeEntryAggregated + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**requests** | **int** | Number of requests processed. | [optional] +**logging** | **int** | Number of log lines sent (alias for `log`). | [optional] +**log** | **int** | Number of log lines sent. | [optional] +**resp_header_bytes** | **int** | Total header bytes delivered (edge_resp_header_bytes + shield_resp_header_bytes). | [optional] +**header_size** | **int** | Total header bytes delivered (alias for resp_header_bytes). | [optional] +**resp_body_bytes** | **int** | Total body bytes delivered (edge_resp_body_bytes + shield_resp_body_bytes). | [optional] +**body_size** | **int** | Total body bytes delivered (alias for resp_body_bytes). | [optional] +**hits** | **int** | Number of cache hits. | [optional] +**miss** | **int** | Number of cache misses. | [optional] +**pass** | **int** | Number of requests that passed through the CDN without being cached. | [optional] +**synth** | **int** | Number of requests that returned a synthetic response (i.e., response objects created with the `synthetic` VCL statement). | [optional] +**errors** | **int** | Number of cache errors. | [optional] +**hits_time** | **float** | Total amount of time spent processing cache hits (in seconds). | [optional] +**miss_time** | **float** | Total amount of time spent processing cache misses (in seconds). | [optional] +**miss_histogram** | **array<string,object>** | A histogram. Each key represents the upper bound of a span of 10 milliseconds and the values represent the number of requests to origin during that 10ms period. Any origin request that takes more than 60 seconds to return will be in the 60000 bucket. | [optional] +**compute_requests** | **int** | The total number of requests that were received for your service by Fastly. | [optional] +**compute_execution_time_ms** | **float** | The amount of active CPU time used to process your requests (in milliseconds). | [optional] +**compute_ram_used** | **int** | The amount of RAM used for your service by Fastly (in bytes). | [optional] +**compute_request_time_ms** | **float** | The total, actual amount of time used to process your requests, including active CPU time (in milliseconds). | [optional] +**compute_request_time_billed_ms** | **float** | The total amount of request processing time you will be billed for, measured in 50 millisecond increments. | [optional] +**shield** | **int** | Number of requests from edge to the shield POP. | [optional] +**ipv6** | **int** | Number of requests that were received over IPv6. | [optional] +**imgopto** | **int** | Number of responses that came from the Fastly Image Optimizer service. If the service receives 10 requests for an image, this stat will be 10 regardless of how many times the image was transformed. | [optional] +**imgopto_shield** | **int** | Number of responses that came from the Fastly Image Optimizer service via a shield. | [optional] +**imgopto_transforms** | **int** | Number of transforms performed by the Fastly Image Optimizer service. | [optional] +**otfp** | **int** | Number of responses that came from the Fastly On-the-Fly Packaging service for video-on-demand. | [optional] +**otfp_shield** | **int** | Number of responses that came from the Fastly On-the-Fly Packaging service for video-on-demand via a shield. | [optional] +**otfp_manifests** | **int** | Number of responses that were manifest files from the Fastly On-the-Fly Packaging service for video-on-demand. | [optional] +**video** | **int** | Number of responses with the video segment or video manifest MIME type (i.e., application/x-mpegurl, application/vnd.apple.mpegurl, application/f4m, application/dash+xml, application/vnd.ms-sstr+xml, ideo/mp2t, audio/aac, video/f4f, video/x-flv, video/mp4, audio/mp4). | [optional] +**pci** | **int** | Number of responses with the PCI flag turned on. | [optional] +**http2** | **int** | Number of requests received over HTTP/2. | [optional] +**http3** | **int** | Number of requests received over HTTP/3. | [optional] +**restarts** | **int** | Number of restarts performed. | [optional] +**req_header_bytes** | **int** | Total header bytes received. | [optional] +**req_body_bytes** | **int** | Total body bytes received. | [optional] +**bereq_header_bytes** | **int** | Total header bytes sent to origin. | [optional] +**bereq_body_bytes** | **int** | Total body bytes sent to origin. | [optional] +**waf_blocked** | **int** | Number of requests that triggered a WAF rule and were blocked. | [optional] +**waf_logged** | **int** | Number of requests that triggered a WAF rule and were logged. | [optional] +**waf_passed** | **int** | Number of requests that triggered a WAF rule and were passed. | [optional] +**attack_req_header_bytes** | **int** | Total header bytes received from requests that triggered a WAF rule. | [optional] +**attack_req_body_bytes** | **int** | Total body bytes received from requests that triggered a WAF rule. | [optional] +**attack_resp_synth_bytes** | **int** | Total bytes delivered for requests that triggered a WAF rule and returned a synthetic response. | [optional] +**attack_logged_req_header_bytes** | **int** | Total header bytes received from requests that triggered a WAF rule that was logged. | [optional] +**attack_logged_req_body_bytes** | **int** | Total body bytes received from requests that triggered a WAF rule that was logged. | [optional] +**attack_blocked_req_header_bytes** | **int** | Total header bytes received from requests that triggered a WAF rule that was blocked. | [optional] +**attack_blocked_req_body_bytes** | **int** | Total body bytes received from requests that triggered a WAF rule that was blocked. | [optional] +**attack_passed_req_header_bytes** | **int** | Total header bytes received from requests that triggered a WAF rule that was passed. | [optional] +**attack_passed_req_body_bytes** | **int** | Total body bytes received from requests that triggered a WAF rule that was passed. | [optional] +**shield_resp_header_bytes** | **int** | Total header bytes delivered via a shield. | [optional] +**shield_resp_body_bytes** | **int** | Total body bytes delivered via a shield. | [optional] +**otfp_resp_header_bytes** | **int** | Total header bytes delivered from the Fastly On-the-Fly Packaging service for video-on-demand. | [optional] +**otfp_resp_body_bytes** | **int** | Total body bytes delivered from the Fastly On-the-Fly Packaging service for video-on-demand. | [optional] +**otfp_shield_resp_header_bytes** | **int** | Total header bytes delivered via a shield for the Fastly On-the-Fly Packaging service for video-on-demand. | [optional] +**otfp_shield_resp_body_bytes** | **int** | Total body bytes delivered via a shield for the Fastly On-the-Fly Packaging service for video-on-demand. | [optional] +**otfp_shield_time** | **float** | Total amount of time spent delivering a response via a shield from the Fastly On-the-Fly Packaging service for video-on-demand (in seconds). | [optional] +**otfp_deliver_time** | **float** | Total amount of time spent delivering a response from the Fastly On-the-Fly Packaging service for video-on-demand (in seconds). | [optional] +**imgopto_resp_header_bytes** | **int** | Total header bytes delivered from the Fastly Image Optimizer service, including shield traffic. | [optional] +**imgopto_resp_body_bytes** | **int** | Total body bytes delivered from the Fastly Image Optimizer service, including shield traffic. | [optional] +**imgopto_shield_resp_header_bytes** | **int** | Total header bytes delivered via a shield from the Fastly Image Optimizer service. | [optional] +**imgopto_shield_resp_body_bytes** | **int** | Total body bytes delivered via a shield from the Fastly Image Optimizer service. | [optional] +**status_1xx** | **int** | Number of \"Informational\" category status codes delivered. | [optional] +**status_2xx** | **int** | Number of \"Success\" status codes delivered. | [optional] +**status_3xx** | **int** | Number of \"Redirection\" codes delivered. | [optional] +**status_4xx** | **int** | Number of \"Client Error\" codes delivered. | [optional] +**status_5xx** | **int** | Number of \"Server Error\" codes delivered. | [optional] +**status_200** | **int** | Number of responses sent with status code 200 (Success). | [optional] +**status_204** | **int** | Number of responses sent with status code 204 (No Content). | [optional] +**status_206** | **int** | Number of responses sent with status code 206 (Partial Content). | [optional] +**status_301** | **int** | Number of responses sent with status code 301 (Moved Permanently). | [optional] +**status_302** | **int** | Number of responses sent with status code 302 (Found). | [optional] +**status_304** | **int** | Number of responses sent with status code 304 (Not Modified). | [optional] +**status_400** | **int** | Number of responses sent with status code 400 (Bad Request). | [optional] +**status_401** | **int** | Number of responses sent with status code 401 (Unauthorized). | [optional] +**status_403** | **int** | Number of responses sent with status code 403 (Forbidden). | [optional] +**status_404** | **int** | Number of responses sent with status code 404 (Not Found). | [optional] +**status_406** | **int** | Number of responses sent with status code 406 (Not Acceptable). | [optional] +**status_416** | **int** | Number of responses sent with status code 416 (Range Not Satisfiable). | [optional] +**status_429** | **int** | Number of responses sent with status code 429 (Too Many Requests). | [optional] +**status_500** | **int** | Number of responses sent with status code 500 (Internal Server Error). | [optional] +**status_501** | **int** | Number of responses sent with status code 501 (Not Implemented). | [optional] +**status_502** | **int** | Number of responses sent with status code 502 (Bad Gateway). | [optional] +**status_503** | **int** | Number of responses sent with status code 503 (Service Unavailable). | [optional] +**status_504** | **int** | Number of responses sent with status code 504 (Gateway Timeout). | [optional] +**status_505** | **int** | Number of responses sent with status code 505 (HTTP Version Not Supported). | [optional] +**uncacheable** | **int** | Number of requests that were designated uncachable. | [optional] +**pass_time** | **float** | Total amount of time spent processing cache passes (in seconds). | [optional] +**tls** | **int** | Number of requests that were received over TLS. | [optional] +**tls_v10** | **int** | Number of requests received over TLS 1.0. | [optional] +**tls_v11** | **int** | Number of requests received over TLS 1.1. | [optional] +**tls_v12** | **int** | Number of requests received over TLS 1.2. | [optional] +**tls_v13** | **int** | Number of requests received over TLS 1.3. | [optional] +**object_size_1k** | **int** | Number of objects served that were under 1KB in size. | [optional] +**object_size_10k** | **int** | Number of objects served that were between 1KB and 10KB in size. | [optional] +**object_size_100k** | **int** | Number of objects served that were between 10KB and 100KB in size. | [optional] +**object_size_1m** | **int** | Number of objects served that were between 100KB and 1MB in size. | [optional] +**object_size_10m** | **int** | Number of objects served that were between 1MB and 10MB in size. | [optional] +**object_size_100m** | **int** | Number of objects served that were between 10MB and 100MB in size. | [optional] +**object_size_1g** | **int** | Number of objects served that were between 100MB and 1GB in size. | [optional] +**object_size_other** | **int** | Number of objects served that were larger than 1GB in size. | [optional] +**recv_sub_time** | **float** | Time spent inside the `vcl_recv` Varnish subroutine (in nanoseconds). | [optional] +**recv_sub_count** | **int** | Number of executions of the `vcl_recv` Varnish subroutine. | [optional] +**hash_sub_time** | **float** | Time spent inside the `vcl_hash` Varnish subroutine (in nanoseconds). | [optional] +**hash_sub_count** | **int** | Number of executions of the `vcl_hash` Varnish subroutine. | [optional] +**miss_sub_time** | **float** | Time spent inside the `vcl_miss` Varnish subroutine (in nanoseconds). | [optional] +**miss_sub_count** | **int** | Number of executions of the `vcl_miss` Varnish subroutine. | [optional] +**fetch_sub_time** | **float** | Time spent inside the `vcl_fetch` Varnish subroutine (in nanoseconds). | [optional] +**fetch_sub_count** | **int** | Number of executions of the `vcl_fetch` Varnish subroutine. | [optional] +**pass_sub_time** | **float** | Time spent inside the `vcl_pass` Varnish subroutine (in nanoseconds). | [optional] +**pass_sub_count** | **int** | Number of executions of the `vcl_pass` Varnish subroutine. | [optional] +**pipe_sub_time** | **float** | Time spent inside the `vcl_pipe` Varnish subroutine (in nanoseconds). | [optional] +**pipe_sub_count** | **int** | Number of executions of the `vcl_pipe` Varnish subroutine. | [optional] +**deliver_sub_time** | **float** | Time spent inside the `vcl_deliver` Varnish subroutine (in nanoseconds). | [optional] +**deliver_sub_count** | **int** | Number of executions of the `vcl_deliver` Varnish subroutine. | [optional] +**error_sub_time** | **float** | Time spent inside the `vcl_error` Varnish subroutine (in nanoseconds). | [optional] +**error_sub_count** | **int** | Number of executions of the `vcl_error` Varnish subroutine. | [optional] +**hit_sub_time** | **float** | Time spent inside the `vcl_hit` Varnish subroutine (in nanoseconds). | [optional] +**hit_sub_count** | **int** | Number of executions of the `vcl_hit` Varnish subroutine. | [optional] +**prehash_sub_time** | **float** | Time spent inside the `vcl_prehash` Varnish subroutine (in nanoseconds). | [optional] +**prehash_sub_count** | **int** | Number of executions of the `vcl_prehash` Varnish subroutine. | [optional] +**predeliver_sub_time** | **float** | Time spent inside the `vcl_predeliver` Varnish subroutine (in nanoseconds). | [optional] +**predeliver_sub_count** | **int** | Number of executions of the `vcl_predeliver` Varnish subroutine. | [optional] +**hit_resp_body_bytes** | **int** | Total body bytes delivered for cache hits. | [optional] +**miss_resp_body_bytes** | **int** | Total body bytes delivered for cache misses. | [optional] +**pass_resp_body_bytes** | **int** | Total body bytes delivered for cache passes. | [optional] +**compute_req_header_bytes** | **int** | Total header bytes received by Compute@Edge. | [optional] +**compute_req_body_bytes** | **int** | Total body bytes received by Compute@Edge. | [optional] +**compute_resp_header_bytes** | **int** | Total header bytes sent from Compute@Edge to end user. | [optional] +**compute_resp_body_bytes** | **int** | Total body bytes sent from Compute@Edge to end user. | [optional] +**imgvideo** | **int** | Number of video responses that came from the Fastly Image Optimizer service. | [optional] +**imgvideo_frames** | **int** | Number of video frames that came from the Fastly Image Optimizer service. A video frame is an individual image within a sequence of video. | [optional] +**imgvideo_resp_header_bytes** | **int** | Total header bytes of video delivered from the Fastly Image Optimizer service. | [optional] +**imgvideo_resp_body_bytes** | **int** | Total body bytes of video delivered from the Fastly Image Optimizer service. | [optional] +**imgvideo_shield** | **int** | Number of video responses delivered via a shield that came from the Fastly Image Optimizer service. | [optional] +**imgvideo_shield_frames** | **int** | Number of video frames delivered via a shield that came from the Fastly Image Optimizer service. A video frame is an individual image within a sequence of video. | [optional] +**imgvideo_shield_resp_header_bytes** | **int** | Total header bytes of video delivered via a shield from the Fastly Image Optimizer service. | [optional] +**imgvideo_shield_resp_body_bytes** | **int** | Total body bytes of video delivered via a shield from the Fastly Image Optimizer service. | [optional] +**log_bytes** | **int** | Total log bytes sent. | [optional] +**edge_requests** | **int** | Number of requests sent by end users to Fastly. | [optional] +**edge_resp_header_bytes** | **int** | Total header bytes delivered from Fastly to the end user. | [optional] +**edge_resp_body_bytes** | **int** | Total body bytes delivered from Fastly to the end user. | [optional] +**origin_revalidations** | **int** | Number of responses received from origin with a `304` status code in response to an `If-Modified-Since` or `If-None-Match` request. Under regular scenarios, a revalidation will imply a cache hit. However, if using Fastly Image Optimizer or segmented caching this may result in a cache miss. | [optional] +**origin_fetches** | **int** | Number of requests sent to origin. | [optional] +**origin_fetch_header_bytes** | **int** | Total request header bytes sent to origin. | [optional] +**origin_fetch_body_bytes** | **int** | Total request body bytes sent to origin. | [optional] +**origin_fetch_resp_header_bytes** | **int** | Total header bytes received from origin. | [optional] +**origin_fetch_resp_body_bytes** | **int** | Total body bytes received from origin. | [optional] +**shield_revalidations** | **int** | Number of responses received from origin with a `304` status code, in response to an `If-Modified-Since` or `If-None-Match` request to a shield. Under regular scenarios, a revalidation will imply a cache hit. However, if using segmented caching this may result in a cache miss. | [optional] +**shield_fetches** | **int** | Number of requests made from one Fastly POP to another, as part of shielding. | [optional] +**shield_fetch_header_bytes** | **int** | Total request header bytes sent to a shield. | [optional] +**shield_fetch_body_bytes** | **int** | Total request body bytes sent to a shield. | [optional] +**shield_fetch_resp_header_bytes** | **int** | Total response header bytes sent from a shield to the edge. | [optional] +**shield_fetch_resp_body_bytes** | **int** | Total response body bytes sent from a shield to the edge. | [optional] +**segblock_origin_fetches** | **int** | Number of `Range` requests to origin for segments of resources when using segmented caching. | [optional] +**segblock_shield_fetches** | **int** | Number of `Range` requests to a shield for segments of resources when using segmented caching. | [optional] +**compute_resp_status_1xx** | **int** | Number of \"Informational\" category status codes delivered by Compute@Edge. | [optional] +**compute_resp_status_2xx** | **int** | Number of \"Success\" category status codes delivered by Compute@Edge. | [optional] +**compute_resp_status_3xx** | **int** | Number of \"Redirection\" category status codes delivered by Compute@Edge. | [optional] +**compute_resp_status_4xx** | **int** | Number of \"Client Error\" category status codes delivered by Compute@Edge. | [optional] +**compute_resp_status_5xx** | **int** | Number of \"Server Error\" category status codes delivered by Compute@Edge. | [optional] +**edge_hit_requests** | **int** | Number of requests sent by end users to Fastly that resulted in a hit at the edge. | [optional] +**edge_miss_requests** | **int** | Number of requests sent by end users to Fastly that resulted in a miss at the edge. | [optional] +**compute_bereq_header_bytes** | **int** | Total header bytes sent to backends (origins) by Compute@Edge. | [optional] +**compute_bereq_body_bytes** | **int** | Total body bytes sent to backends (origins) by Compute@Edge. | [optional] +**compute_beresp_header_bytes** | **int** | Total header bytes received from backends (origins) by Compute@Edge. | [optional] +**compute_beresp_body_bytes** | **int** | Total body bytes received from backends (origins) by Compute@Edge. | [optional] +**origin_cache_fetches** | **int** | The total number of completed requests made to backends (origins) that returned cacheable content. | [optional] +**shield_cache_fetches** | **int** | The total number of completed requests made to shields that returned cacheable content. | [optional] +**compute_bereqs** | **int** | Number of backend requests started. | [optional] +**compute_bereq_errors** | **int** | Number of backend request errors, including timeouts. | [optional] +**compute_resource_limit_exceeded** | **int** | Number of times a guest exceeded its resource limit, includes heap, stack, globals, and code execution timeout. | [optional] +**compute_heap_limit_exceeded** | **int** | Number of times a guest exceeded its heap limit. | [optional] +**compute_stack_limit_exceeded** | **int** | Number of times a guest exceeded its stack limit. | [optional] +**compute_globals_limit_exceeded** | **int** | Number of times a guest exceeded its globals limit. | [optional] +**compute_guest_errors** | **int** | Number of times a service experienced a guest code error. | [optional] +**compute_runtime_errors** | **int** | Number of times a service experienced a guest runtime error. | [optional] +**edge_hit_resp_body_bytes** | **int** | Body bytes delivered for edge hits. | [optional] +**edge_hit_resp_header_bytes** | **int** | Header bytes delivered for edge hits. | [optional] +**edge_miss_resp_body_bytes** | **int** | Body bytes delivered for edge misses. | [optional] +**edge_miss_resp_header_bytes** | **int** | Header bytes delivered for edge misses. | [optional] +**origin_cache_fetch_resp_body_bytes** | **int** | Body bytes received from origin for cacheable content. | [optional] +**origin_cache_fetch_resp_header_bytes** | **int** | Header bytes received from an origin for cacheable content. | [optional] +**shield_hit_requests** | **int** | Number of requests that resulted in a hit at a shield. | [optional] +**shield_miss_requests** | **int** | Number of requests that resulted in a miss at a shield. | [optional] +**shield_hit_resp_header_bytes** | **int** | Header bytes delivered for shield hits. | [optional] +**shield_hit_resp_body_bytes** | **int** | Body bytes delivered for shield hits. | [optional] +**shield_miss_resp_header_bytes** | **int** | Header bytes delivered for shield misses. | [optional] +**shield_miss_resp_body_bytes** | **int** | Body bytes delivered for shield misses. | [optional] +**websocket_req_header_bytes** | **int** | Total header bytes received from end users over passthrough WebSocket connections. | [optional] +**websocket_req_body_bytes** | **int** | Total message content bytes received from end users over passthrough WebSocket connections. | [optional] +**websocket_resp_header_bytes** | **int** | Total header bytes sent to end users over passthrough WebSocket connections. | [optional] +**websocket_bereq_header_bytes** | **int** | Total header bytes sent to backends over passthrough WebSocket connections. | [optional] +**websocket_bereq_body_bytes** | **int** | Total message content bytes sent to backends over passthrough WebSocket connections. | [optional] +**websocket_beresp_header_bytes** | **int** | Total header bytes received from backends over passthrough WebSocket connections. | [optional] +**websocket_beresp_body_bytes** | **int** | Total message content bytes received from backends over passthrough WebSocket connections. | [optional] +**websocket_conn_time_ms** | **int** | Total duration of passthrough WebSocket connections with end users. | [optional] +**websocket_resp_body_bytes** | **int** | Total message content bytes sent to end users over passthrough WebSocket connections. | [optional] +**fanout_recv_publishes** | **int** | Total published messages received from the publish API endpoint. | [optional] +**fanout_send_publishes** | **int** | Total published messages sent to end users. | [optional] +**kv_store_class_a_operations** | **int** | The total number of class a operations for the KV store. | [optional] +**kv_store_class_b_operations** | **int** | The total number of class b operations for the KV store. | [optional] +**object_store_class_a_operations** | **int** | Use kv_store_class_a_operations. | [optional] +**object_store_class_b_operations** | **int** | Use kv_store_class_b_operations. | [optional] +**fanout_req_header_bytes** | **int** | Total header bytes received from end users over Fanout connections. | [optional] +**fanout_req_body_bytes** | **int** | Total body or message content bytes received from end users over Fanout connections. | [optional] +**fanout_resp_header_bytes** | **int** | Total header bytes sent to end users over Fanout connections. | [optional] +**fanout_resp_body_bytes** | **int** | Total body or message content bytes sent to end users over Fanout connections, excluding published message content. | [optional] +**fanout_bereq_header_bytes** | **int** | Total header bytes sent to backends over Fanout connections. | [optional] +**fanout_bereq_body_bytes** | **int** | Total body or message content bytes sent to backends over Fanout connections. | [optional] +**fanout_beresp_header_bytes** | **int** | Total header bytes received from backends over Fanout connections. | [optional] +**fanout_beresp_body_bytes** | **int** | Total body or message content bytes received from backends over Fanout connections. | [optional] +**fanout_conn_time_ms** | **int** | Total duration of Fanout connections with end users. | [optional] +**ddos_action_limit_streams_connections** | **int** | For HTTP/2, the number of connections the limit-streams action was applied to. The limit-streams action caps the allowed number of concurrent streams in a connection. | [optional] +**ddos_action_limit_streams_requests** | **int** | For HTTP/2, the number of requests made on a connection for which the limit-streams action was taken. The limit-streams action caps the allowed number of concurrent streams in a connection. | [optional] +**ddos_action_tarpit_accept** | **int** | The number of times the tarpit-accept action was taken. The tarpit-accept action adds a delay when accepting future connections. | [optional] +**ddos_action_tarpit** | **int** | The number of times the tarpit action was taken. The tarpit action delays writing the response to the client. | [optional] +**ddos_action_close** | **int** | The number of times the close action was taken. The close action aborts the connection as soon as possible. The close action takes effect either right after accept, right after the client hello, or right after the response was sent. | [optional] +**ddos_action_blackhole** | **int** | The number of times the blackhole action was taken. The blackhole action quietly closes a TCP connection without sending a reset. The blackhole action quietly closes a TCP connection without notifying its peer (all TCP state is dropped). | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RealtimeEntryRecorded.md b/docs/Model/RealtimeEntryRecorded.md new file mode 100644 index 00000000..89b368e8 --- /dev/null +++ b/docs/Model/RealtimeEntryRecorded.md @@ -0,0 +1,9 @@ +# # RealtimeEntryRecorded + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + +[[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 5025cb48..2aab6ead 100644 --- a/docs/Model/RealtimeMeasurements.md +++ b/docs/Model/RealtimeMeasurements.md @@ -18,7 +18,7 @@ Name | Type | Description | Notes **errors** | **int** | Number of cache errors. | [optional] **hits_time** | **float** | Total amount of time spent processing cache hits (in seconds). | [optional] **miss_time** | **float** | Total amount of time spent processing cache misses (in seconds). | [optional] -**miss_histogram** | **object** | A histogram. Each key represents the upper bound of a span of 10 milliseconds and the values represent the number of requests to origin during that 10ms period. Any origin request that takes more than 60 seconds to return will be in the 60000 bucket. | [optional] +**miss_histogram** | **array<string,object>** | A histogram. Each key represents the upper bound of a span of 10 milliseconds and the values represent the number of requests to origin during that 10ms period. Any origin request that takes more than 60 seconds to return will be in the 60000 bucket. | [optional] **compute_requests** | **int** | The total number of requests that were received for your service by Fastly. | [optional] **compute_execution_time_ms** | **float** | The amount of active CPU time used to process your requests (in milliseconds). | [optional] **compute_ram_used** | **int** | The amount of RAM used for your service by Fastly (in bytes). | [optional] diff --git a/docs/Model/RecordedTimestamp.md b/docs/Model/RecordedTimestamp.md new file mode 100644 index 00000000..047347ec --- /dev/null +++ b/docs/Model/RecordedTimestamp.md @@ -0,0 +1,9 @@ +# # RecordedTimestamp + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Secret.md b/docs/Model/Secret.md new file mode 100644 index 00000000..bf3e17f5 --- /dev/null +++ b/docs/Model/Secret.md @@ -0,0 +1,12 @@ +# # Secret + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | A human-readable name for the secret. The value must contain only letters, numbers, dashes (`-`), underscores (`_`), and periods (`.`). | [optional] +**secret** | **string** | A Base64-encoded string containing either the secret or the encrypted secret (when using client_key). The maximum secret size (before Base64 encoding and optional local encryption) is 64KB. | [optional] +**client_key** | **string** | The Base64-encoded string containing the client key used to encrypt the secret, if applicable. | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SecretResponse.md b/docs/Model/SecretResponse.md new file mode 100644 index 00000000..6eb30af8 --- /dev/null +++ b/docs/Model/SecretResponse.md @@ -0,0 +1,13 @@ +# # SecretResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | Name of the secret. | [optional] +**digest** | **string** | An opaque identifier of the plaintext secret value. This can be used to determine if a secret value has changed. | [optional] [readonly] +**created_at** | **\DateTime** | Date and time in ISO 8601 format. | [optional] [readonly] +**recreated** | **bool** | True if the secret replaced a secret with the same name. | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SecretStore.md b/docs/Model/SecretStore.md new file mode 100644 index 00000000..ddf005e0 --- /dev/null +++ b/docs/Model/SecretStore.md @@ -0,0 +1,10 @@ +# # SecretStore + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | A human-readable name for the store. The value must contain only letters, numbers, dashes (`-`), underscores (`_`), or periods (`.`). | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SecretStoreResponse.md b/docs/Model/SecretStoreResponse.md new file mode 100644 index 00000000..3ad5819e --- /dev/null +++ b/docs/Model/SecretStoreResponse.md @@ -0,0 +1,12 @@ +# # SecretStoreResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | ID of the store. | [optional] +**name** | **string** | A human-readable name for the store. | [optional] +**created_at** | **\DateTime** | Date and time in ISO 8601 format. | [optional] [readonly] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SigningKey.md b/docs/Model/SigningKey.md new file mode 100644 index 00000000..e81bb05e --- /dev/null +++ b/docs/Model/SigningKey.md @@ -0,0 +1,10 @@ +# # SigningKey + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**signing_key** | **string** | A Base64-encoded Ed25519 public key that can be used to verify signatures of client keys. | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SubsequentRequestTimestamp.md b/docs/Model/SubsequentRequestTimestamp.md new file mode 100644 index 00000000..b8c21fe8 --- /dev/null +++ b/docs/Model/SubsequentRequestTimestamp.md @@ -0,0 +1,9 @@ +# # SubsequentRequestTimestamp + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SudoGenericTokenError.md b/docs/Model/SudoGenericTokenError.md new file mode 100644 index 00000000..62585536 --- /dev/null +++ b/docs/Model/SudoGenericTokenError.md @@ -0,0 +1,10 @@ +# # SudoGenericTokenError + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**msg** | **string** | | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SudoRequest.md b/docs/Model/SudoRequest.md new file mode 100644 index 00000000..effec7e2 --- /dev/null +++ b/docs/Model/SudoRequest.md @@ -0,0 +1,12 @@ +# # SudoRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**username** | **string** | | +**password** | **string** | | +**expiry_time** | **string** | | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SudoResponse.md b/docs/Model/SudoResponse.md new file mode 100644 index 00000000..d0be730f --- /dev/null +++ b/docs/Model/SudoResponse.md @@ -0,0 +1,10 @@ +# # SudoResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**expiry_time** | **\DateTime** | A UTC time-stamp of when sudo access will expire. If blank, sudo access expires five minutes after the request. | [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 new file mode 100644 index 00000000..ffbc054b --- /dev/null +++ b/docs/Model/Values.md @@ -0,0 +1,71 @@ +# # Values + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**edge_requests** | **int** | Number of requests sent by end users to Fastly. | [optional] +**edge_resp_header_bytes** | **int** | Total header bytes delivered from Fastly to the end user. | [optional] +**edge_resp_body_bytes** | **int** | Total body bytes delivered from Fastly to the end user. | [optional] +**status_1xx** | **int** | Number of 1xx \"Informational\" category status codes delivered. | [optional] +**status_2xx** | **int** | Number of 2xx \"Success\" status codes delivered. | [optional] +**status_3xx** | **int** | Number of 3xx \"Redirection\" codes delivered. | [optional] +**status_4xx** | **int** | Number of 4xx \"Client Error\" codes delivered. | [optional] +**status_5xx** | **int** | Number of 5xx \"Server Error\" codes delivered. | [optional] +**status_200** | **int** | Number of responses delivered with status code 200 (Success). | [optional] +**status_204** | **int** | Number of responses delivered with status code 204 (No Content). | [optional] +**status_206** | **int** | Number of responses delivered with status code 206 (Partial Content). | [optional] +**status_301** | **int** | Number of responses delivered with status code 301 (Moved Permanently). | [optional] +**status_302** | **int** | Number of responses delivered with status code 302 (Found). | [optional] +**status_304** | **int** | Number of responses delivered with status code 304 (Not Modified). | [optional] +**status_400** | **int** | Number of responses delivered with status code 400 (Bad Request). | [optional] +**status_401** | **int** | Number of responses delivered with status code 401 (Unauthorized). | [optional] +**status_403** | **int** | Number of responses delivered with status code 403 (Forbidden). | [optional] +**status_404** | **int** | Number of responses delivered with status code 404 (Not Found). | [optional] +**status_416** | **int** | Number of responses delivered with status code 416 (Range Not Satisfiable). | [optional] +**status_429** | **int** | Number of responses delivered with status code 429 (Too Many Requests). | [optional] +**status_500** | **int** | Number of responses delivered with status code 500 (Internal Server Error). | [optional] +**status_501** | **int** | Number of responses delivered with status code 501 (Not Implemented). | [optional] +**status_502** | **int** | Number of responses delivered with status code 502 (Bad Gateway). | [optional] +**status_503** | **int** | Number of responses delivered with status code 503 (Service Unavailable). | [optional] +**status_504** | **int** | Number of responses delivered with status code 504 (Gateway Timeout). | [optional] +**status_505** | **int** | Number of responses delivered with status code 505 (HTTP Version Not Supported). | [optional] +**requests** | **int** | Number of requests processed. | [optional] +**resp_header_bytes** | **int** | Total header bytes delivered. | [optional] +**resp_body_bytes** | **int** | Total body bytes delivered. | [optional] +**bereq_header_bytes** | **int** | Total header bytes sent to origin. | [optional] +**bereq_body_bytes** | **int** | Total body bytes sent to origin. | [optional] +**edge_hit_requests** | **int** | Number of requests sent by end users to Fastly that resulted in a hit at the edge. | [optional] +**edge_miss_requests** | **int** | Number of requests sent by end users to Fastly that resulted in a miss at the edge. | [optional] +**origin_fetches** | **int** | Number of requests sent to origin. | [optional] +**origin_fetch_resp_header_bytes** | **int** | Total header bytes received from origin. | [optional] +**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_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] +**origin_status_301** | **int** | Number of responses received from origin with status code 301 (Moved Permanently). | [optional] +**origin_status_302** | **int** | Number of responses received from origin with status code 302 (Found). | [optional] +**origin_status_304** | **int** | Number of responses received from origin with status code 304 (Not Modified). | [optional] +**origin_status_400** | **int** | Number of responses received from origin with status code 400 (Bad Request). | [optional] +**origin_status_401** | **int** | Number of responses received from origin with status code 401 (Unauthorized). | [optional] +**origin_status_403** | **int** | Number of responses received from origin with status code 403 (Forbidden). | [optional] +**origin_status_404** | **int** | Number of responses received from origin with status code 404 (Not Found). | [optional] +**origin_status_416** | **int** | Number of responses received from origin with status code 416 (Range Not Satisfiable). | [optional] +**origin_status_429** | **int** | Number of responses received from origin with status code 429 (Too Many Requests). | [optional] +**origin_status_500** | **int** | Number of responses received from origin with status code 500 (Internal Server Error). | [optional] +**origin_status_501** | **int** | Number of responses received from origin with status code 501 (Not Implemented). | [optional] +**origin_status_502** | **int** | Number of responses received from origin with status code 502 (Bad Gateway). | [optional] +**origin_status_503** | **int** | Number of responses received from origin with status code 503 (Service Unavailable). | [optional] +**origin_status_504** | **int** | Number of responses received from origin with status code 504 (Gateway Timeout). | [optional] +**origin_status_505** | **int** | Number of responses received from origin with status code 505 (HTTP Version Not Supported). | [optional] +**origin_status_1xx** | **int** | Number of \"Informational\" category status codes received from origin. | [optional] +**origin_status_2xx** | **int** | Number of \"Success\" status codes received from origin. | [optional] +**origin_status_3xx** | **int** | Number of \"Redirection\" codes received from origin. | [optional] +**origin_status_4xx** | **int** | Number of \"Client Error\" codes received from origin. | [optional] +**origin_status_5xx** | **int** | Number of \"Server Error\" codes received from origin. | [optional] + + +[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/lib/Api/ApexRedirectApi.php b/lib/Api/ApexRedirectApi.php index dfa2d9f5..7228a7a9 100644 --- a/lib/Api/ApexRedirectApi.php +++ b/lib/Api/ApexRedirectApi.php @@ -109,6 +109,436 @@ public function getConfig() return $this->config; } + /** + * Operation createApexRedirect + * + * Create an apex redirect + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param string $service_id service_id (optional) + * @param int $version version (optional) + * @param \DateTime $created_at Date and time in ISO 8601 format. (optional) + * @param \DateTime $deleted_at Date and time in ISO 8601 format. (optional) + * @param \DateTime $updated_at Date and time in ISO 8601 format. (optional) + * @param int $status_code HTTP status code used to redirect the client. (optional) + * @param string[] $domains Array of apex domains that should redirect to their WWW subdomain. (optional) + * @param int $feature_revision Revision number of the apex redirect feature implementation. Defaults to the most recent revision. (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Fastly\Model\ApexRedirect + */ + public function createApexRedirect($options) + { + list($response) = $this->createApexRedirectWithHttpInfo($options); + return $response; + } + + /** + * Operation createApexRedirectWithHttpInfo + * + * Create an apex redirect + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param string $service_id (optional) + * @param int $version (optional) + * @param \DateTime $created_at Date and time in ISO 8601 format. (optional) + * @param \DateTime $deleted_at Date and time in ISO 8601 format. (optional) + * @param \DateTime $updated_at Date and time in ISO 8601 format. (optional) + * @param int $status_code HTTP status code used to redirect the client. (optional) + * @param string[] $domains Array of apex domains that should redirect to their WWW subdomain. (optional) + * @param int $feature_revision Revision number of the apex redirect feature implementation. Defaults to the most recent revision. (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Fastly\Model\ApexRedirect, HTTP status code, HTTP response headers (array of strings) + */ + public function createApexRedirectWithHttpInfo($options) + { + $request = $this->createApexRedirectRequest($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\ApexRedirect' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\ApexRedirect', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Fastly\Model\ApexRedirect'; + 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\ApexRedirect', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createApexRedirectAsync + * + * Create an apex redirect + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param string $service_id (optional) + * @param int $version (optional) + * @param \DateTime $created_at Date and time in ISO 8601 format. (optional) + * @param \DateTime $deleted_at Date and time in ISO 8601 format. (optional) + * @param \DateTime $updated_at Date and time in ISO 8601 format. (optional) + * @param int $status_code HTTP status code used to redirect the client. (optional) + * @param string[] $domains Array of apex domains that should redirect to their WWW subdomain. (optional) + * @param int $feature_revision Revision number of the apex redirect feature implementation. Defaults to the most recent revision. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createApexRedirectAsync($options) + { + return $this->createApexRedirectAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createApexRedirectAsyncWithHttpInfo + * + * Create an apex redirect + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param string $service_id (optional) + * @param int $version (optional) + * @param \DateTime $created_at Date and time in ISO 8601 format. (optional) + * @param \DateTime $deleted_at Date and time in ISO 8601 format. (optional) + * @param \DateTime $updated_at Date and time in ISO 8601 format. (optional) + * @param int $status_code HTTP status code used to redirect the client. (optional) + * @param string[] $domains Array of apex domains that should redirect to their WWW subdomain. (optional) + * @param int $feature_revision Revision number of the apex redirect feature implementation. Defaults to the most recent revision. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createApexRedirectAsyncWithHttpInfo($options) + { + $returnType = '\Fastly\Model\ApexRedirect'; + $request = $this->createApexRedirectRequest($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 'createApexRedirect' + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param string $service_id (optional) + * @param int $version (optional) + * @param \DateTime $created_at Date and time in ISO 8601 format. (optional) + * @param \DateTime $deleted_at Date and time in ISO 8601 format. (optional) + * @param \DateTime $updated_at Date and time in ISO 8601 format. (optional) + * @param int $status_code HTTP status code used to redirect the client. (optional) + * @param string[] $domains Array of apex domains that should redirect to their WWW subdomain. (optional) + * @param int $feature_revision Revision number of the apex redirect feature implementation. Defaults to the most recent revision. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createApexRedirectRequest($options) + { + // unbox the parameters from the associative array + $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null; + $version_id = array_key_exists('version_id', $options) ? $options['version_id'] : null; + $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null; + $version = array_key_exists('version', $options) ? $options['version'] : null; + $created_at = array_key_exists('created_at', $options) ? $options['created_at'] : null; + $deleted_at = array_key_exists('deleted_at', $options) ? $options['deleted_at'] : null; + $updated_at = array_key_exists('updated_at', $options) ? $options['updated_at'] : null; + $status_code = array_key_exists('status_code', $options) ? $options['status_code'] : null; + $domains = array_key_exists('domains', $options) ? $options['domains'] : null; + $feature_revision = array_key_exists('feature_revision', $options) ? $options['feature_revision'] : null; + + // verify the required parameter 'service_id' is set + if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $service_id when calling createApexRedirect' + ); + } + // verify the required parameter 'version_id' is set + if ($version_id === null || (is_array($version_id) && count($version_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $version_id when calling createApexRedirect' + ); + } + if ($domains !== null && count($domains) < 1) { + throw new \InvalidArgumentException('invalid value for "$domains" when calling ApexRedirectApi.createApexRedirect, number of items must be greater than or equal to 1.'); + } + + if ($feature_revision !== null && $feature_revision < 1) { + throw new \InvalidArgumentException('invalid value for "$feature_revision" when calling ApexRedirectApi.createApexRedirect, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/service/{service_id}/version/{version_id}/apex-redirects'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($service_id !== null) { + $resourcePath = str_replace( + '{' . 'service_id' . '}', + ObjectSerializer::toPathValue($service_id), + $resourcePath + ); + } + // path params + if ($version_id !== null) { + $resourcePath = str_replace( + '{' . 'version_id' . '}', + ObjectSerializer::toPathValue($version_id), + $resourcePath + ); + } + + // form params + if ($service_id !== null) { + $formParams['service_id'] = ObjectSerializer::toFormValue($service_id); + } + // form params + if ($version !== null) { + $formParams['version'] = ObjectSerializer::toFormValue($version); + } + // form params + if ($created_at !== null) { + $formParams['created_at'] = ObjectSerializer::toFormValue($created_at); + } + // form params + if ($deleted_at !== null) { + $formParams['deleted_at'] = ObjectSerializer::toFormValue($deleted_at); + } + // form params + if ($updated_at !== null) { + $formParams['updated_at'] = ObjectSerializer::toFormValue($updated_at); + } + // form params + if ($status_code !== null) { + $formParams['status_code'] = ObjectSerializer::toFormValue($status_code); + } + // form params + if ($domains !== null) { + $formParams['domains'] = ObjectSerializer::toFormValue($domains); + } + // form params + if ($feature_revision !== null) { + $formParams['feature_revision'] = ObjectSerializer::toFormValue($feature_revision); + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/x-www-form-urlencoded'] + ); + } + + // 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( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation deleteApexRedirect * diff --git a/lib/Api/ContactApi.php b/lib/Api/ContactApi.php index 5fc23fd1..d0e39466 100644 --- a/lib/Api/ContactApi.php +++ b/lib/Api/ContactApi.php @@ -109,6 +109,388 @@ public function getConfig() return $this->config; } + /** + * Operation createContacts + * + * Add a new customer contact + * + * 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 $user_id The alphanumeric string representing the user for this customer contact. (optional) + * @param string $contact_type The type of contact. (optional) + * @param string $name The name of this contact, when user_id is not provided. (optional) + * @param string $email The email of this contact, when a user_id is not provided. (optional) + * @param string $phone The phone number for this contact. Required for primary, technical, and security contact types. (optional) + * @param string $customer_id The alphanumeric string representing the customer for this customer contact. (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Fastly\Model\ContactResponse + */ + public function createContacts($options) + { + list($response) = $this->createContactsWithHttpInfo($options); + return $response; + } + + /** + * Operation createContactsWithHttpInfo + * + * Add a new customer contact + * + * 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 $user_id The alphanumeric string representing the user for this customer contact. (optional) + * @param string $contact_type The type of contact. (optional) + * @param string $name The name of this contact, when user_id is not provided. (optional) + * @param string $email The email of this contact, when a user_id is not provided. (optional) + * @param string $phone The phone number for this contact. Required for primary, technical, and security contact types. (optional) + * @param string $customer_id The alphanumeric string representing the customer for this customer contact. (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Fastly\Model\ContactResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function createContactsWithHttpInfo($options) + { + $request = $this->createContactsRequest($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\ContactResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\ContactResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Fastly\Model\ContactResponse'; + 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\ContactResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createContactsAsync + * + * Add a new customer contact + * + * 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 $user_id The alphanumeric string representing the user for this customer contact. (optional) + * @param string $contact_type The type of contact. (optional) + * @param string $name The name of this contact, when user_id is not provided. (optional) + * @param string $email The email of this contact, when a user_id is not provided. (optional) + * @param string $phone The phone number for this contact. Required for primary, technical, and security contact types. (optional) + * @param string $customer_id The alphanumeric string representing the customer for this customer contact. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createContactsAsync($options) + { + return $this->createContactsAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createContactsAsyncWithHttpInfo + * + * Add a new customer contact + * + * 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 $user_id The alphanumeric string representing the user for this customer contact. (optional) + * @param string $contact_type The type of contact. (optional) + * @param string $name The name of this contact, when user_id is not provided. (optional) + * @param string $email The email of this contact, when a user_id is not provided. (optional) + * @param string $phone The phone number for this contact. Required for primary, technical, and security contact types. (optional) + * @param string $customer_id The alphanumeric string representing the customer for this customer contact. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createContactsAsyncWithHttpInfo($options) + { + $returnType = '\Fastly\Model\ContactResponse'; + $request = $this->createContactsRequest($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 'createContacts' + * + * 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 $user_id The alphanumeric string representing the user for this customer contact. (optional) + * @param string $contact_type The type of contact. (optional) + * @param string $name The name of this contact, when user_id is not provided. (optional) + * @param string $email The email of this contact, when a user_id is not provided. (optional) + * @param string $phone The phone number for this contact. Required for primary, technical, and security contact types. (optional) + * @param string $customer_id The alphanumeric string representing the customer for this customer contact. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createContactsRequest($options) + { + // unbox the parameters from the associative array + $customer_id = array_key_exists('customer_id', $options) ? $options['customer_id'] : null; + $user_id = array_key_exists('user_id', $options) ? $options['user_id'] : null; + $contact_type = array_key_exists('contact_type', $options) ? $options['contact_type'] : null; + $name = array_key_exists('name', $options) ? $options['name'] : null; + $email = array_key_exists('email', $options) ? $options['email'] : null; + $phone = array_key_exists('phone', $options) ? $options['phone'] : null; + $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 createContacts' + ); + } + + $resourcePath = '/customer/{customer_id}/contacts'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($customer_id !== null) { + $resourcePath = str_replace( + '{' . 'customer_id' . '}', + ObjectSerializer::toPathValue($customer_id), + $resourcePath + ); + } + + // form params + if ($user_id !== null) { + $formParams['user_id'] = ObjectSerializer::toFormValue($user_id); + } + // form params + if ($contact_type !== null) { + $formParams['contact_type'] = ObjectSerializer::toFormValue($contact_type); + } + // form params + if ($name !== null) { + $formParams['name'] = ObjectSerializer::toFormValue($name); + } + // form params + if ($email !== null) { + $formParams['email'] = ObjectSerializer::toFormValue($email); + } + // form params + if ($phone !== null) { + $formParams['phone'] = ObjectSerializer::toFormValue($phone); + } + // form params + if ($customer_id !== null) { + $formParams['customer_id'] = ObjectSerializer::toFormValue($customer_id); + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/x-www-form-urlencoded'] + ); + } + + // 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( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation deleteContact * diff --git a/lib/Api/DirectorApi.php b/lib/Api/DirectorApi.php index d79ce2a0..6a28f90b 100644 --- a/lib/Api/DirectorApi.php +++ b/lib/Api/DirectorApi.php @@ -1604,6 +1604,368 @@ public function listDirectorsRequest($options) ); } + /** + * Operation updateDirector + * + * Update a director + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param string $director_name Name for the Director. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Fastly\Model\DirectorResponse + */ + public function updateDirector($options) + { + list($response) = $this->updateDirectorWithHttpInfo($options); + return $response; + } + + /** + * Operation updateDirectorWithHttpInfo + * + * Update a director + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param string $director_name Name for the Director. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Fastly\Model\DirectorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updateDirectorWithHttpInfo($options) + { + $request = $this->updateDirectorRequest($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 ('PUT' != 'GET' && 'PUT' != '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\DirectorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\DirectorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Fastly\Model\DirectorResponse'; + 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\DirectorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateDirectorAsync + * + * Update a director + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param string $director_name Name for the Director. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateDirectorAsync($options) + { + return $this->updateDirectorAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateDirectorAsyncWithHttpInfo + * + * Update a director + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param string $director_name Name for the Director. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateDirectorAsyncWithHttpInfo($options) + { + $returnType = '\Fastly\Model\DirectorResponse'; + $request = $this->updateDirectorRequest($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 'updateDirector' + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param string $director_name Name for the Director. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateDirectorRequest($options) + { + // unbox the parameters from the associative array + $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null; + $version_id = array_key_exists('version_id', $options) ? $options['version_id'] : null; + $director_name = array_key_exists('director_name', $options) ? $options['director_name'] : null; + + // verify the required parameter 'service_id' is set + if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $service_id when calling updateDirector' + ); + } + // verify the required parameter 'version_id' is set + if ($version_id === null || (is_array($version_id) && count($version_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $version_id when calling updateDirector' + ); + } + // verify the required parameter 'director_name' is set + if ($director_name === null || (is_array($director_name) && count($director_name) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $director_name when calling updateDirector' + ); + } + + $resourcePath = '/service/{service_id}/version/{version_id}/director/{director_name}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($service_id !== null) { + $resourcePath = str_replace( + '{' . 'service_id' . '}', + ObjectSerializer::toPathValue($service_id), + $resourcePath + ); + } + // path params + if ($version_id !== null) { + $resourcePath = str_replace( + '{' . 'version_id' . '}', + ObjectSerializer::toPathValue($version_id), + $resourcePath + ); + } + // path params + if ($director_name !== null) { + $resourcePath = str_replace( + '{' . 'director_name' . '}', + ObjectSerializer::toPathValue($director_name), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/x-www-form-urlencoded'] + ); + } + + // 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( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Create http client option * diff --git a/lib/Api/DomainInspectorHistoricalApi.php b/lib/Api/DomainInspectorHistoricalApi.php new file mode 100644 index 00000000..b46dd4da --- /dev/null +++ b/lib/Api/DomainInspectorHistoricalApi.php @@ -0,0 +1,614 @@ +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 getDomainInspectorHistorical + * + * Get historical domain data for a service + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $start A valid ISO-8601-formatted date and time, or UNIX timestamp, indicating the inclusive start of the query time range. If not provided, a default is chosen based on the provided `downsample` value. (optional) + * @param string $end A valid ISO-8601-formatted date and time, or UNIX timestamp, indicating the exclusive end of the query time range. If not provided, a default is chosen based on the provided `downsample` value. (optional) + * @param string $downsample Duration of sample windows. (optional, default to 'hour') + * @param string $metric The metric to retrieve. Up to ten comma-separated metrics are accepted. (optional, default to 'edge_requests') + * @param string $group_by Dimensions to return in the query. Multiple dimensions may be separated by commas. For example, `group_by=domain` will return one timeseries for every domain, as a total across all datacenters (POPs). (optional) + * @param string $limit Number of results per page. The maximum is 200. (optional, default to '100') + * @param string $cursor Cursor value from a previous response to retrieve the next page. To request the first page, this should be empty. (optional) + * @param string $region Limit query to one or more specific geographic regions. Values should be comma-separated. (optional) + * @param string $datacenter Limit query to one or more specific POPs. Values should be comma-separated. (optional) + * @param string $domain Limit query to one or more specific domains. Values should be comma-separated. (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Fastly\Model\HistoricalDomainsResponse + */ + public function getDomainInspectorHistorical($options) + { + list($response) = $this->getDomainInspectorHistoricalWithHttpInfo($options); + return $response; + } + + /** + * Operation getDomainInspectorHistoricalWithHttpInfo + * + * Get historical domain data for a service + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $start A valid ISO-8601-formatted date and time, or UNIX timestamp, indicating the inclusive start of the query time range. If not provided, a default is chosen based on the provided `downsample` value. (optional) + * @param string $end A valid ISO-8601-formatted date and time, or UNIX timestamp, indicating the exclusive end of the query time range. If not provided, a default is chosen based on the provided `downsample` value. (optional) + * @param string $downsample Duration of sample windows. (optional, default to 'hour') + * @param string $metric The metric to retrieve. Up to ten comma-separated metrics are accepted. (optional, default to 'edge_requests') + * @param string $group_by Dimensions to return in the query. Multiple dimensions may be separated by commas. For example, `group_by=domain` will return one timeseries for every domain, as a total across all datacenters (POPs). (optional) + * @param string $limit Number of results per page. The maximum is 200. (optional, default to '100') + * @param string $cursor Cursor value from a previous response to retrieve the next page. To request the first page, this should be empty. (optional) + * @param string $region Limit query to one or more specific geographic regions. Values should be comma-separated. (optional) + * @param string $datacenter Limit query to one or more specific POPs. Values should be comma-separated. (optional) + * @param string $domain Limit query to one or more specific domains. Values should be comma-separated. (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Fastly\Model\HistoricalDomainsResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getDomainInspectorHistoricalWithHttpInfo($options) + { + $request = $this->getDomainInspectorHistoricalRequest($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\HistoricalDomainsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\HistoricalDomainsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Fastly\Model\HistoricalDomainsResponse'; + 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\HistoricalDomainsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getDomainInspectorHistoricalAsync + * + * Get historical domain data for a service + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $start A valid ISO-8601-formatted date and time, or UNIX timestamp, indicating the inclusive start of the query time range. If not provided, a default is chosen based on the provided `downsample` value. (optional) + * @param string $end A valid ISO-8601-formatted date and time, or UNIX timestamp, indicating the exclusive end of the query time range. If not provided, a default is chosen based on the provided `downsample` value. (optional) + * @param string $downsample Duration of sample windows. (optional, default to 'hour') + * @param string $metric The metric to retrieve. Up to ten comma-separated metrics are accepted. (optional, default to 'edge_requests') + * @param string $group_by Dimensions to return in the query. Multiple dimensions may be separated by commas. For example, `group_by=domain` will return one timeseries for every domain, as a total across all datacenters (POPs). (optional) + * @param string $limit Number of results per page. The maximum is 200. (optional, default to '100') + * @param string $cursor Cursor value from a previous response to retrieve the next page. To request the first page, this should be empty. (optional) + * @param string $region Limit query to one or more specific geographic regions. Values should be comma-separated. (optional) + * @param string $datacenter Limit query to one or more specific POPs. Values should be comma-separated. (optional) + * @param string $domain Limit query to one or more specific domains. Values should be comma-separated. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getDomainInspectorHistoricalAsync($options) + { + return $this->getDomainInspectorHistoricalAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getDomainInspectorHistoricalAsyncWithHttpInfo + * + * Get historical domain data for a service + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $start A valid ISO-8601-formatted date and time, or UNIX timestamp, indicating the inclusive start of the query time range. If not provided, a default is chosen based on the provided `downsample` value. (optional) + * @param string $end A valid ISO-8601-formatted date and time, or UNIX timestamp, indicating the exclusive end of the query time range. If not provided, a default is chosen based on the provided `downsample` value. (optional) + * @param string $downsample Duration of sample windows. (optional, default to 'hour') + * @param string $metric The metric to retrieve. Up to ten comma-separated metrics are accepted. (optional, default to 'edge_requests') + * @param string $group_by Dimensions to return in the query. Multiple dimensions may be separated by commas. For example, `group_by=domain` will return one timeseries for every domain, as a total across all datacenters (POPs). (optional) + * @param string $limit Number of results per page. The maximum is 200. (optional, default to '100') + * @param string $cursor Cursor value from a previous response to retrieve the next page. To request the first page, this should be empty. (optional) + * @param string $region Limit query to one or more specific geographic regions. Values should be comma-separated. (optional) + * @param string $datacenter Limit query to one or more specific POPs. Values should be comma-separated. (optional) + * @param string $domain Limit query to one or more specific domains. Values should be comma-separated. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getDomainInspectorHistoricalAsyncWithHttpInfo($options) + { + $returnType = '\Fastly\Model\HistoricalDomainsResponse'; + $request = $this->getDomainInspectorHistoricalRequest($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 'getDomainInspectorHistorical' + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $start A valid ISO-8601-formatted date and time, or UNIX timestamp, indicating the inclusive start of the query time range. If not provided, a default is chosen based on the provided `downsample` value. (optional) + * @param string $end A valid ISO-8601-formatted date and time, or UNIX timestamp, indicating the exclusive end of the query time range. If not provided, a default is chosen based on the provided `downsample` value. (optional) + * @param string $downsample Duration of sample windows. (optional, default to 'hour') + * @param string $metric The metric to retrieve. Up to ten comma-separated metrics are accepted. (optional, default to 'edge_requests') + * @param string $group_by Dimensions to return in the query. Multiple dimensions may be separated by commas. For example, `group_by=domain` will return one timeseries for every domain, as a total across all datacenters (POPs). (optional) + * @param string $limit Number of results per page. The maximum is 200. (optional, default to '100') + * @param string $cursor Cursor value from a previous response to retrieve the next page. To request the first page, this should be empty. (optional) + * @param string $region Limit query to one or more specific geographic regions. Values should be comma-separated. (optional) + * @param string $datacenter Limit query to one or more specific POPs. Values should be comma-separated. (optional) + * @param string $domain Limit query to one or more specific domains. Values should be comma-separated. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getDomainInspectorHistoricalRequest($options) + { + // unbox the parameters from the associative array + $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null; + $start = array_key_exists('start', $options) ? $options['start'] : null; + $end = array_key_exists('end', $options) ? $options['end'] : null; + $downsample = array_key_exists('downsample', $options) ? $options['downsample'] : 'hour'; + $metric = array_key_exists('metric', $options) ? $options['metric'] : 'edge_requests'; + $group_by = array_key_exists('group_by', $options) ? $options['group_by'] : null; + $limit = array_key_exists('limit', $options) ? $options['limit'] : '100'; + $cursor = array_key_exists('cursor', $options) ? $options['cursor'] : null; + $region = array_key_exists('region', $options) ? $options['region'] : null; + $datacenter = array_key_exists('datacenter', $options) ? $options['datacenter'] : null; + $domain = array_key_exists('domain', $options) ? $options['domain'] : null; + + // verify the required parameter 'service_id' is set + if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $service_id when calling getDomainInspectorHistorical' + ); + } + + $resourcePath = '/metrics/domains/services/{service_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($start !== null) { + if('form' === 'form' && is_array($start)) { + foreach($start as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['start'] = ObjectSerializer::toString($start); + } + } + // query params + if ($end !== null) { + if('form' === 'form' && is_array($end)) { + foreach($end as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['end'] = ObjectSerializer::toString($end); + } + } + // query params + if ($downsample !== null) { + if('form' === 'form' && is_array($downsample)) { + foreach($downsample as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['downsample'] = ObjectSerializer::toString($downsample); + } + } + // query params + if ($metric !== null) { + if('form' === 'form' && is_array($metric)) { + foreach($metric as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['metric'] = ObjectSerializer::toString($metric); + } + } + // query params + if ($group_by !== null) { + if('form' === 'form' && is_array($group_by)) { + foreach($group_by as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['group_by'] = ObjectSerializer::toString($group_by); + } + } + // 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); + } + } + // query params + if (is_array($region)) { + $region = ObjectSerializer::serializeCollection($region, 'form', true); + } + if ($region !== null) { + $queryParams['region'] = ObjectSerializer::toString($region); + } + // query params + if (is_array($datacenter)) { + $datacenter = ObjectSerializer::serializeCollection($datacenter, 'form', true); + } + if ($datacenter !== null) { + $queryParams['datacenter'] = ObjectSerializer::toString($datacenter); + } + // query params + if ($domain !== null) { + if('form' === 'form' && is_array($domain)) { + foreach($domain as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['domain'] = ObjectSerializer::toString($domain); + } + } + + + // path params + if ($service_id !== null) { + $resourcePath = str_replace( + '{' . 'service_id' . '}', + ObjectSerializer::toPathValue($service_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/DomainInspectorRealtimeApi.php b/lib/Api/DomainInspectorRealtimeApi.php new file mode 100644 index 00000000..e3df195a --- /dev/null +++ b/lib/Api/DomainInspectorRealtimeApi.php @@ -0,0 +1,1136 @@ +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 getDomainInspectorLast120Seconds + * + * Get real-time domain data for the last 120 seconds + * + * 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://rt.fastly.com + * + * @param string $service_id Alphanumeric string identifying the service. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Fastly\Model\DomainInspector + */ + public function getDomainInspectorLast120Seconds($options) + { + list($response) = $this->getDomainInspectorLast120SecondsWithHttpInfo($options); + return $response; + } + + /** + * Operation getDomainInspectorLast120SecondsWithHttpInfo + * + * Get real-time domain data for the last 120 seconds + * + * 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://rt.fastly.com + * + * @param string $service_id Alphanumeric string identifying the service. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Fastly\Model\DomainInspector, HTTP status code, HTTP response headers (array of strings) + */ + public function getDomainInspectorLast120SecondsWithHttpInfo($options) + { + $request = $this->getDomainInspectorLast120SecondsRequest($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\DomainInspector' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\DomainInspector', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Fastly\Model\DomainInspector'; + 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\DomainInspector', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getDomainInspectorLast120SecondsAsync + * + * Get real-time domain data for the last 120 seconds + * + * 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://rt.fastly.com + * + * @param string $service_id Alphanumeric string identifying the service. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getDomainInspectorLast120SecondsAsync($options) + { + return $this->getDomainInspectorLast120SecondsAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getDomainInspectorLast120SecondsAsyncWithHttpInfo + * + * Get real-time domain data for the last 120 seconds + * + * 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://rt.fastly.com + * + * @param string $service_id Alphanumeric string identifying the service. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getDomainInspectorLast120SecondsAsyncWithHttpInfo($options) + { + $returnType = '\Fastly\Model\DomainInspector'; + $request = $this->getDomainInspectorLast120SecondsRequest($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 'getDomainInspectorLast120Seconds' + * + * 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://rt.fastly.com + * + * @param string $service_id Alphanumeric string identifying the service. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getDomainInspectorLast120SecondsRequest($options) + { + // unbox the parameters from the associative array + $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null; + + // verify the required parameter 'service_id' is set + if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $service_id when calling getDomainInspectorLast120Seconds' + ); + } + + $resourcePath = '/v1/domains/{service_id}/ts/h'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($service_id !== null) { + $resourcePath = str_replace( + '{' . 'service_id' . '}', + ObjectSerializer::toPathValue($service_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://rt.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 getDomainInspectorLastMaxEntries + * + * Get a limited number of real-time domain data entries + * + * 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://rt.fastly.com + * + * @param string $service_id Alphanumeric string identifying the service. (required) + * @param int $max_entries Maximum number of results to show. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Fastly\Model\DomainInspector + */ + public function getDomainInspectorLastMaxEntries($options) + { + list($response) = $this->getDomainInspectorLastMaxEntriesWithHttpInfo($options); + return $response; + } + + /** + * Operation getDomainInspectorLastMaxEntriesWithHttpInfo + * + * Get a limited number of real-time domain data entries + * + * 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://rt.fastly.com + * + * @param string $service_id Alphanumeric string identifying the service. (required) + * @param int $max_entries Maximum number of results to show. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Fastly\Model\DomainInspector, HTTP status code, HTTP response headers (array of strings) + */ + public function getDomainInspectorLastMaxEntriesWithHttpInfo($options) + { + $request = $this->getDomainInspectorLastMaxEntriesRequest($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\DomainInspector' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\DomainInspector', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Fastly\Model\DomainInspector'; + 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\DomainInspector', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getDomainInspectorLastMaxEntriesAsync + * + * Get a limited number of real-time domain data entries + * + * 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://rt.fastly.com + * + * @param string $service_id Alphanumeric string identifying the service. (required) + * @param int $max_entries Maximum number of results to show. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getDomainInspectorLastMaxEntriesAsync($options) + { + return $this->getDomainInspectorLastMaxEntriesAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getDomainInspectorLastMaxEntriesAsyncWithHttpInfo + * + * Get a limited number of real-time domain data entries + * + * 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://rt.fastly.com + * + * @param string $service_id Alphanumeric string identifying the service. (required) + * @param int $max_entries Maximum number of results to show. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getDomainInspectorLastMaxEntriesAsyncWithHttpInfo($options) + { + $returnType = '\Fastly\Model\DomainInspector'; + $request = $this->getDomainInspectorLastMaxEntriesRequest($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 'getDomainInspectorLastMaxEntries' + * + * 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://rt.fastly.com + * + * @param string $service_id Alphanumeric string identifying the service. (required) + * @param int $max_entries Maximum number of results to show. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getDomainInspectorLastMaxEntriesRequest($options) + { + // unbox the parameters from the associative array + $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null; + $max_entries = array_key_exists('max_entries', $options) ? $options['max_entries'] : null; + + // verify the required parameter 'service_id' is set + if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $service_id when calling getDomainInspectorLastMaxEntries' + ); + } + // verify the required parameter 'max_entries' is set + if ($max_entries === null || (is_array($max_entries) && count($max_entries) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $max_entries when calling getDomainInspectorLastMaxEntries' + ); + } + + $resourcePath = '/v1/domains/{service_id}/ts/h/limit/{max_entries}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($service_id !== null) { + $resourcePath = str_replace( + '{' . 'service_id' . '}', + ObjectSerializer::toPathValue($service_id), + $resourcePath + ); + } + // path params + if ($max_entries !== null) { + $resourcePath = str_replace( + '{' . 'max_entries' . '}', + ObjectSerializer::toPathValue($max_entries), + $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://rt.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 getDomainInspectorLastSecond + * + * Get real-time domain data from a specified time + * + * 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://rt.fastly.com + * + * @param string $service_id Alphanumeric string identifying the service. (required) + * @param int $start_timestamp Timestamp in seconds (Unix epoch time). (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Fastly\Model\DomainInspector + */ + public function getDomainInspectorLastSecond($options) + { + list($response) = $this->getDomainInspectorLastSecondWithHttpInfo($options); + return $response; + } + + /** + * Operation getDomainInspectorLastSecondWithHttpInfo + * + * Get real-time domain data from a specified time + * + * 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://rt.fastly.com + * + * @param string $service_id Alphanumeric string identifying the service. (required) + * @param int $start_timestamp Timestamp in seconds (Unix epoch time). (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Fastly\Model\DomainInspector, HTTP status code, HTTP response headers (array of strings) + */ + public function getDomainInspectorLastSecondWithHttpInfo($options) + { + $request = $this->getDomainInspectorLastSecondRequest($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\DomainInspector' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\DomainInspector', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Fastly\Model\DomainInspector'; + 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\DomainInspector', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getDomainInspectorLastSecondAsync + * + * Get real-time domain data from a specified time + * + * 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://rt.fastly.com + * + * @param string $service_id Alphanumeric string identifying the service. (required) + * @param int $start_timestamp Timestamp in seconds (Unix epoch time). (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getDomainInspectorLastSecondAsync($options) + { + return $this->getDomainInspectorLastSecondAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getDomainInspectorLastSecondAsyncWithHttpInfo + * + * Get real-time domain data from a specified time + * + * 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://rt.fastly.com + * + * @param string $service_id Alphanumeric string identifying the service. (required) + * @param int $start_timestamp Timestamp in seconds (Unix epoch time). (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getDomainInspectorLastSecondAsyncWithHttpInfo($options) + { + $returnType = '\Fastly\Model\DomainInspector'; + $request = $this->getDomainInspectorLastSecondRequest($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 'getDomainInspectorLastSecond' + * + * 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://rt.fastly.com + * + * @param string $service_id Alphanumeric string identifying the service. (required) + * @param int $start_timestamp Timestamp in seconds (Unix epoch time). (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getDomainInspectorLastSecondRequest($options) + { + // unbox the parameters from the associative array + $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null; + $start_timestamp = array_key_exists('start_timestamp', $options) ? $options['start_timestamp'] : null; + + // verify the required parameter 'service_id' is set + if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $service_id when calling getDomainInspectorLastSecond' + ); + } + // verify the required parameter 'start_timestamp' is set + if ($start_timestamp === null || (is_array($start_timestamp) && count($start_timestamp) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $start_timestamp when calling getDomainInspectorLastSecond' + ); + } + + $resourcePath = '/v1/domains/{service_id}/ts/{start_timestamp}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($service_id !== null) { + $resourcePath = str_replace( + '{' . 'service_id' . '}', + ObjectSerializer::toPathValue($service_id), + $resourcePath + ); + } + // path params + if ($start_timestamp !== null) { + $resourcePath = str_replace( + '{' . 'start_timestamp' . '}', + ObjectSerializer::toPathValue($start_timestamp), + $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://rt.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/IamRolesApi.php b/lib/Api/IamRolesApi.php index 18fd3102..90c9a165 100644 --- a/lib/Api/IamRolesApi.php +++ b/lib/Api/IamRolesApi.php @@ -110,9 +110,9 @@ public function getConfig() } /** - * Operation deleteARole + * Operation addRolePermissions * - * Delete a role + * Add permissions to a role * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -120,20 +120,22 @@ public function getConfig() * URL: https://api.fastly.com * * @param string $role_id Alphanumeric string identifying the role. (required) + * @param array $request_body request_body (optional) * * @throws \Fastly\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return object */ - public function deleteARole($options) + public function addRolePermissions($options) { - $this->deleteARoleWithHttpInfo($options); + list($response) = $this->addRolePermissionsWithHttpInfo($options); + return $response; } /** - * Operation deleteARoleWithHttpInfo + * Operation addRolePermissionsWithHttpInfo * - * Delete a role + * Add permissions to a role * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -141,14 +143,15 @@ public function deleteARole($options) * URL: https://api.fastly.com * * @param string $role_id Alphanumeric string identifying the role. (required) + * @param array $request_body (optional) * * @throws \Fastly\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of object, HTTP status code, HTTP response headers (array of strings) */ - public function deleteARoleWithHttpInfo($options) + public function addRolePermissionsWithHttpInfo($options) { - $request = $this->deleteARoleRequest($options); + $request = $this->addRolePermissionsRequest($options); try { $options = $this->createHttpClientOption(); @@ -170,7 +173,7 @@ public function deleteARoleWithHttpInfo($options) ); } - if ('DELETE' != 'GET' && 'DELETE' != 'HEAD') { + if ('POST' != 'GET' && 'POST' != 'HEAD') { $header = $response->getHeader('Fastly-RateLimit-Remaining'); if (count($header) > 0) { $this->config->setRateLimitRemaining($header[0]); @@ -197,19 +200,53 @@ public function deleteARoleWithHttpInfo($options) ); } - return [null, $statusCode, $response->getHeaders()]; + switch($statusCode) { + case 201: + if ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'object'; + 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 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } } /** - * Operation deleteARoleAsync + * Operation addRolePermissionsAsync * - * Delete a role + * Add permissions to a role * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -217,13 +254,14 @@ public function deleteARoleWithHttpInfo($options) * URL: https://api.fastly.com * * @param string $role_id Alphanumeric string identifying the role. (required) + * @param array $request_body (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteARoleAsync($options) + public function addRolePermissionsAsync($options) { - return $this->deleteARoleAsyncWithHttpInfo($options) + return $this->addRolePermissionsAsyncWithHttpInfo($options) ->then( function ($response) { return $response[0]; @@ -232,9 +270,9 @@ function ($response) { } /** - * Operation deleteARoleAsyncWithHttpInfo + * Operation addRolePermissionsAsyncWithHttpInfo * - * Delete a role + * Add permissions to a role * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -242,20 +280,31 @@ function ($response) { * URL: https://api.fastly.com * * @param string $role_id Alphanumeric string identifying the role. (required) + * @param array $request_body (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteARoleAsyncWithHttpInfo($options) + public function addRolePermissionsAsyncWithHttpInfo($options) { - $returnType = ''; - $request = $this->deleteARoleRequest($options); + $returnType = 'object'; + $request = $this->addRolePermissionsRequest($options); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + 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(); @@ -275,7 +324,7 @@ function ($exception) { } /** - * Create request for operation 'deleteARole' + * Create request for operation 'addRolePermissions' * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -283,23 +332,25 @@ function ($exception) { * URL: https://api.fastly.com * * @param string $role_id Alphanumeric string identifying the role. (required) + * @param array $request_body (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteARoleRequest($options) + public function addRolePermissionsRequest($options) { // unbox the parameters from the associative array $role_id = array_key_exists('role_id', $options) ? $options['role_id'] : null; + $request_body = array_key_exists('request_body', $options) ? $options['request_body'] : null; // verify the required parameter 'role_id' is set if ($role_id === null || (is_array($role_id) && count($role_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $role_id when calling deleteARole' + 'Missing the required parameter $role_id when calling addRolePermissions' ); } - $resourcePath = '/roles/{role_id}'; + $resourcePath = '/roles/{role_id}/permissions'; $formParams = []; $queryParams = []; $headerParams = []; @@ -320,17 +371,23 @@ public function deleteARoleRequest($options) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - [] + ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( - [], - [] + ['application/json'], + ['application/json'] ); } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($request_body)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($request_body)); + } else { + $httpBody = $request_body; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -379,7 +436,7 @@ public function deleteARoleRequest($options) $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( - 'DELETE', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -387,46 +444,46 @@ public function deleteARoleRequest($options) } /** - * Operation getARole + * Operation createARole * - * Get a role + * Create a role * * 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 $role_id Alphanumeric string identifying the role. (required) + * @param array $request_body request_body (optional) * * @throws \Fastly\ApiException on non-2xx response * @throws \InvalidArgumentException * @return object */ - public function getARole($options) + public function createARole($options) { - list($response) = $this->getARoleWithHttpInfo($options); + list($response) = $this->createARoleWithHttpInfo($options); return $response; } /** - * Operation getARoleWithHttpInfo + * Operation createARoleWithHttpInfo * - * Get a role + * Create a role * * 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 $role_id Alphanumeric string identifying the role. (required) + * @param array $request_body (optional) * * @throws \Fastly\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of object, HTTP status code, HTTP response headers (array of strings) */ - public function getARoleWithHttpInfo($options) + public function createARoleWithHttpInfo($options) { - $request = $this->getARoleRequest($options); + $request = $this->createARoleRequest($options); try { $options = $this->createHttpClientOption(); @@ -448,7 +505,7 @@ public function getARoleWithHttpInfo($options) ); } - if ('GET' != 'GET' && 'GET' != 'HEAD') { + if ('POST' != 'GET' && 'POST' != 'HEAD') { $header = $response->getHeader('Fastly-RateLimit-Remaining'); if (count($header) > 0) { $this->config->setRateLimitRemaining($header[0]); @@ -476,7 +533,7 @@ public function getARoleWithHttpInfo($options) } switch($statusCode) { - case 200: + case 201: if ('object' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -505,7 +562,7 @@ public function getARoleWithHttpInfo($options) } catch (ApiException $e) { switch ($e->getCode()) { - case 200: + case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'object', @@ -519,23 +576,23 @@ public function getARoleWithHttpInfo($options) } /** - * Operation getARoleAsync + * Operation createARoleAsync * - * Get a role + * Create a role * * 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 $role_id Alphanumeric string identifying the role. (required) + * @param array $request_body (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getARoleAsync($options) + public function createARoleAsync($options) { - return $this->getARoleAsyncWithHttpInfo($options) + return $this->createARoleAsyncWithHttpInfo($options) ->then( function ($response) { return $response[0]; @@ -544,24 +601,24 @@ function ($response) { } /** - * Operation getARoleAsyncWithHttpInfo + * Operation createARoleAsyncWithHttpInfo * - * Get a role + * Create a role * * 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 $role_id Alphanumeric string identifying the role. (required) + * @param array $request_body (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getARoleAsyncWithHttpInfo($options) + public function createARoleAsyncWithHttpInfo($options) { $returnType = 'object'; - $request = $this->getARoleRequest($options); + $request = $this->createARoleRequest($options); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -597,31 +654,25 @@ function ($exception) { } /** - * Create request for operation 'getARole' + * Create request for operation 'createARole' * * 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 $role_id Alphanumeric string identifying the role. (required) + * @param array $request_body (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getARoleRequest($options) + public function createARoleRequest($options) { // unbox the parameters from the associative array - $role_id = array_key_exists('role_id', $options) ? $options['role_id'] : null; + $request_body = array_key_exists('request_body', $options) ? $options['request_body'] : null; - // verify the required parameter 'role_id' is set - if ($role_id === null || (is_array($role_id) && count($role_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $role_id when calling getARole' - ); - } - $resourcePath = '/roles/{role_id}'; + $resourcePath = '/roles'; $formParams = []; $queryParams = []; $headerParams = []; @@ -630,14 +681,6 @@ public function getARoleRequest($options) - // path params - if ($role_id !== null) { - $resourcePath = str_replace( - '{' . 'role_id' . '}', - ObjectSerializer::toPathValue($role_id), - $resourcePath - ); - } if ($multipart) { @@ -647,12 +690,18 @@ public function getARoleRequest($options) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - [] + ['application/json'] ); } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($request_body)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($request_body)); + } else { + $httpBody = $request_body; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -701,7 +750,7 @@ public function getARoleRequest($options) $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -709,9 +758,9 @@ public function getARoleRequest($options) } /** - * Operation listRolePermissions + * Operation deleteARole * - * List permissions in a role + * Delete a role * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -722,18 +771,17 @@ public function getARoleRequest($options) * * @throws \Fastly\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return object + * @return void */ - public function listRolePermissions($options) + public function deleteARole($options) { - list($response) = $this->listRolePermissionsWithHttpInfo($options); - return $response; + $this->deleteARoleWithHttpInfo($options); } /** - * Operation listRolePermissionsWithHttpInfo + * Operation deleteARoleWithHttpInfo * - * List permissions in a role + * Delete a role * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -744,11 +792,11 @@ public function listRolePermissions($options) * * @throws \Fastly\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of object, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function listRolePermissionsWithHttpInfo($options) + public function deleteARoleWithHttpInfo($options) { - $request = $this->listRolePermissionsRequest($options); + $request = $this->deleteARoleRequest($options); try { $options = $this->createHttpClientOption(); @@ -770,7 +818,7 @@ public function listRolePermissionsWithHttpInfo($options) ); } - if ('GET' != 'GET' && 'GET' != 'HEAD') { + if ('DELETE' != 'GET' && 'DELETE' != 'HEAD') { $header = $response->getHeader('Fastly-RateLimit-Remaining'); if (count($header) > 0) { $this->config->setRateLimitRemaining($header[0]); @@ -797,53 +845,19 @@ public function listRolePermissionsWithHttpInfo($options) ); } - switch($statusCode) { - case 200: - if ('object' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, 'object', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = 'object'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - 'object', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; } throw $e; } } /** - * Operation listRolePermissionsAsync + * Operation deleteARoleAsync * - * List permissions in a role + * Delete a role * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -855,9 +869,9 @@ public function listRolePermissionsWithHttpInfo($options) * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listRolePermissionsAsync($options) + public function deleteARoleAsync($options) { - return $this->listRolePermissionsAsyncWithHttpInfo($options) + return $this->deleteARoleAsyncWithHttpInfo($options) ->then( function ($response) { return $response[0]; @@ -866,9 +880,9 @@ function ($response) { } /** - * Operation listRolePermissionsAsyncWithHttpInfo + * Operation deleteARoleAsyncWithHttpInfo * - * List permissions in a role + * Delete a role * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -880,26 +894,16 @@ function ($response) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listRolePermissionsAsyncWithHttpInfo($options) + public function deleteARoleAsyncWithHttpInfo($options) { - $returnType = 'object'; - $request = $this->listRolePermissionsRequest($options); + $returnType = ''; + $request = $this->deleteARoleRequest($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() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -919,7 +923,7 @@ function ($exception) { } /** - * Create request for operation 'listRolePermissions' + * Create request for operation 'deleteARole' * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -931,7 +935,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function listRolePermissionsRequest($options) + public function deleteARoleRequest($options) { // unbox the parameters from the associative array $role_id = array_key_exists('role_id', $options) ? $options['role_id'] : null; @@ -939,11 +943,11 @@ public function listRolePermissionsRequest($options) // verify the required parameter 'role_id' is set if ($role_id === null || (is_array($role_id) && count($role_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $role_id when calling listRolePermissions' + 'Missing the required parameter $role_id when calling deleteARole' ); } - $resourcePath = '/roles/{role_id}/permissions'; + $resourcePath = '/roles/{role_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -964,11 +968,11 @@ public function listRolePermissionsRequest($options) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + [] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + [], [] ); } @@ -1023,7 +1027,7 @@ public function listRolePermissionsRequest($options) $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( - 'GET', + 'DELETE', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -1031,48 +1035,46 @@ public function listRolePermissionsRequest($options) } /** - * Operation listRoles + * Operation getARole * - * List roles + * Get a role * * 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 int $per_page Number of records per page. (optional, default to 20) - * @param int $page Current page. (optional) + * @param string $role_id Alphanumeric string identifying the role. (required) * * @throws \Fastly\ApiException on non-2xx response * @throws \InvalidArgumentException * @return object */ - public function listRoles($options) + public function getARole($options) { - list($response) = $this->listRolesWithHttpInfo($options); + list($response) = $this->getARoleWithHttpInfo($options); return $response; } /** - * Operation listRolesWithHttpInfo + * Operation getARoleWithHttpInfo * - * List roles + * Get a role * * 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 int $per_page Number of records per page. (optional, default to 20) - * @param int $page Current page. (optional) + * @param string $role_id Alphanumeric string identifying the role. (required) * * @throws \Fastly\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of object, HTTP status code, HTTP response headers (array of strings) */ - public function listRolesWithHttpInfo($options) + public function getARoleWithHttpInfo($options) { - $request = $this->listRolesRequest($options); + $request = $this->getARoleRequest($options); try { $options = $this->createHttpClientOption(); @@ -1165,24 +1167,23 @@ public function listRolesWithHttpInfo($options) } /** - * Operation listRolesAsync + * Operation getARoleAsync * - * List roles + * Get a role * * 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 int $per_page Number of records per page. (optional, default to 20) - * @param int $page Current page. (optional) + * @param string $role_id Alphanumeric string identifying the role. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listRolesAsync($options) + public function getARoleAsync($options) { - return $this->listRolesAsyncWithHttpInfo($options) + return $this->getARoleAsyncWithHttpInfo($options) ->then( function ($response) { return $response[0]; @@ -1191,25 +1192,24 @@ function ($response) { } /** - * Operation listRolesAsyncWithHttpInfo + * Operation getARoleAsyncWithHttpInfo * - * List roles + * Get a role * * 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 int $per_page Number of records per page. (optional, default to 20) - * @param int $page Current page. (optional) + * @param string $role_id Alphanumeric string identifying the role. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listRolesAsyncWithHttpInfo($options) + public function getARoleAsyncWithHttpInfo($options) { $returnType = 'object'; - $request = $this->listRolesRequest($options); + $request = $this->getARoleRequest($options); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1245,64 +1245,47 @@ function ($exception) { } /** - * Create request for operation 'listRoles' + * Create request for operation 'getARole' * * 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 int $per_page Number of records per page. (optional, default to 20) - * @param int $page Current page. (optional) + * @param string $role_id Alphanumeric string identifying the role. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function listRolesRequest($options) + public function getARoleRequest($options) { // unbox the parameters from the associative array - $per_page = array_key_exists('per_page', $options) ? $options['per_page'] : 20; - $page = array_key_exists('page', $options) ? $options['page'] : null; + $role_id = array_key_exists('role_id', $options) ? $options['role_id'] : null; - if ($per_page !== null && $per_page > 100) { - throw new \InvalidArgumentException('invalid value for "$per_page" when calling IamRolesApi.listRoles, must be smaller than or equal to 100.'); - } - if ($per_page !== null && $per_page < 1) { - throw new \InvalidArgumentException('invalid value for "$per_page" when calling IamRolesApi.listRoles, must be bigger than or equal to 1.'); + // verify the required parameter 'role_id' is set + if ($role_id === null || (is_array($role_id) && count($role_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $role_id when calling getARole' + ); } - - $resourcePath = '/roles'; + $resourcePath = '/roles/{role_id}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if ($per_page !== null) { - if('form' === 'form' && is_array($per_page)) { - foreach($per_page as $key => $value) { - $queryParams[$key] = ObjectSerializer::toString($value); - } - } - else { - $queryParams['per_page'] = ObjectSerializer::toString($per_page); - } - } - // query params - if ($page !== null) { - if('form' === 'form' && is_array($page)) { - foreach($page as $key => $value) { - $queryParams[$key] = ObjectSerializer::toString($value); - } - } - else { - $queryParams['page'] = ObjectSerializer::toString($page); - } - } + // path params + if ($role_id !== null) { + $resourcePath = str_replace( + '{' . 'role_id' . '}', + ObjectSerializer::toPathValue($role_id), + $resourcePath + ); + } if ($multipart) { @@ -1373,6 +1356,1294 @@ public function listRolesRequest($options) ); } + /** + * Operation listRolePermissions + * + * List permissions in a role + * + * 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 $role_id Alphanumeric string identifying the role. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return object + */ + public function listRolePermissions($options) + { + list($response) = $this->listRolePermissionsWithHttpInfo($options); + return $response; + } + + /** + * Operation listRolePermissionsWithHttpInfo + * + * List permissions in a role + * + * 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 $role_id Alphanumeric string identifying the role. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + */ + public function listRolePermissionsWithHttpInfo($options) + { + $request = $this->listRolePermissionsRequest($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 ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'object'; + 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(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listRolePermissionsAsync + * + * List permissions in a role + * + * 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 $role_id Alphanumeric string identifying the role. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listRolePermissionsAsync($options) + { + return $this->listRolePermissionsAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listRolePermissionsAsyncWithHttpInfo + * + * List permissions in a role + * + * 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 $role_id Alphanumeric string identifying the role. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listRolePermissionsAsyncWithHttpInfo($options) + { + $returnType = 'object'; + $request = $this->listRolePermissionsRequest($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 'listRolePermissions' + * + * 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 $role_id Alphanumeric string identifying the role. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listRolePermissionsRequest($options) + { + // unbox the parameters from the associative array + $role_id = array_key_exists('role_id', $options) ? $options['role_id'] : null; + + // verify the required parameter 'role_id' is set + if ($role_id === null || (is_array($role_id) && count($role_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $role_id when calling listRolePermissions' + ); + } + + $resourcePath = '/roles/{role_id}/permissions'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($role_id !== null) { + $resourcePath = str_replace( + '{' . 'role_id' . '}', + ObjectSerializer::toPathValue($role_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 listRoles + * + * List roles + * + * 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 int $per_page Number of records per page. (optional, default to 20) + * @param int $page Current page. (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return object + */ + public function listRoles($options) + { + list($response) = $this->listRolesWithHttpInfo($options); + return $response; + } + + /** + * Operation listRolesWithHttpInfo + * + * List roles + * + * 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 int $per_page Number of records per page. (optional, default to 20) + * @param int $page Current page. (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + */ + public function listRolesWithHttpInfo($options) + { + $request = $this->listRolesRequest($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 ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'object'; + 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(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listRolesAsync + * + * List roles + * + * 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 int $per_page Number of records per page. (optional, default to 20) + * @param int $page Current page. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listRolesAsync($options) + { + return $this->listRolesAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listRolesAsyncWithHttpInfo + * + * List roles + * + * 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 int $per_page Number of records per page. (optional, default to 20) + * @param int $page Current page. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listRolesAsyncWithHttpInfo($options) + { + $returnType = 'object'; + $request = $this->listRolesRequest($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 'listRoles' + * + * 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 int $per_page Number of records per page. (optional, default to 20) + * @param int $page Current page. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listRolesRequest($options) + { + // unbox the parameters from the associative array + $per_page = array_key_exists('per_page', $options) ? $options['per_page'] : 20; + $page = array_key_exists('page', $options) ? $options['page'] : null; + + if ($per_page !== null && $per_page > 100) { + throw new \InvalidArgumentException('invalid value for "$per_page" when calling IamRolesApi.listRoles, must be smaller than or equal to 100.'); + } + if ($per_page !== null && $per_page < 1) { + throw new \InvalidArgumentException('invalid value for "$per_page" when calling IamRolesApi.listRoles, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/roles'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($per_page !== null) { + if('form' === 'form' && is_array($per_page)) { + foreach($per_page as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['per_page'] = ObjectSerializer::toString($per_page); + } + } + // query params + if ($page !== null) { + if('form' === 'form' && is_array($page)) { + foreach($page as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['page'] = ObjectSerializer::toString($page); + } + } + + + + + 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 removeRolePermissions + * + * Remove permissions from a role + * + * 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 $role_id Alphanumeric string identifying the role. (required) + * @param array $request_body request_body (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function removeRolePermissions($options) + { + $this->removeRolePermissionsWithHttpInfo($options); + } + + /** + * Operation removeRolePermissionsWithHttpInfo + * + * Remove permissions from a role + * + * 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 $role_id Alphanumeric string identifying the role. (required) + * @param array $request_body (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function removeRolePermissionsWithHttpInfo($options) + { + $request = $this->removeRolePermissionsRequest($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 removeRolePermissionsAsync + * + * Remove permissions from a role + * + * 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 $role_id Alphanumeric string identifying the role. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function removeRolePermissionsAsync($options) + { + return $this->removeRolePermissionsAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation removeRolePermissionsAsyncWithHttpInfo + * + * Remove permissions from a role + * + * 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 $role_id Alphanumeric string identifying the role. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function removeRolePermissionsAsyncWithHttpInfo($options) + { + $returnType = ''; + $request = $this->removeRolePermissionsRequest($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 'removeRolePermissions' + * + * 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 $role_id Alphanumeric string identifying the role. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function removeRolePermissionsRequest($options) + { + // unbox the parameters from the associative array + $role_id = array_key_exists('role_id', $options) ? $options['role_id'] : null; + $request_body = array_key_exists('request_body', $options) ? $options['request_body'] : null; + + // verify the required parameter 'role_id' is set + if ($role_id === null || (is_array($role_id) && count($role_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $role_id when calling removeRolePermissions' + ); + } + + $resourcePath = '/roles/{role_id}/permissions'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($role_id !== null) { + $resourcePath = str_replace( + '{' . 'role_id' . '}', + ObjectSerializer::toPathValue($role_id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + [] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + [], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($request_body)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($request_body)); + } else { + $httpBody = $request_body; + } + } 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( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateARole + * + * Update a role + * + * 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 $role_id Alphanumeric string identifying the role. (required) + * @param array $request_body request_body (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return object + */ + public function updateARole($options) + { + list($response) = $this->updateARoleWithHttpInfo($options); + return $response; + } + + /** + * Operation updateARoleWithHttpInfo + * + * Update a role + * + * 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 $role_id Alphanumeric string identifying the role. (required) + * @param array $request_body (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + */ + public function updateARoleWithHttpInfo($options) + { + $request = $this->updateARoleRequest($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 ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'object'; + 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(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateARoleAsync + * + * Update a role + * + * 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 $role_id Alphanumeric string identifying the role. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateARoleAsync($options) + { + return $this->updateARoleAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateARoleAsyncWithHttpInfo + * + * Update a role + * + * 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 $role_id Alphanumeric string identifying the role. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateARoleAsyncWithHttpInfo($options) + { + $returnType = 'object'; + $request = $this->updateARoleRequest($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 'updateARole' + * + * 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 $role_id Alphanumeric string identifying the role. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateARoleRequest($options) + { + // unbox the parameters from the associative array + $role_id = array_key_exists('role_id', $options) ? $options['role_id'] : null; + $request_body = array_key_exists('request_body', $options) ? $options['request_body'] : null; + + // verify the required parameter 'role_id' is set + if ($role_id === null || (is_array($role_id) && count($role_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $role_id when calling updateARole' + ); + } + + $resourcePath = '/roles/{role_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($role_id !== null) { + $resourcePath = str_replace( + '{' . 'role_id' . '}', + ObjectSerializer::toPathValue($role_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($request_body)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($request_body)); + } else { + $httpBody = $request_body; + } + } 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 * diff --git a/lib/Api/IamServiceGroupsApi.php b/lib/Api/IamServiceGroupsApi.php index 09f72d76..41133775 100644 --- a/lib/Api/IamServiceGroupsApi.php +++ b/lib/Api/IamServiceGroupsApi.php @@ -110,9 +110,9 @@ public function getConfig() } /** - * Operation deleteAServiceGroup + * Operation addServiceGroupServices * - * Delete a service group + * Add services in a service group * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -120,20 +120,22 @@ public function getConfig() * URL: https://api.fastly.com * * @param string $service_group_id Alphanumeric string identifying the service group. (required) + * @param array $request_body request_body (optional) * * @throws \Fastly\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return object */ - public function deleteAServiceGroup($options) + public function addServiceGroupServices($options) { - $this->deleteAServiceGroupWithHttpInfo($options); + list($response) = $this->addServiceGroupServicesWithHttpInfo($options); + return $response; } /** - * Operation deleteAServiceGroupWithHttpInfo + * Operation addServiceGroupServicesWithHttpInfo * - * Delete a service group + * Add services in a service group * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -141,14 +143,15 @@ public function deleteAServiceGroup($options) * URL: https://api.fastly.com * * @param string $service_group_id Alphanumeric string identifying the service group. (required) + * @param array $request_body (optional) * * @throws \Fastly\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of object, HTTP status code, HTTP response headers (array of strings) */ - public function deleteAServiceGroupWithHttpInfo($options) + public function addServiceGroupServicesWithHttpInfo($options) { - $request = $this->deleteAServiceGroupRequest($options); + $request = $this->addServiceGroupServicesRequest($options); try { $options = $this->createHttpClientOption(); @@ -170,7 +173,7 @@ public function deleteAServiceGroupWithHttpInfo($options) ); } - if ('DELETE' != 'GET' && 'DELETE' != 'HEAD') { + if ('POST' != 'GET' && 'POST' != 'HEAD') { $header = $response->getHeader('Fastly-RateLimit-Remaining'); if (count($header) > 0) { $this->config->setRateLimitRemaining($header[0]); @@ -197,19 +200,53 @@ public function deleteAServiceGroupWithHttpInfo($options) ); } - return [null, $statusCode, $response->getHeaders()]; + switch($statusCode) { + case 201: + if ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'object'; + 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 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } } /** - * Operation deleteAServiceGroupAsync + * Operation addServiceGroupServicesAsync * - * Delete a service group + * Add services in a service group * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -217,13 +254,14 @@ public function deleteAServiceGroupWithHttpInfo($options) * URL: https://api.fastly.com * * @param string $service_group_id Alphanumeric string identifying the service group. (required) + * @param array $request_body (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteAServiceGroupAsync($options) + public function addServiceGroupServicesAsync($options) { - return $this->deleteAServiceGroupAsyncWithHttpInfo($options) + return $this->addServiceGroupServicesAsyncWithHttpInfo($options) ->then( function ($response) { return $response[0]; @@ -232,9 +270,9 @@ function ($response) { } /** - * Operation deleteAServiceGroupAsyncWithHttpInfo + * Operation addServiceGroupServicesAsyncWithHttpInfo * - * Delete a service group + * Add services in a service group * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -242,20 +280,31 @@ function ($response) { * URL: https://api.fastly.com * * @param string $service_group_id Alphanumeric string identifying the service group. (required) + * @param array $request_body (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteAServiceGroupAsyncWithHttpInfo($options) + public function addServiceGroupServicesAsyncWithHttpInfo($options) { - $returnType = ''; - $request = $this->deleteAServiceGroupRequest($options); + $returnType = 'object'; + $request = $this->addServiceGroupServicesRequest($options); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + 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(); @@ -275,7 +324,7 @@ function ($exception) { } /** - * Create request for operation 'deleteAServiceGroup' + * Create request for operation 'addServiceGroupServices' * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -283,23 +332,25 @@ function ($exception) { * URL: https://api.fastly.com * * @param string $service_group_id Alphanumeric string identifying the service group. (required) + * @param array $request_body (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteAServiceGroupRequest($options) + public function addServiceGroupServicesRequest($options) { // unbox the parameters from the associative array $service_group_id = array_key_exists('service_group_id', $options) ? $options['service_group_id'] : null; + $request_body = array_key_exists('request_body', $options) ? $options['request_body'] : null; // verify the required parameter 'service_group_id' is set if ($service_group_id === null || (is_array($service_group_id) && count($service_group_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $service_group_id when calling deleteAServiceGroup' + 'Missing the required parameter $service_group_id when calling addServiceGroupServices' ); } - $resourcePath = '/service-groups/{service_group_id}'; + $resourcePath = '/service-groups/{service_group_id}/services'; $formParams = []; $queryParams = []; $headerParams = []; @@ -320,17 +371,23 @@ public function deleteAServiceGroupRequest($options) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - [] + ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( - [], - [] + ['application/json'], + ['application/json'] ); } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($request_body)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($request_body)); + } else { + $httpBody = $request_body; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -379,7 +436,7 @@ public function deleteAServiceGroupRequest($options) $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( - 'DELETE', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -387,46 +444,46 @@ public function deleteAServiceGroupRequest($options) } /** - * Operation getAServiceGroup + * Operation createAServiceGroup * - * Get a service group + * Create a service group * * 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 $service_group_id Alphanumeric string identifying the service group. (required) + * @param array $request_body request_body (optional) * * @throws \Fastly\ApiException on non-2xx response * @throws \InvalidArgumentException * @return object */ - public function getAServiceGroup($options) + public function createAServiceGroup($options) { - list($response) = $this->getAServiceGroupWithHttpInfo($options); + list($response) = $this->createAServiceGroupWithHttpInfo($options); return $response; } /** - * Operation getAServiceGroupWithHttpInfo + * Operation createAServiceGroupWithHttpInfo * - * Get a service group + * Create a service group * * 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 $service_group_id Alphanumeric string identifying the service group. (required) + * @param array $request_body (optional) * * @throws \Fastly\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of object, HTTP status code, HTTP response headers (array of strings) */ - public function getAServiceGroupWithHttpInfo($options) + public function createAServiceGroupWithHttpInfo($options) { - $request = $this->getAServiceGroupRequest($options); + $request = $this->createAServiceGroupRequest($options); try { $options = $this->createHttpClientOption(); @@ -448,7 +505,7 @@ public function getAServiceGroupWithHttpInfo($options) ); } - if ('GET' != 'GET' && 'GET' != 'HEAD') { + if ('POST' != 'GET' && 'POST' != 'HEAD') { $header = $response->getHeader('Fastly-RateLimit-Remaining'); if (count($header) > 0) { $this->config->setRateLimitRemaining($header[0]); @@ -476,7 +533,7 @@ public function getAServiceGroupWithHttpInfo($options) } switch($statusCode) { - case 200: + case 201: if ('object' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -505,7 +562,7 @@ public function getAServiceGroupWithHttpInfo($options) } catch (ApiException $e) { switch ($e->getCode()) { - case 200: + case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'object', @@ -519,23 +576,23 @@ public function getAServiceGroupWithHttpInfo($options) } /** - * Operation getAServiceGroupAsync + * Operation createAServiceGroupAsync * - * Get a service group + * Create a service group * * 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 $service_group_id Alphanumeric string identifying the service group. (required) + * @param array $request_body (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAServiceGroupAsync($options) + public function createAServiceGroupAsync($options) { - return $this->getAServiceGroupAsyncWithHttpInfo($options) + return $this->createAServiceGroupAsyncWithHttpInfo($options) ->then( function ($response) { return $response[0]; @@ -544,24 +601,24 @@ function ($response) { } /** - * Operation getAServiceGroupAsyncWithHttpInfo + * Operation createAServiceGroupAsyncWithHttpInfo * - * Get a service group + * Create a service group * * 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 $service_group_id Alphanumeric string identifying the service group. (required) + * @param array $request_body (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAServiceGroupAsyncWithHttpInfo($options) + public function createAServiceGroupAsyncWithHttpInfo($options) { $returnType = 'object'; - $request = $this->getAServiceGroupRequest($options); + $request = $this->createAServiceGroupRequest($options); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -597,31 +654,25 @@ function ($exception) { } /** - * Create request for operation 'getAServiceGroup' + * Create request for operation 'createAServiceGroup' * * 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 $service_group_id Alphanumeric string identifying the service group. (required) + * @param array $request_body (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getAServiceGroupRequest($options) + public function createAServiceGroupRequest($options) { // unbox the parameters from the associative array - $service_group_id = array_key_exists('service_group_id', $options) ? $options['service_group_id'] : null; + $request_body = array_key_exists('request_body', $options) ? $options['request_body'] : null; - // verify the required parameter 'service_group_id' is set - if ($service_group_id === null || (is_array($service_group_id) && count($service_group_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $service_group_id when calling getAServiceGroup' - ); - } - $resourcePath = '/service-groups/{service_group_id}'; + $resourcePath = '/service-groups'; $formParams = []; $queryParams = []; $headerParams = []; @@ -630,14 +681,6 @@ public function getAServiceGroupRequest($options) - // path params - if ($service_group_id !== null) { - $resourcePath = str_replace( - '{' . 'service_group_id' . '}', - ObjectSerializer::toPathValue($service_group_id), - $resourcePath - ); - } if ($multipart) { @@ -647,12 +690,18 @@ public function getAServiceGroupRequest($options) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - [] + ['application/json'] ); } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($request_body)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($request_body)); + } else { + $httpBody = $request_body; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -701,7 +750,7 @@ public function getAServiceGroupRequest($options) $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -709,9 +758,9 @@ public function getAServiceGroupRequest($options) } /** - * Operation listServiceGroupServices + * Operation deleteAServiceGroup * - * List services to a service group + * Delete a service group * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -719,23 +768,20 @@ public function getAServiceGroupRequest($options) * URL: https://api.fastly.com * * @param string $service_group_id Alphanumeric string identifying the service group. (required) - * @param int $per_page Number of records per page. (optional, default to 20) - * @param int $page Current page. (optional) * * @throws \Fastly\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return object + * @return void */ - public function listServiceGroupServices($options) + public function deleteAServiceGroup($options) { - list($response) = $this->listServiceGroupServicesWithHttpInfo($options); - return $response; + $this->deleteAServiceGroupWithHttpInfo($options); } /** - * Operation listServiceGroupServicesWithHttpInfo + * Operation deleteAServiceGroupWithHttpInfo * - * List services to a service group + * Delete a service group * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -743,16 +789,14 @@ public function listServiceGroupServices($options) * URL: https://api.fastly.com * * @param string $service_group_id Alphanumeric string identifying the service group. (required) - * @param int $per_page Number of records per page. (optional, default to 20) - * @param int $page Current page. (optional) * * @throws \Fastly\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of object, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function listServiceGroupServicesWithHttpInfo($options) + public function deleteAServiceGroupWithHttpInfo($options) { - $request = $this->listServiceGroupServicesRequest($options); + $request = $this->deleteAServiceGroupRequest($options); try { $options = $this->createHttpClientOption(); @@ -774,7 +818,7 @@ public function listServiceGroupServicesWithHttpInfo($options) ); } - if ('GET' != 'GET' && 'GET' != 'HEAD') { + if ('DELETE' != 'GET' && 'DELETE' != 'HEAD') { $header = $response->getHeader('Fastly-RateLimit-Remaining'); if (count($header) > 0) { $this->config->setRateLimitRemaining($header[0]); @@ -801,53 +845,19 @@ public function listServiceGroupServicesWithHttpInfo($options) ); } - switch($statusCode) { - case 200: - if ('object' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, 'object', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = 'object'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - 'object', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; } throw $e; } } /** - * Operation listServiceGroupServicesAsync + * Operation deleteAServiceGroupAsync * - * List services to a service group + * Delete a service group * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -855,15 +865,13 @@ public function listServiceGroupServicesWithHttpInfo($options) * URL: https://api.fastly.com * * @param string $service_group_id Alphanumeric string identifying the service group. (required) - * @param int $per_page Number of records per page. (optional, default to 20) - * @param int $page Current page. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listServiceGroupServicesAsync($options) + public function deleteAServiceGroupAsync($options) { - return $this->listServiceGroupServicesAsyncWithHttpInfo($options) + return $this->deleteAServiceGroupAsyncWithHttpInfo($options) ->then( function ($response) { return $response[0]; @@ -872,9 +880,9 @@ function ($response) { } /** - * Operation listServiceGroupServicesAsyncWithHttpInfo + * Operation deleteAServiceGroupAsyncWithHttpInfo * - * List services to a service group + * Delete a service group * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -882,32 +890,20 @@ function ($response) { * URL: https://api.fastly.com * * @param string $service_group_id Alphanumeric string identifying the service group. (required) - * @param int $per_page Number of records per page. (optional, default to 20) - * @param int $page Current page. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listServiceGroupServicesAsyncWithHttpInfo($options) + public function deleteAServiceGroupAsyncWithHttpInfo($options) { - $returnType = 'object'; - $request = $this->listServiceGroupServicesRequest($options); + $returnType = ''; + $request = $this->deleteAServiceGroupRequest($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() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -927,7 +923,7 @@ function ($exception) { } /** - * Create request for operation 'listServiceGroupServices' + * Create request for operation 'deleteAServiceGroup' * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -935,62 +931,29 @@ function ($exception) { * URL: https://api.fastly.com * * @param string $service_group_id Alphanumeric string identifying the service group. (required) - * @param int $per_page Number of records per page. (optional, default to 20) - * @param int $page Current page. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function listServiceGroupServicesRequest($options) + public function deleteAServiceGroupRequest($options) { // unbox the parameters from the associative array $service_group_id = array_key_exists('service_group_id', $options) ? $options['service_group_id'] : null; - $per_page = array_key_exists('per_page', $options) ? $options['per_page'] : 20; - $page = array_key_exists('page', $options) ? $options['page'] : null; // verify the required parameter 'service_group_id' is set if ($service_group_id === null || (is_array($service_group_id) && count($service_group_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $service_group_id when calling listServiceGroupServices' + 'Missing the required parameter $service_group_id when calling deleteAServiceGroup' ); } - if ($per_page !== null && $per_page > 100) { - throw new \InvalidArgumentException('invalid value for "$per_page" when calling IamServiceGroupsApi.listServiceGroupServices, must be smaller than or equal to 100.'); - } - if ($per_page !== null && $per_page < 1) { - throw new \InvalidArgumentException('invalid value for "$per_page" when calling IamServiceGroupsApi.listServiceGroupServices, must be bigger than or equal to 1.'); - } - - $resourcePath = '/service-groups/{service_group_id}/services'; + $resourcePath = '/service-groups/{service_group_id}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if ($per_page !== null) { - if('form' === 'form' && is_array($per_page)) { - foreach($per_page as $key => $value) { - $queryParams[$key] = ObjectSerializer::toString($value); - } - } - else { - $queryParams['per_page'] = ObjectSerializer::toString($per_page); - } - } - // query params - if ($page !== null) { - if('form' === 'form' && is_array($page)) { - foreach($page as $key => $value) { - $queryParams[$key] = ObjectSerializer::toString($value); - } - } - else { - $queryParams['page'] = ObjectSerializer::toString($page); - } - } // path params @@ -1005,11 +968,11 @@ public function listServiceGroupServicesRequest($options) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + [] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + [], [] ); } @@ -1064,7 +1027,7 @@ public function listServiceGroupServicesRequest($options) $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( - 'GET', + 'DELETE', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -1072,48 +1035,46 @@ public function listServiceGroupServicesRequest($options) } /** - * Operation listServiceGroups + * Operation getAServiceGroup * - * List service groups + * Get a service group * * 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 int $per_page Number of records per page. (optional, default to 20) - * @param int $page Current page. (optional) + * @param string $service_group_id Alphanumeric string identifying the service group. (required) * * @throws \Fastly\ApiException on non-2xx response * @throws \InvalidArgumentException * @return object */ - public function listServiceGroups($options) + public function getAServiceGroup($options) { - list($response) = $this->listServiceGroupsWithHttpInfo($options); + list($response) = $this->getAServiceGroupWithHttpInfo($options); return $response; } /** - * Operation listServiceGroupsWithHttpInfo + * Operation getAServiceGroupWithHttpInfo * - * List service groups + * Get a service group * * 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 int $per_page Number of records per page. (optional, default to 20) - * @param int $page Current page. (optional) + * @param string $service_group_id Alphanumeric string identifying the service group. (required) * * @throws \Fastly\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of object, HTTP status code, HTTP response headers (array of strings) */ - public function listServiceGroupsWithHttpInfo($options) + public function getAServiceGroupWithHttpInfo($options) { - $request = $this->listServiceGroupsRequest($options); + $request = $this->getAServiceGroupRequest($options); try { $options = $this->createHttpClientOption(); @@ -1206,24 +1167,23 @@ public function listServiceGroupsWithHttpInfo($options) } /** - * Operation listServiceGroupsAsync + * Operation getAServiceGroupAsync * - * List service groups + * Get a service group * * 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 int $per_page Number of records per page. (optional, default to 20) - * @param int $page Current page. (optional) + * @param string $service_group_id Alphanumeric string identifying the service group. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listServiceGroupsAsync($options) + public function getAServiceGroupAsync($options) { - return $this->listServiceGroupsAsyncWithHttpInfo($options) + return $this->getAServiceGroupAsyncWithHttpInfo($options) ->then( function ($response) { return $response[0]; @@ -1232,25 +1192,24 @@ function ($response) { } /** - * Operation listServiceGroupsAsyncWithHttpInfo + * Operation getAServiceGroupAsyncWithHttpInfo * - * List service groups + * Get a service group * * 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 int $per_page Number of records per page. (optional, default to 20) - * @param int $page Current page. (optional) + * @param string $service_group_id Alphanumeric string identifying the service group. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listServiceGroupsAsyncWithHttpInfo($options) + public function getAServiceGroupAsyncWithHttpInfo($options) { $returnType = 'object'; - $request = $this->listServiceGroupsRequest($options); + $request = $this->getAServiceGroupRequest($options); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1286,64 +1245,47 @@ function ($exception) { } /** - * Create request for operation 'listServiceGroups' + * Create request for operation 'getAServiceGroup' * * 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 int $per_page Number of records per page. (optional, default to 20) - * @param int $page Current page. (optional) + * @param string $service_group_id Alphanumeric string identifying the service group. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function listServiceGroupsRequest($options) + public function getAServiceGroupRequest($options) { // unbox the parameters from the associative array - $per_page = array_key_exists('per_page', $options) ? $options['per_page'] : 20; - $page = array_key_exists('page', $options) ? $options['page'] : null; + $service_group_id = array_key_exists('service_group_id', $options) ? $options['service_group_id'] : null; - if ($per_page !== null && $per_page > 100) { - throw new \InvalidArgumentException('invalid value for "$per_page" when calling IamServiceGroupsApi.listServiceGroups, must be smaller than or equal to 100.'); - } - if ($per_page !== null && $per_page < 1) { - throw new \InvalidArgumentException('invalid value for "$per_page" when calling IamServiceGroupsApi.listServiceGroups, must be bigger than or equal to 1.'); + // verify the required parameter 'service_group_id' is set + if ($service_group_id === null || (is_array($service_group_id) && count($service_group_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $service_group_id when calling getAServiceGroup' + ); } - - $resourcePath = '/service-groups'; + $resourcePath = '/service-groups/{service_group_id}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if ($per_page !== null) { - if('form' === 'form' && is_array($per_page)) { - foreach($per_page as $key => $value) { - $queryParams[$key] = ObjectSerializer::toString($value); - } - } - else { - $queryParams['per_page'] = ObjectSerializer::toString($per_page); - } - } - // query params - if ($page !== null) { - if('form' === 'form' && is_array($page)) { - foreach($page as $key => $value) { - $queryParams[$key] = ObjectSerializer::toString($value); - } - } - else { - $queryParams['page'] = ObjectSerializer::toString($page); - } - } + // path params + if ($service_group_id !== null) { + $resourcePath = str_replace( + '{' . 'service_group_id' . '}', + ObjectSerializer::toPathValue($service_group_id), + $resourcePath + ); + } if ($multipart) { @@ -1414,6 +1356,1335 @@ public function listServiceGroupsRequest($options) ); } + /** + * Operation listServiceGroupServices + * + * List services to a service group + * + * 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 $service_group_id Alphanumeric string identifying the service group. (required) + * @param int $per_page Number of records per page. (optional, default to 20) + * @param int $page Current page. (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return object + */ + public function listServiceGroupServices($options) + { + list($response) = $this->listServiceGroupServicesWithHttpInfo($options); + return $response; + } + + /** + * Operation listServiceGroupServicesWithHttpInfo + * + * List services to a service group + * + * 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 $service_group_id Alphanumeric string identifying the service group. (required) + * @param int $per_page Number of records per page. (optional, default to 20) + * @param int $page Current page. (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + */ + public function listServiceGroupServicesWithHttpInfo($options) + { + $request = $this->listServiceGroupServicesRequest($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 ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'object'; + 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(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listServiceGroupServicesAsync + * + * List services to a service group + * + * 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 $service_group_id Alphanumeric string identifying the service group. (required) + * @param int $per_page Number of records per page. (optional, default to 20) + * @param int $page Current page. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listServiceGroupServicesAsync($options) + { + return $this->listServiceGroupServicesAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listServiceGroupServicesAsyncWithHttpInfo + * + * List services to a service group + * + * 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 $service_group_id Alphanumeric string identifying the service group. (required) + * @param int $per_page Number of records per page. (optional, default to 20) + * @param int $page Current page. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listServiceGroupServicesAsyncWithHttpInfo($options) + { + $returnType = 'object'; + $request = $this->listServiceGroupServicesRequest($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 'listServiceGroupServices' + * + * 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 $service_group_id Alphanumeric string identifying the service group. (required) + * @param int $per_page Number of records per page. (optional, default to 20) + * @param int $page Current page. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listServiceGroupServicesRequest($options) + { + // unbox the parameters from the associative array + $service_group_id = array_key_exists('service_group_id', $options) ? $options['service_group_id'] : null; + $per_page = array_key_exists('per_page', $options) ? $options['per_page'] : 20; + $page = array_key_exists('page', $options) ? $options['page'] : null; + + // verify the required parameter 'service_group_id' is set + if ($service_group_id === null || (is_array($service_group_id) && count($service_group_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $service_group_id when calling listServiceGroupServices' + ); + } + if ($per_page !== null && $per_page > 100) { + throw new \InvalidArgumentException('invalid value for "$per_page" when calling IamServiceGroupsApi.listServiceGroupServices, must be smaller than or equal to 100.'); + } + if ($per_page !== null && $per_page < 1) { + throw new \InvalidArgumentException('invalid value for "$per_page" when calling IamServiceGroupsApi.listServiceGroupServices, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/service-groups/{service_group_id}/services'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($per_page !== null) { + if('form' === 'form' && is_array($per_page)) { + foreach($per_page as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['per_page'] = ObjectSerializer::toString($per_page); + } + } + // query params + if ($page !== null) { + if('form' === 'form' && is_array($page)) { + foreach($page as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['page'] = ObjectSerializer::toString($page); + } + } + + + // path params + if ($service_group_id !== null) { + $resourcePath = str_replace( + '{' . 'service_group_id' . '}', + ObjectSerializer::toPathValue($service_group_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 listServiceGroups + * + * List service groups + * + * 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 int $per_page Number of records per page. (optional, default to 20) + * @param int $page Current page. (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return object + */ + public function listServiceGroups($options) + { + list($response) = $this->listServiceGroupsWithHttpInfo($options); + return $response; + } + + /** + * Operation listServiceGroupsWithHttpInfo + * + * List service groups + * + * 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 int $per_page Number of records per page. (optional, default to 20) + * @param int $page Current page. (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + */ + public function listServiceGroupsWithHttpInfo($options) + { + $request = $this->listServiceGroupsRequest($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 ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'object'; + 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(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listServiceGroupsAsync + * + * List service groups + * + * 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 int $per_page Number of records per page. (optional, default to 20) + * @param int $page Current page. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listServiceGroupsAsync($options) + { + return $this->listServiceGroupsAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listServiceGroupsAsyncWithHttpInfo + * + * List service groups + * + * 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 int $per_page Number of records per page. (optional, default to 20) + * @param int $page Current page. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listServiceGroupsAsyncWithHttpInfo($options) + { + $returnType = 'object'; + $request = $this->listServiceGroupsRequest($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 'listServiceGroups' + * + * 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 int $per_page Number of records per page. (optional, default to 20) + * @param int $page Current page. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listServiceGroupsRequest($options) + { + // unbox the parameters from the associative array + $per_page = array_key_exists('per_page', $options) ? $options['per_page'] : 20; + $page = array_key_exists('page', $options) ? $options['page'] : null; + + if ($per_page !== null && $per_page > 100) { + throw new \InvalidArgumentException('invalid value for "$per_page" when calling IamServiceGroupsApi.listServiceGroups, must be smaller than or equal to 100.'); + } + if ($per_page !== null && $per_page < 1) { + throw new \InvalidArgumentException('invalid value for "$per_page" when calling IamServiceGroupsApi.listServiceGroups, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/service-groups'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($per_page !== null) { + if('form' === 'form' && is_array($per_page)) { + foreach($per_page as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['per_page'] = ObjectSerializer::toString($per_page); + } + } + // query params + if ($page !== null) { + if('form' === 'form' && is_array($page)) { + foreach($page as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['page'] = ObjectSerializer::toString($page); + } + } + + + + + 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 removeServiceGroupServices + * + * Remove services from a service group + * + * 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 $service_group_id Alphanumeric string identifying the service group. (required) + * @param array $request_body request_body (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function removeServiceGroupServices($options) + { + $this->removeServiceGroupServicesWithHttpInfo($options); + } + + /** + * Operation removeServiceGroupServicesWithHttpInfo + * + * Remove services from a service group + * + * 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 $service_group_id Alphanumeric string identifying the service group. (required) + * @param array $request_body (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function removeServiceGroupServicesWithHttpInfo($options) + { + $request = $this->removeServiceGroupServicesRequest($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 removeServiceGroupServicesAsync + * + * Remove services from a service group + * + * 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 $service_group_id Alphanumeric string identifying the service group. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function removeServiceGroupServicesAsync($options) + { + return $this->removeServiceGroupServicesAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation removeServiceGroupServicesAsyncWithHttpInfo + * + * Remove services from a service group + * + * 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 $service_group_id Alphanumeric string identifying the service group. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function removeServiceGroupServicesAsyncWithHttpInfo($options) + { + $returnType = ''; + $request = $this->removeServiceGroupServicesRequest($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 'removeServiceGroupServices' + * + * 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 $service_group_id Alphanumeric string identifying the service group. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function removeServiceGroupServicesRequest($options) + { + // unbox the parameters from the associative array + $service_group_id = array_key_exists('service_group_id', $options) ? $options['service_group_id'] : null; + $request_body = array_key_exists('request_body', $options) ? $options['request_body'] : null; + + // verify the required parameter 'service_group_id' is set + if ($service_group_id === null || (is_array($service_group_id) && count($service_group_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $service_group_id when calling removeServiceGroupServices' + ); + } + + $resourcePath = '/service-groups/{service_group_id}/services'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($service_group_id !== null) { + $resourcePath = str_replace( + '{' . 'service_group_id' . '}', + ObjectSerializer::toPathValue($service_group_id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + [] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + [], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($request_body)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($request_body)); + } else { + $httpBody = $request_body; + } + } 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( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateAServiceGroup + * + * Update a service group + * + * 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 $service_group_id Alphanumeric string identifying the service group. (required) + * @param array $request_body request_body (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return object + */ + public function updateAServiceGroup($options) + { + list($response) = $this->updateAServiceGroupWithHttpInfo($options); + return $response; + } + + /** + * Operation updateAServiceGroupWithHttpInfo + * + * Update a service group + * + * 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 $service_group_id Alphanumeric string identifying the service group. (required) + * @param array $request_body (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + */ + public function updateAServiceGroupWithHttpInfo($options) + { + $request = $this->updateAServiceGroupRequest($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 ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'object'; + 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(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateAServiceGroupAsync + * + * Update a service group + * + * 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 $service_group_id Alphanumeric string identifying the service group. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateAServiceGroupAsync($options) + { + return $this->updateAServiceGroupAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateAServiceGroupAsyncWithHttpInfo + * + * Update a service group + * + * 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 $service_group_id Alphanumeric string identifying the service group. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateAServiceGroupAsyncWithHttpInfo($options) + { + $returnType = 'object'; + $request = $this->updateAServiceGroupRequest($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 'updateAServiceGroup' + * + * 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 $service_group_id Alphanumeric string identifying the service group. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateAServiceGroupRequest($options) + { + // unbox the parameters from the associative array + $service_group_id = array_key_exists('service_group_id', $options) ? $options['service_group_id'] : null; + $request_body = array_key_exists('request_body', $options) ? $options['request_body'] : null; + + // verify the required parameter 'service_group_id' is set + if ($service_group_id === null || (is_array($service_group_id) && count($service_group_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $service_group_id when calling updateAServiceGroup' + ); + } + + $resourcePath = '/service-groups/{service_group_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($service_group_id !== null) { + $resourcePath = str_replace( + '{' . 'service_group_id' . '}', + ObjectSerializer::toPathValue($service_group_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($request_body)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($request_body)); + } else { + $httpBody = $request_body; + } + } 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 * diff --git a/lib/Api/IamUserGroupsApi.php b/lib/Api/IamUserGroupsApi.php index e9cd0488..55c87b93 100644 --- a/lib/Api/IamUserGroupsApi.php +++ b/lib/Api/IamUserGroupsApi.php @@ -110,9 +110,9 @@ public function getConfig() } /** - * Operation deleteAUserGroup + * Operation addUserGroupMembers * - * Delete a user group + * Add members to a user group * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -120,20 +120,22 @@ public function getConfig() * URL: https://api.fastly.com * * @param string $user_group_id Alphanumeric string identifying the user group. (required) + * @param array $request_body request_body (optional) * * @throws \Fastly\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return object */ - public function deleteAUserGroup($options) + public function addUserGroupMembers($options) { - $this->deleteAUserGroupWithHttpInfo($options); + list($response) = $this->addUserGroupMembersWithHttpInfo($options); + return $response; } /** - * Operation deleteAUserGroupWithHttpInfo + * Operation addUserGroupMembersWithHttpInfo * - * Delete a user group + * Add members to a user group * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -141,14 +143,15 @@ public function deleteAUserGroup($options) * URL: https://api.fastly.com * * @param string $user_group_id Alphanumeric string identifying the user group. (required) + * @param array $request_body (optional) * * @throws \Fastly\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of object, HTTP status code, HTTP response headers (array of strings) */ - public function deleteAUserGroupWithHttpInfo($options) + public function addUserGroupMembersWithHttpInfo($options) { - $request = $this->deleteAUserGroupRequest($options); + $request = $this->addUserGroupMembersRequest($options); try { $options = $this->createHttpClientOption(); @@ -170,7 +173,7 @@ public function deleteAUserGroupWithHttpInfo($options) ); } - if ('DELETE' != 'GET' && 'DELETE' != 'HEAD') { + if ('POST' != 'GET' && 'POST' != 'HEAD') { $header = $response->getHeader('Fastly-RateLimit-Remaining'); if (count($header) > 0) { $this->config->setRateLimitRemaining($header[0]); @@ -197,19 +200,53 @@ public function deleteAUserGroupWithHttpInfo($options) ); } - return [null, $statusCode, $response->getHeaders()]; + switch($statusCode) { + case 201: + if ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'object'; + 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 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } } /** - * Operation deleteAUserGroupAsync + * Operation addUserGroupMembersAsync * - * Delete a user group + * Add members to a user group * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -217,13 +254,14 @@ public function deleteAUserGroupWithHttpInfo($options) * URL: https://api.fastly.com * * @param string $user_group_id Alphanumeric string identifying the user group. (required) + * @param array $request_body (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteAUserGroupAsync($options) + public function addUserGroupMembersAsync($options) { - return $this->deleteAUserGroupAsyncWithHttpInfo($options) + return $this->addUserGroupMembersAsyncWithHttpInfo($options) ->then( function ($response) { return $response[0]; @@ -232,9 +270,9 @@ function ($response) { } /** - * Operation deleteAUserGroupAsyncWithHttpInfo + * Operation addUserGroupMembersAsyncWithHttpInfo * - * Delete a user group + * Add members to a user group * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -242,20 +280,31 @@ function ($response) { * URL: https://api.fastly.com * * @param string $user_group_id Alphanumeric string identifying the user group. (required) + * @param array $request_body (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteAUserGroupAsyncWithHttpInfo($options) + public function addUserGroupMembersAsyncWithHttpInfo($options) { - $returnType = ''; - $request = $this->deleteAUserGroupRequest($options); + $returnType = 'object'; + $request = $this->addUserGroupMembersRequest($options); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + 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(); @@ -275,7 +324,7 @@ function ($exception) { } /** - * Create request for operation 'deleteAUserGroup' + * Create request for operation 'addUserGroupMembers' * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -283,23 +332,25 @@ function ($exception) { * URL: https://api.fastly.com * * @param string $user_group_id Alphanumeric string identifying the user group. (required) + * @param array $request_body (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteAUserGroupRequest($options) + public function addUserGroupMembersRequest($options) { // unbox the parameters from the associative array $user_group_id = array_key_exists('user_group_id', $options) ? $options['user_group_id'] : null; + $request_body = array_key_exists('request_body', $options) ? $options['request_body'] : null; // verify the required parameter 'user_group_id' is set if ($user_group_id === null || (is_array($user_group_id) && count($user_group_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $user_group_id when calling deleteAUserGroup' + 'Missing the required parameter $user_group_id when calling addUserGroupMembers' ); } - $resourcePath = '/user-groups/{user_group_id}'; + $resourcePath = '/user-groups/{user_group_id}/members'; $formParams = []; $queryParams = []; $headerParams = []; @@ -320,17 +371,23 @@ public function deleteAUserGroupRequest($options) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - [] + ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( - [], - [] + ['application/json'], + ['application/json'] ); } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($request_body)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($request_body)); + } else { + $httpBody = $request_body; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -379,7 +436,7 @@ public function deleteAUserGroupRequest($options) $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( - 'DELETE', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -387,9 +444,9 @@ public function deleteAUserGroupRequest($options) } /** - * Operation getAUserGroup + * Operation addUserGroupRoles * - * Get a user group + * Add roles to a user group * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -397,21 +454,22 @@ public function deleteAUserGroupRequest($options) * URL: https://api.fastly.com * * @param string $user_group_id Alphanumeric string identifying the user group. (required) + * @param array $request_body request_body (optional) * * @throws \Fastly\ApiException on non-2xx response * @throws \InvalidArgumentException * @return object */ - public function getAUserGroup($options) + public function addUserGroupRoles($options) { - list($response) = $this->getAUserGroupWithHttpInfo($options); + list($response) = $this->addUserGroupRolesWithHttpInfo($options); return $response; } /** - * Operation getAUserGroupWithHttpInfo + * Operation addUserGroupRolesWithHttpInfo * - * Get a user group + * Add roles to a user group * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -419,14 +477,15 @@ public function getAUserGroup($options) * URL: https://api.fastly.com * * @param string $user_group_id Alphanumeric string identifying the user group. (required) + * @param array $request_body (optional) * * @throws \Fastly\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of object, HTTP status code, HTTP response headers (array of strings) */ - public function getAUserGroupWithHttpInfo($options) + public function addUserGroupRolesWithHttpInfo($options) { - $request = $this->getAUserGroupRequest($options); + $request = $this->addUserGroupRolesRequest($options); try { $options = $this->createHttpClientOption(); @@ -448,7 +507,7 @@ public function getAUserGroupWithHttpInfo($options) ); } - if ('GET' != 'GET' && 'GET' != 'HEAD') { + if ('POST' != 'GET' && 'POST' != 'HEAD') { $header = $response->getHeader('Fastly-RateLimit-Remaining'); if (count($header) > 0) { $this->config->setRateLimitRemaining($header[0]); @@ -476,7 +535,7 @@ public function getAUserGroupWithHttpInfo($options) } switch($statusCode) { - case 200: + case 201: if ('object' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -505,7 +564,7 @@ public function getAUserGroupWithHttpInfo($options) } catch (ApiException $e) { switch ($e->getCode()) { - case 200: + case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'object', @@ -519,9 +578,9 @@ public function getAUserGroupWithHttpInfo($options) } /** - * Operation getAUserGroupAsync + * Operation addUserGroupRolesAsync * - * Get a user group + * Add roles to a user group * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -529,13 +588,14 @@ public function getAUserGroupWithHttpInfo($options) * URL: https://api.fastly.com * * @param string $user_group_id Alphanumeric string identifying the user group. (required) + * @param array $request_body (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAUserGroupAsync($options) + public function addUserGroupRolesAsync($options) { - return $this->getAUserGroupAsyncWithHttpInfo($options) + return $this->addUserGroupRolesAsyncWithHttpInfo($options) ->then( function ($response) { return $response[0]; @@ -544,9 +604,9 @@ function ($response) { } /** - * Operation getAUserGroupAsyncWithHttpInfo + * Operation addUserGroupRolesAsyncWithHttpInfo * - * Get a user group + * Add roles to a user group * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -554,14 +614,15 @@ function ($response) { * URL: https://api.fastly.com * * @param string $user_group_id Alphanumeric string identifying the user group. (required) + * @param array $request_body (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAUserGroupAsyncWithHttpInfo($options) + public function addUserGroupRolesAsyncWithHttpInfo($options) { $returnType = 'object'; - $request = $this->getAUserGroupRequest($options); + $request = $this->addUserGroupRolesRequest($options); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -597,7 +658,7 @@ function ($exception) { } /** - * Create request for operation 'getAUserGroup' + * Create request for operation 'addUserGroupRoles' * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -605,23 +666,25 @@ function ($exception) { * URL: https://api.fastly.com * * @param string $user_group_id Alphanumeric string identifying the user group. (required) + * @param array $request_body (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getAUserGroupRequest($options) + public function addUserGroupRolesRequest($options) { // unbox the parameters from the associative array $user_group_id = array_key_exists('user_group_id', $options) ? $options['user_group_id'] : null; + $request_body = array_key_exists('request_body', $options) ? $options['request_body'] : null; // verify the required parameter 'user_group_id' is set if ($user_group_id === null || (is_array($user_group_id) && count($user_group_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $user_group_id when calling getAUserGroup' + 'Missing the required parameter $user_group_id when calling addUserGroupRoles' ); } - $resourcePath = '/user-groups/{user_group_id}'; + $resourcePath = '/user-groups/{user_group_id}/roles'; $formParams = []; $queryParams = []; $headerParams = []; @@ -647,12 +710,18 @@ public function getAUserGroupRequest($options) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - [] + ['application/json'] ); } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($request_body)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($request_body)); + } else { + $httpBody = $request_body; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -701,7 +770,7 @@ public function getAUserGroupRequest($options) $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -709,9 +778,9 @@ public function getAUserGroupRequest($options) } /** - * Operation listUserGroupMembers + * Operation addUserGroupServiceGroups * - * List members of a user group + * Add service groups to a user group * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -719,23 +788,22 @@ public function getAUserGroupRequest($options) * URL: https://api.fastly.com * * @param string $user_group_id Alphanumeric string identifying the user group. (required) - * @param int $per_page Number of records per page. (optional, default to 20) - * @param int $page Current page. (optional) + * @param array $request_body request_body (optional) * * @throws \Fastly\ApiException on non-2xx response * @throws \InvalidArgumentException * @return object */ - public function listUserGroupMembers($options) + public function addUserGroupServiceGroups($options) { - list($response) = $this->listUserGroupMembersWithHttpInfo($options); + list($response) = $this->addUserGroupServiceGroupsWithHttpInfo($options); return $response; } /** - * Operation listUserGroupMembersWithHttpInfo + * Operation addUserGroupServiceGroupsWithHttpInfo * - * List members of a user group + * Add service groups to a user group * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -743,16 +811,15 @@ public function listUserGroupMembers($options) * URL: https://api.fastly.com * * @param string $user_group_id Alphanumeric string identifying the user group. (required) - * @param int $per_page Number of records per page. (optional, default to 20) - * @param int $page Current page. (optional) + * @param array $request_body (optional) * * @throws \Fastly\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of object, HTTP status code, HTTP response headers (array of strings) */ - public function listUserGroupMembersWithHttpInfo($options) + public function addUserGroupServiceGroupsWithHttpInfo($options) { - $request = $this->listUserGroupMembersRequest($options); + $request = $this->addUserGroupServiceGroupsRequest($options); try { $options = $this->createHttpClientOption(); @@ -774,7 +841,7 @@ public function listUserGroupMembersWithHttpInfo($options) ); } - if ('GET' != 'GET' && 'GET' != 'HEAD') { + if ('POST' != 'GET' && 'POST' != 'HEAD') { $header = $response->getHeader('Fastly-RateLimit-Remaining'); if (count($header) > 0) { $this->config->setRateLimitRemaining($header[0]); @@ -802,7 +869,7 @@ public function listUserGroupMembersWithHttpInfo($options) } switch($statusCode) { - case 200: + case 201: if ('object' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -831,7 +898,7 @@ public function listUserGroupMembersWithHttpInfo($options) } catch (ApiException $e) { switch ($e->getCode()) { - case 200: + case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'object', @@ -845,9 +912,9 @@ public function listUserGroupMembersWithHttpInfo($options) } /** - * Operation listUserGroupMembersAsync + * Operation addUserGroupServiceGroupsAsync * - * List members of a user group + * Add service groups to a user group * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -855,15 +922,14 @@ public function listUserGroupMembersWithHttpInfo($options) * URL: https://api.fastly.com * * @param string $user_group_id Alphanumeric string identifying the user group. (required) - * @param int $per_page Number of records per page. (optional, default to 20) - * @param int $page Current page. (optional) + * @param array $request_body (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listUserGroupMembersAsync($options) + public function addUserGroupServiceGroupsAsync($options) { - return $this->listUserGroupMembersAsyncWithHttpInfo($options) + return $this->addUserGroupServiceGroupsAsyncWithHttpInfo($options) ->then( function ($response) { return $response[0]; @@ -872,9 +938,9 @@ function ($response) { } /** - * Operation listUserGroupMembersAsyncWithHttpInfo + * Operation addUserGroupServiceGroupsAsyncWithHttpInfo * - * List members of a user group + * Add service groups to a user group * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -882,16 +948,15 @@ function ($response) { * URL: https://api.fastly.com * * @param string $user_group_id Alphanumeric string identifying the user group. (required) - * @param int $per_page Number of records per page. (optional, default to 20) - * @param int $page Current page. (optional) + * @param array $request_body (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listUserGroupMembersAsyncWithHttpInfo($options) + public function addUserGroupServiceGroupsAsyncWithHttpInfo($options) { $returnType = 'object'; - $request = $this->listUserGroupMembersRequest($options); + $request = $this->addUserGroupServiceGroupsRequest($options); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -927,7 +992,7 @@ function ($exception) { } /** - * Create request for operation 'listUserGroupMembers' + * Create request for operation 'addUserGroupServiceGroups' * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -935,62 +1000,31 @@ function ($exception) { * URL: https://api.fastly.com * * @param string $user_group_id Alphanumeric string identifying the user group. (required) - * @param int $per_page Number of records per page. (optional, default to 20) - * @param int $page Current page. (optional) + * @param array $request_body (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function listUserGroupMembersRequest($options) + public function addUserGroupServiceGroupsRequest($options) { // unbox the parameters from the associative array $user_group_id = array_key_exists('user_group_id', $options) ? $options['user_group_id'] : null; - $per_page = array_key_exists('per_page', $options) ? $options['per_page'] : 20; - $page = array_key_exists('page', $options) ? $options['page'] : null; + $request_body = array_key_exists('request_body', $options) ? $options['request_body'] : null; // verify the required parameter 'user_group_id' is set if ($user_group_id === null || (is_array($user_group_id) && count($user_group_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $user_group_id when calling listUserGroupMembers' + 'Missing the required parameter $user_group_id when calling addUserGroupServiceGroups' ); } - if ($per_page !== null && $per_page > 100) { - throw new \InvalidArgumentException('invalid value for "$per_page" when calling IamUserGroupsApi.listUserGroupMembers, must be smaller than or equal to 100.'); - } - if ($per_page !== null && $per_page < 1) { - throw new \InvalidArgumentException('invalid value for "$per_page" when calling IamUserGroupsApi.listUserGroupMembers, must be bigger than or equal to 1.'); - } - - $resourcePath = '/user-groups/{user_group_id}/members'; + $resourcePath = '/user-groups/{user_group_id}/service-groups'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if ($per_page !== null) { - if('form' === 'form' && is_array($per_page)) { - foreach($per_page as $key => $value) { - $queryParams[$key] = ObjectSerializer::toString($value); - } - } - else { - $queryParams['per_page'] = ObjectSerializer::toString($per_page); - } - } - // query params - if ($page !== null) { - if('form' === 'form' && is_array($page)) { - foreach($page as $key => $value) { - $queryParams[$key] = ObjectSerializer::toString($value); - } - } - else { - $queryParams['page'] = ObjectSerializer::toString($page); - } - } // path params @@ -1010,12 +1044,18 @@ public function listUserGroupMembersRequest($options) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - [] + ['application/json'] ); } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($request_body)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($request_body)); + } else { + $httpBody = $request_body; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -1064,7 +1104,7 @@ public function listUserGroupMembersRequest($options) $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -1072,50 +1112,46 @@ public function listUserGroupMembersRequest($options) } /** - * Operation listUserGroupRoles + * Operation createAUserGroup * - * List roles in a user group + * Create a user group * * 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 $user_group_id Alphanumeric string identifying the user group. (required) - * @param int $per_page Number of records per page. (optional, default to 20) - * @param int $page Current page. (optional) + * @param array $request_body request_body (optional) * * @throws \Fastly\ApiException on non-2xx response * @throws \InvalidArgumentException * @return object */ - public function listUserGroupRoles($options) + public function createAUserGroup($options) { - list($response) = $this->listUserGroupRolesWithHttpInfo($options); + list($response) = $this->createAUserGroupWithHttpInfo($options); return $response; } /** - * Operation listUserGroupRolesWithHttpInfo + * Operation createAUserGroupWithHttpInfo * - * List roles in a user group + * Create a user group * * 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 $user_group_id Alphanumeric string identifying the user group. (required) - * @param int $per_page Number of records per page. (optional, default to 20) - * @param int $page Current page. (optional) + * @param array $request_body (optional) * * @throws \Fastly\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of object, HTTP status code, HTTP response headers (array of strings) */ - public function listUserGroupRolesWithHttpInfo($options) + public function createAUserGroupWithHttpInfo($options) { - $request = $this->listUserGroupRolesRequest($options); + $request = $this->createAUserGroupRequest($options); try { $options = $this->createHttpClientOption(); @@ -1137,7 +1173,7 @@ public function listUserGroupRolesWithHttpInfo($options) ); } - if ('GET' != 'GET' && 'GET' != 'HEAD') { + if ('POST' != 'GET' && 'POST' != 'HEAD') { $header = $response->getHeader('Fastly-RateLimit-Remaining'); if (count($header) > 0) { $this->config->setRateLimitRemaining($header[0]); @@ -1165,7 +1201,7 @@ public function listUserGroupRolesWithHttpInfo($options) } switch($statusCode) { - case 200: + case 201: if ('object' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -1194,7 +1230,7 @@ public function listUserGroupRolesWithHttpInfo($options) } catch (ApiException $e) { switch ($e->getCode()) { - case 200: + case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'object', @@ -1208,25 +1244,23 @@ public function listUserGroupRolesWithHttpInfo($options) } /** - * Operation listUserGroupRolesAsync + * Operation createAUserGroupAsync * - * List roles in a user group + * Create a user group * * 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 $user_group_id Alphanumeric string identifying the user group. (required) - * @param int $per_page Number of records per page. (optional, default to 20) - * @param int $page Current page. (optional) + * @param array $request_body (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listUserGroupRolesAsync($options) + public function createAUserGroupAsync($options) { - return $this->listUserGroupRolesAsyncWithHttpInfo($options) + return $this->createAUserGroupAsyncWithHttpInfo($options) ->then( function ($response) { return $response[0]; @@ -1235,26 +1269,24 @@ function ($response) { } /** - * Operation listUserGroupRolesAsyncWithHttpInfo + * Operation createAUserGroupAsyncWithHttpInfo * - * List roles in a user group + * Create a user group * * 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 $user_group_id Alphanumeric string identifying the user group. (required) - * @param int $per_page Number of records per page. (optional, default to 20) - * @param int $page Current page. (optional) + * @param array $request_body (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listUserGroupRolesAsyncWithHttpInfo($options) + public function createAUserGroupAsyncWithHttpInfo($options) { $returnType = 'object'; - $request = $this->listUserGroupRolesRequest($options); + $request = $this->createAUserGroupRequest($options); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1290,71 +1322,2633 @@ function ($exception) { } /** - * Create request for operation 'listUserGroupRoles' + * Create request for operation 'createAUserGroup' * * 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 $user_group_id Alphanumeric string identifying the user group. (required) - * @param int $per_page Number of records per page. (optional, default to 20) - * @param int $page Current page. (optional) + * @param array $request_body (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function listUserGroupRolesRequest($options) + public function createAUserGroupRequest($options) { // unbox the parameters from the associative array - $user_group_id = array_key_exists('user_group_id', $options) ? $options['user_group_id'] : null; - $per_page = array_key_exists('per_page', $options) ? $options['per_page'] : 20; - $page = array_key_exists('page', $options) ? $options['page'] : null; - - // verify the required parameter 'user_group_id' is set - if ($user_group_id === null || (is_array($user_group_id) && count($user_group_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $user_group_id when calling listUserGroupRoles' - ); - } - if ($per_page !== null && $per_page > 100) { - throw new \InvalidArgumentException('invalid value for "$per_page" when calling IamUserGroupsApi.listUserGroupRoles, must be smaller than or equal to 100.'); - } - if ($per_page !== null && $per_page < 1) { - throw new \InvalidArgumentException('invalid value for "$per_page" when calling IamUserGroupsApi.listUserGroupRoles, must be bigger than or equal to 1.'); - } + $request_body = array_key_exists('request_body', $options) ? $options['request_body'] : null; - $resourcePath = '/user-groups/{user_group_id}/roles'; + $resourcePath = '/user-groups'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if ($per_page !== null) { - if('form' === 'form' && is_array($per_page)) { - foreach($per_page as $key => $value) { - $queryParams[$key] = ObjectSerializer::toString($value); - } - } - else { - $queryParams['per_page'] = ObjectSerializer::toString($per_page); - } - } - // query params - if ($page !== null) { - if('form' === 'form' && is_array($page)) { - foreach($page as $key => $value) { - $queryParams[$key] = ObjectSerializer::toString($value); + + + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($request_body)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($request_body)); + } else { + $httpBody = $request_body; + } + } 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 deleteAUserGroup + * + * Delete a user group + * + * 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 $user_group_id Alphanumeric string identifying the user group. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function deleteAUserGroup($options) + { + $this->deleteAUserGroupWithHttpInfo($options); + } + + /** + * Operation deleteAUserGroupWithHttpInfo + * + * Delete a user group + * + * 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 $user_group_id Alphanumeric string identifying the user group. (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 deleteAUserGroupWithHttpInfo($options) + { + $request = $this->deleteAUserGroupRequest($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 deleteAUserGroupAsync + * + * Delete a user group + * + * 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 $user_group_id Alphanumeric string identifying the user group. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteAUserGroupAsync($options) + { + return $this->deleteAUserGroupAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteAUserGroupAsyncWithHttpInfo + * + * Delete a user group + * + * 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 $user_group_id Alphanumeric string identifying the user group. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteAUserGroupAsyncWithHttpInfo($options) + { + $returnType = ''; + $request = $this->deleteAUserGroupRequest($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 'deleteAUserGroup' + * + * 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 $user_group_id Alphanumeric string identifying the user group. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteAUserGroupRequest($options) + { + // unbox the parameters from the associative array + $user_group_id = array_key_exists('user_group_id', $options) ? $options['user_group_id'] : null; + + // verify the required parameter 'user_group_id' is set + if ($user_group_id === null || (is_array($user_group_id) && count($user_group_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $user_group_id when calling deleteAUserGroup' + ); + } + + $resourcePath = '/user-groups/{user_group_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($user_group_id !== null) { + $resourcePath = str_replace( + '{' . 'user_group_id' . '}', + ObjectSerializer::toPathValue($user_group_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 getAUserGroup + * + * Get a user group + * + * 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 $user_group_id Alphanumeric string identifying the user group. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return object + */ + public function getAUserGroup($options) + { + list($response) = $this->getAUserGroupWithHttpInfo($options); + return $response; + } + + /** + * Operation getAUserGroupWithHttpInfo + * + * Get a user group + * + * 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 $user_group_id Alphanumeric string identifying the user group. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + */ + public function getAUserGroupWithHttpInfo($options) + { + $request = $this->getAUserGroupRequest($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 ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'object'; + 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(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getAUserGroupAsync + * + * Get a user group + * + * 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 $user_group_id Alphanumeric string identifying the user group. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getAUserGroupAsync($options) + { + return $this->getAUserGroupAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getAUserGroupAsyncWithHttpInfo + * + * Get a user group + * + * 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 $user_group_id Alphanumeric string identifying the user group. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getAUserGroupAsyncWithHttpInfo($options) + { + $returnType = 'object'; + $request = $this->getAUserGroupRequest($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 'getAUserGroup' + * + * 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 $user_group_id Alphanumeric string identifying the user group. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getAUserGroupRequest($options) + { + // unbox the parameters from the associative array + $user_group_id = array_key_exists('user_group_id', $options) ? $options['user_group_id'] : null; + + // verify the required parameter 'user_group_id' is set + if ($user_group_id === null || (is_array($user_group_id) && count($user_group_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $user_group_id when calling getAUserGroup' + ); + } + + $resourcePath = '/user-groups/{user_group_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($user_group_id !== null) { + $resourcePath = str_replace( + '{' . 'user_group_id' . '}', + ObjectSerializer::toPathValue($user_group_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 listUserGroupMembers + * + * List members of a user group + * + * 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 $user_group_id Alphanumeric string identifying the user group. (required) + * @param int $per_page Number of records per page. (optional, default to 20) + * @param int $page Current page. (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return object + */ + public function listUserGroupMembers($options) + { + list($response) = $this->listUserGroupMembersWithHttpInfo($options); + return $response; + } + + /** + * Operation listUserGroupMembersWithHttpInfo + * + * List members of a user group + * + * 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 $user_group_id Alphanumeric string identifying the user group. (required) + * @param int $per_page Number of records per page. (optional, default to 20) + * @param int $page Current page. (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + */ + public function listUserGroupMembersWithHttpInfo($options) + { + $request = $this->listUserGroupMembersRequest($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 ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'object'; + 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(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listUserGroupMembersAsync + * + * List members of a user group + * + * 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 $user_group_id Alphanumeric string identifying the user group. (required) + * @param int $per_page Number of records per page. (optional, default to 20) + * @param int $page Current page. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listUserGroupMembersAsync($options) + { + return $this->listUserGroupMembersAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listUserGroupMembersAsyncWithHttpInfo + * + * List members of a user group + * + * 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 $user_group_id Alphanumeric string identifying the user group. (required) + * @param int $per_page Number of records per page. (optional, default to 20) + * @param int $page Current page. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listUserGroupMembersAsyncWithHttpInfo($options) + { + $returnType = 'object'; + $request = $this->listUserGroupMembersRequest($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 'listUserGroupMembers' + * + * 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 $user_group_id Alphanumeric string identifying the user group. (required) + * @param int $per_page Number of records per page. (optional, default to 20) + * @param int $page Current page. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listUserGroupMembersRequest($options) + { + // unbox the parameters from the associative array + $user_group_id = array_key_exists('user_group_id', $options) ? $options['user_group_id'] : null; + $per_page = array_key_exists('per_page', $options) ? $options['per_page'] : 20; + $page = array_key_exists('page', $options) ? $options['page'] : null; + + // verify the required parameter 'user_group_id' is set + if ($user_group_id === null || (is_array($user_group_id) && count($user_group_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $user_group_id when calling listUserGroupMembers' + ); + } + if ($per_page !== null && $per_page > 100) { + throw new \InvalidArgumentException('invalid value for "$per_page" when calling IamUserGroupsApi.listUserGroupMembers, must be smaller than or equal to 100.'); + } + if ($per_page !== null && $per_page < 1) { + throw new \InvalidArgumentException('invalid value for "$per_page" when calling IamUserGroupsApi.listUserGroupMembers, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/user-groups/{user_group_id}/members'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($per_page !== null) { + if('form' === 'form' && is_array($per_page)) { + foreach($per_page as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['per_page'] = ObjectSerializer::toString($per_page); + } + } + // query params + if ($page !== null) { + if('form' === 'form' && is_array($page)) { + foreach($page as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['page'] = ObjectSerializer::toString($page); + } + } + + + // path params + if ($user_group_id !== null) { + $resourcePath = str_replace( + '{' . 'user_group_id' . '}', + ObjectSerializer::toPathValue($user_group_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 listUserGroupRoles + * + * List roles in a user group + * + * 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 $user_group_id Alphanumeric string identifying the user group. (required) + * @param int $per_page Number of records per page. (optional, default to 20) + * @param int $page Current page. (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return object + */ + public function listUserGroupRoles($options) + { + list($response) = $this->listUserGroupRolesWithHttpInfo($options); + return $response; + } + + /** + * Operation listUserGroupRolesWithHttpInfo + * + * List roles in a user group + * + * 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 $user_group_id Alphanumeric string identifying the user group. (required) + * @param int $per_page Number of records per page. (optional, default to 20) + * @param int $page Current page. (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + */ + public function listUserGroupRolesWithHttpInfo($options) + { + $request = $this->listUserGroupRolesRequest($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 ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'object'; + 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(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listUserGroupRolesAsync + * + * List roles in a user group + * + * 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 $user_group_id Alphanumeric string identifying the user group. (required) + * @param int $per_page Number of records per page. (optional, default to 20) + * @param int $page Current page. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listUserGroupRolesAsync($options) + { + return $this->listUserGroupRolesAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listUserGroupRolesAsyncWithHttpInfo + * + * List roles in a user group + * + * 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 $user_group_id Alphanumeric string identifying the user group. (required) + * @param int $per_page Number of records per page. (optional, default to 20) + * @param int $page Current page. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listUserGroupRolesAsyncWithHttpInfo($options) + { + $returnType = 'object'; + $request = $this->listUserGroupRolesRequest($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 'listUserGroupRoles' + * + * 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 $user_group_id Alphanumeric string identifying the user group. (required) + * @param int $per_page Number of records per page. (optional, default to 20) + * @param int $page Current page. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listUserGroupRolesRequest($options) + { + // unbox the parameters from the associative array + $user_group_id = array_key_exists('user_group_id', $options) ? $options['user_group_id'] : null; + $per_page = array_key_exists('per_page', $options) ? $options['per_page'] : 20; + $page = array_key_exists('page', $options) ? $options['page'] : null; + + // verify the required parameter 'user_group_id' is set + if ($user_group_id === null || (is_array($user_group_id) && count($user_group_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $user_group_id when calling listUserGroupRoles' + ); + } + if ($per_page !== null && $per_page > 100) { + throw new \InvalidArgumentException('invalid value for "$per_page" when calling IamUserGroupsApi.listUserGroupRoles, must be smaller than or equal to 100.'); + } + if ($per_page !== null && $per_page < 1) { + throw new \InvalidArgumentException('invalid value for "$per_page" when calling IamUserGroupsApi.listUserGroupRoles, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/user-groups/{user_group_id}/roles'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($per_page !== null) { + if('form' === 'form' && is_array($per_page)) { + foreach($per_page as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['per_page'] = ObjectSerializer::toString($per_page); + } + } + // query params + if ($page !== null) { + if('form' === 'form' && is_array($page)) { + foreach($page as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['page'] = ObjectSerializer::toString($page); + } + } + + + // path params + if ($user_group_id !== null) { + $resourcePath = str_replace( + '{' . 'user_group_id' . '}', + ObjectSerializer::toPathValue($user_group_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 listUserGroupServiceGroups + * + * List service groups in a user group + * + * 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 $user_group_id Alphanumeric string identifying the user group. (required) + * @param int $per_page Number of records per page. (optional, default to 20) + * @param int $page Current page. (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return object + */ + public function listUserGroupServiceGroups($options) + { + list($response) = $this->listUserGroupServiceGroupsWithHttpInfo($options); + return $response; + } + + /** + * Operation listUserGroupServiceGroupsWithHttpInfo + * + * List service groups in a user group + * + * 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 $user_group_id Alphanumeric string identifying the user group. (required) + * @param int $per_page Number of records per page. (optional, default to 20) + * @param int $page Current page. (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + */ + public function listUserGroupServiceGroupsWithHttpInfo($options) + { + $request = $this->listUserGroupServiceGroupsRequest($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 ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'object'; + 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(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listUserGroupServiceGroupsAsync + * + * List service groups in a user group + * + * 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 $user_group_id Alphanumeric string identifying the user group. (required) + * @param int $per_page Number of records per page. (optional, default to 20) + * @param int $page Current page. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listUserGroupServiceGroupsAsync($options) + { + return $this->listUserGroupServiceGroupsAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listUserGroupServiceGroupsAsyncWithHttpInfo + * + * List service groups in a user group + * + * 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 $user_group_id Alphanumeric string identifying the user group. (required) + * @param int $per_page Number of records per page. (optional, default to 20) + * @param int $page Current page. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listUserGroupServiceGroupsAsyncWithHttpInfo($options) + { + $returnType = 'object'; + $request = $this->listUserGroupServiceGroupsRequest($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 'listUserGroupServiceGroups' + * + * 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 $user_group_id Alphanumeric string identifying the user group. (required) + * @param int $per_page Number of records per page. (optional, default to 20) + * @param int $page Current page. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listUserGroupServiceGroupsRequest($options) + { + // unbox the parameters from the associative array + $user_group_id = array_key_exists('user_group_id', $options) ? $options['user_group_id'] : null; + $per_page = array_key_exists('per_page', $options) ? $options['per_page'] : 20; + $page = array_key_exists('page', $options) ? $options['page'] : null; + + // verify the required parameter 'user_group_id' is set + if ($user_group_id === null || (is_array($user_group_id) && count($user_group_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $user_group_id when calling listUserGroupServiceGroups' + ); + } + if ($per_page !== null && $per_page > 100) { + throw new \InvalidArgumentException('invalid value for "$per_page" when calling IamUserGroupsApi.listUserGroupServiceGroups, must be smaller than or equal to 100.'); + } + if ($per_page !== null && $per_page < 1) { + throw new \InvalidArgumentException('invalid value for "$per_page" when calling IamUserGroupsApi.listUserGroupServiceGroups, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/user-groups/{user_group_id}/service-groups'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($per_page !== null) { + if('form' === 'form' && is_array($per_page)) { + foreach($per_page as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['per_page'] = ObjectSerializer::toString($per_page); + } + } + // query params + if ($page !== null) { + if('form' === 'form' && is_array($page)) { + foreach($page as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['page'] = ObjectSerializer::toString($page); + } + } + + + // path params + if ($user_group_id !== null) { + $resourcePath = str_replace( + '{' . 'user_group_id' . '}', + ObjectSerializer::toPathValue($user_group_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 listUserGroups + * + * List user groups + * + * 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 int $per_page Number of records per page. (optional, default to 20) + * @param int $page Current page. (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return object + */ + public function listUserGroups($options) + { + list($response) = $this->listUserGroupsWithHttpInfo($options); + return $response; + } + + /** + * Operation listUserGroupsWithHttpInfo + * + * List user groups + * + * 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 int $per_page Number of records per page. (optional, default to 20) + * @param int $page Current page. (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + */ + public function listUserGroupsWithHttpInfo($options) + { + $request = $this->listUserGroupsRequest($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 ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'object'; + 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(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listUserGroupsAsync + * + * List user groups + * + * 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 int $per_page Number of records per page. (optional, default to 20) + * @param int $page Current page. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listUserGroupsAsync($options) + { + return $this->listUserGroupsAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listUserGroupsAsyncWithHttpInfo + * + * List user groups + * + * 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 int $per_page Number of records per page. (optional, default to 20) + * @param int $page Current page. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listUserGroupsAsyncWithHttpInfo($options) + { + $returnType = 'object'; + $request = $this->listUserGroupsRequest($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 'listUserGroups' + * + * 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 int $per_page Number of records per page. (optional, default to 20) + * @param int $page Current page. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listUserGroupsRequest($options) + { + // unbox the parameters from the associative array + $per_page = array_key_exists('per_page', $options) ? $options['per_page'] : 20; + $page = array_key_exists('page', $options) ? $options['page'] : null; + + if ($per_page !== null && $per_page > 100) { + throw new \InvalidArgumentException('invalid value for "$per_page" when calling IamUserGroupsApi.listUserGroups, must be smaller than or equal to 100.'); + } + if ($per_page !== null && $per_page < 1) { + throw new \InvalidArgumentException('invalid value for "$per_page" when calling IamUserGroupsApi.listUserGroups, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/user-groups'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($per_page !== null) { + if('form' === 'form' && is_array($per_page)) { + foreach($per_page as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['per_page'] = ObjectSerializer::toString($per_page); + } + } + // query params + if ($page !== null) { + if('form' === 'form' && is_array($page)) { + foreach($page as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['page'] = ObjectSerializer::toString($page); + } + } + + + + + 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 removeUserGroupMembers + * + * Remove members of a user group + * + * 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 $user_group_id Alphanumeric string identifying the user group. (required) + * @param array $request_body request_body (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function removeUserGroupMembers($options) + { + $this->removeUserGroupMembersWithHttpInfo($options); + } + + /** + * Operation removeUserGroupMembersWithHttpInfo + * + * Remove members of a user group + * + * 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 $user_group_id Alphanumeric string identifying the user group. (required) + * @param array $request_body (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function removeUserGroupMembersWithHttpInfo($options) + { + $request = $this->removeUserGroupMembersRequest($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 removeUserGroupMembersAsync + * + * Remove members of a user group + * + * 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 $user_group_id Alphanumeric string identifying the user group. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function removeUserGroupMembersAsync($options) + { + return $this->removeUserGroupMembersAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation removeUserGroupMembersAsyncWithHttpInfo + * + * Remove members of a user group + * + * 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 $user_group_id Alphanumeric string identifying the user group. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function removeUserGroupMembersAsyncWithHttpInfo($options) + { + $returnType = ''; + $request = $this->removeUserGroupMembersRequest($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 'removeUserGroupMembers' + * + * 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 $user_group_id Alphanumeric string identifying the user group. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function removeUserGroupMembersRequest($options) + { + // unbox the parameters from the associative array + $user_group_id = array_key_exists('user_group_id', $options) ? $options['user_group_id'] : null; + $request_body = array_key_exists('request_body', $options) ? $options['request_body'] : null; + + // verify the required parameter 'user_group_id' is set + if ($user_group_id === null || (is_array($user_group_id) && count($user_group_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $user_group_id when calling removeUserGroupMembers' + ); + } + + $resourcePath = '/user-groups/{user_group_id}/members'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($user_group_id !== null) { + $resourcePath = str_replace( + '{' . 'user_group_id' . '}', + ObjectSerializer::toPathValue($user_group_id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + [] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + [], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($request_body)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($request_body)); + } else { + $httpBody = $request_body; + } + } 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); } - else { - $queryParams['page'] = ObjectSerializer::toString($page); + } + + // 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 removeUserGroupRoles + * + * Remove roles from a user group + * + * 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 $user_group_id Alphanumeric string identifying the user group. (required) + * @param array $request_body request_body (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function removeUserGroupRoles($options) + { + $this->removeUserGroupRolesWithHttpInfo($options); + } + + /** + * Operation removeUserGroupRolesWithHttpInfo + * + * Remove roles from a user group + * + * 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 $user_group_id Alphanumeric string identifying the user group. (required) + * @param array $request_body (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function removeUserGroupRolesWithHttpInfo($options) + { + $request = $this->removeUserGroupRolesRequest($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 removeUserGroupRolesAsync + * + * Remove roles from a user group + * + * 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 $user_group_id Alphanumeric string identifying the user group. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function removeUserGroupRolesAsync($options) + { + return $this->removeUserGroupRolesAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation removeUserGroupRolesAsyncWithHttpInfo + * + * Remove roles from a user group + * + * 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 $user_group_id Alphanumeric string identifying the user group. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function removeUserGroupRolesAsyncWithHttpInfo($options) + { + $returnType = ''; + $request = $this->removeUserGroupRolesRequest($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 'removeUserGroupRoles' + * + * 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 $user_group_id Alphanumeric string identifying the user group. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function removeUserGroupRolesRequest($options) + { + // unbox the parameters from the associative array + $user_group_id = array_key_exists('user_group_id', $options) ? $options['user_group_id'] : null; + $request_body = array_key_exists('request_body', $options) ? $options['request_body'] : null; + + // verify the required parameter 'user_group_id' is set + if ($user_group_id === null || (is_array($user_group_id) && count($user_group_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $user_group_id when calling removeUserGroupRoles' + ); } + $resourcePath = '/user-groups/{user_group_id}/roles'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // path params if ($user_group_id !== null) { @@ -1368,17 +3962,23 @@ public function listUserGroupRolesRequest($options) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + [] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] + [], + ['application/json'] ); } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($request_body)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($request_body)); + } else { + $httpBody = $request_body; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -1427,7 +4027,7 @@ public function listUserGroupRolesRequest($options) $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( - 'GET', + 'DELETE', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -1435,9 +4035,9 @@ public function listUserGroupRolesRequest($options) } /** - * Operation listUserGroupServiceGroups + * Operation removeUserGroupServiceGroups * - * List service groups in a user group + * Remove service groups from a user group * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -1445,23 +4045,21 @@ public function listUserGroupRolesRequest($options) * URL: https://api.fastly.com * * @param string $user_group_id Alphanumeric string identifying the user group. (required) - * @param int $per_page Number of records per page. (optional, default to 20) - * @param int $page Current page. (optional) + * @param array $request_body request_body (optional) * * @throws \Fastly\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return object + * @return void */ - public function listUserGroupServiceGroups($options) + public function removeUserGroupServiceGroups($options) { - list($response) = $this->listUserGroupServiceGroupsWithHttpInfo($options); - return $response; + $this->removeUserGroupServiceGroupsWithHttpInfo($options); } /** - * Operation listUserGroupServiceGroupsWithHttpInfo + * Operation removeUserGroupServiceGroupsWithHttpInfo * - * List service groups in a user group + * Remove service groups from a user group * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -1469,16 +4067,15 @@ public function listUserGroupServiceGroups($options) * URL: https://api.fastly.com * * @param string $user_group_id Alphanumeric string identifying the user group. (required) - * @param int $per_page Number of records per page. (optional, default to 20) - * @param int $page Current page. (optional) + * @param array $request_body (optional) * * @throws \Fastly\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of object, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function listUserGroupServiceGroupsWithHttpInfo($options) + public function removeUserGroupServiceGroupsWithHttpInfo($options) { - $request = $this->listUserGroupServiceGroupsRequest($options); + $request = $this->removeUserGroupServiceGroupsRequest($options); try { $options = $this->createHttpClientOption(); @@ -1500,7 +4097,7 @@ public function listUserGroupServiceGroupsWithHttpInfo($options) ); } - if ('GET' != 'GET' && 'GET' != 'HEAD') { + if ('DELETE' != 'GET' && 'DELETE' != 'HEAD') { $header = $response->getHeader('Fastly-RateLimit-Remaining'); if (count($header) > 0) { $this->config->setRateLimitRemaining($header[0]); @@ -1527,53 +4124,19 @@ public function listUserGroupServiceGroupsWithHttpInfo($options) ); } - switch($statusCode) { - case 200: - if ('object' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, 'object', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = 'object'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - 'object', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; } throw $e; } } /** - * Operation listUserGroupServiceGroupsAsync + * Operation removeUserGroupServiceGroupsAsync * - * List service groups in a user group + * Remove service groups from a user group * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -1581,15 +4144,14 @@ public function listUserGroupServiceGroupsWithHttpInfo($options) * URL: https://api.fastly.com * * @param string $user_group_id Alphanumeric string identifying the user group. (required) - * @param int $per_page Number of records per page. (optional, default to 20) - * @param int $page Current page. (optional) + * @param array $request_body (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listUserGroupServiceGroupsAsync($options) + public function removeUserGroupServiceGroupsAsync($options) { - return $this->listUserGroupServiceGroupsAsyncWithHttpInfo($options) + return $this->removeUserGroupServiceGroupsAsyncWithHttpInfo($options) ->then( function ($response) { return $response[0]; @@ -1598,9 +4160,9 @@ function ($response) { } /** - * Operation listUserGroupServiceGroupsAsyncWithHttpInfo + * Operation removeUserGroupServiceGroupsAsyncWithHttpInfo * - * List service groups in a user group + * Remove service groups from a user group * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -1608,32 +4170,21 @@ function ($response) { * URL: https://api.fastly.com * * @param string $user_group_id Alphanumeric string identifying the user group. (required) - * @param int $per_page Number of records per page. (optional, default to 20) - * @param int $page Current page. (optional) + * @param array $request_body (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listUserGroupServiceGroupsAsyncWithHttpInfo($options) + public function removeUserGroupServiceGroupsAsyncWithHttpInfo($options) { - $returnType = 'object'; - $request = $this->listUserGroupServiceGroupsRequest($options); + $returnType = ''; + $request = $this->removeUserGroupServiceGroupsRequest($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() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -1653,7 +4204,7 @@ function ($exception) { } /** - * Create request for operation 'listUserGroupServiceGroups' + * Create request for operation 'removeUserGroupServiceGroups' * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -1661,32 +4212,23 @@ function ($exception) { * URL: https://api.fastly.com * * @param string $user_group_id Alphanumeric string identifying the user group. (required) - * @param int $per_page Number of records per page. (optional, default to 20) - * @param int $page Current page. (optional) + * @param array $request_body (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function listUserGroupServiceGroupsRequest($options) + public function removeUserGroupServiceGroupsRequest($options) { // unbox the parameters from the associative array $user_group_id = array_key_exists('user_group_id', $options) ? $options['user_group_id'] : null; - $per_page = array_key_exists('per_page', $options) ? $options['per_page'] : 20; - $page = array_key_exists('page', $options) ? $options['page'] : null; + $request_body = array_key_exists('request_body', $options) ? $options['request_body'] : null; // verify the required parameter 'user_group_id' is set if ($user_group_id === null || (is_array($user_group_id) && count($user_group_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $user_group_id when calling listUserGroupServiceGroups' + 'Missing the required parameter $user_group_id when calling removeUserGroupServiceGroups' ); } - if ($per_page !== null && $per_page > 100) { - throw new \InvalidArgumentException('invalid value for "$per_page" when calling IamUserGroupsApi.listUserGroupServiceGroups, must be smaller than or equal to 100.'); - } - if ($per_page !== null && $per_page < 1) { - throw new \InvalidArgumentException('invalid value for "$per_page" when calling IamUserGroupsApi.listUserGroupServiceGroups, must be bigger than or equal to 1.'); - } - $resourcePath = '/user-groups/{user_group_id}/service-groups'; $formParams = []; @@ -1695,28 +4237,6 @@ public function listUserGroupServiceGroupsRequest($options) $httpBody = ''; $multipart = false; - // query params - if ($per_page !== null) { - if('form' === 'form' && is_array($per_page)) { - foreach($per_page as $key => $value) { - $queryParams[$key] = ObjectSerializer::toString($value); - } - } - else { - $queryParams['per_page'] = ObjectSerializer::toString($per_page); - } - } - // query params - if ($page !== null) { - if('form' === 'form' && is_array($page)) { - foreach($page as $key => $value) { - $queryParams[$key] = ObjectSerializer::toString($value); - } - } - else { - $queryParams['page'] = ObjectSerializer::toString($page); - } - } // path params @@ -1731,17 +4251,23 @@ public function listUserGroupServiceGroupsRequest($options) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + [] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] + [], + ['application/json'] ); } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($request_body)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($request_body)); + } else { + $httpBody = $request_body; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -1790,7 +4316,7 @@ public function listUserGroupServiceGroupsRequest($options) $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( - 'GET', + 'DELETE', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -1798,48 +4324,48 @@ public function listUserGroupServiceGroupsRequest($options) } /** - * Operation listUserGroups + * Operation updateAUserGroup * - * List user groups + * Update a user group * * 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 int $per_page Number of records per page. (optional, default to 20) - * @param int $page Current page. (optional) + * @param string $user_group_id Alphanumeric string identifying the user group. (required) + * @param array $request_body request_body (optional) * * @throws \Fastly\ApiException on non-2xx response * @throws \InvalidArgumentException * @return object */ - public function listUserGroups($options) + public function updateAUserGroup($options) { - list($response) = $this->listUserGroupsWithHttpInfo($options); + list($response) = $this->updateAUserGroupWithHttpInfo($options); return $response; } /** - * Operation listUserGroupsWithHttpInfo + * Operation updateAUserGroupWithHttpInfo * - * List user groups + * Update a user group * * 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 int $per_page Number of records per page. (optional, default to 20) - * @param int $page Current page. (optional) + * @param string $user_group_id Alphanumeric string identifying the user group. (required) + * @param array $request_body (optional) * * @throws \Fastly\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of object, HTTP status code, HTTP response headers (array of strings) */ - public function listUserGroupsWithHttpInfo($options) + public function updateAUserGroupWithHttpInfo($options) { - $request = $this->listUserGroupsRequest($options); + $request = $this->updateAUserGroupRequest($options); try { $options = $this->createHttpClientOption(); @@ -1861,7 +4387,7 @@ public function listUserGroupsWithHttpInfo($options) ); } - if ('GET' != 'GET' && 'GET' != 'HEAD') { + if ('PATCH' != 'GET' && 'PATCH' != 'HEAD') { $header = $response->getHeader('Fastly-RateLimit-Remaining'); if (count($header) > 0) { $this->config->setRateLimitRemaining($header[0]); @@ -1932,24 +4458,24 @@ public function listUserGroupsWithHttpInfo($options) } /** - * Operation listUserGroupsAsync + * Operation updateAUserGroupAsync * - * List user groups + * Update a user group * * 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 int $per_page Number of records per page. (optional, default to 20) - * @param int $page Current page. (optional) + * @param string $user_group_id Alphanumeric string identifying the user group. (required) + * @param array $request_body (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listUserGroupsAsync($options) + public function updateAUserGroupAsync($options) { - return $this->listUserGroupsAsyncWithHttpInfo($options) + return $this->updateAUserGroupAsyncWithHttpInfo($options) ->then( function ($response) { return $response[0]; @@ -1958,25 +4484,25 @@ function ($response) { } /** - * Operation listUserGroupsAsyncWithHttpInfo + * Operation updateAUserGroupAsyncWithHttpInfo * - * List user groups + * Update a user group * * 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 int $per_page Number of records per page. (optional, default to 20) - * @param int $page Current page. (optional) + * @param string $user_group_id Alphanumeric string identifying the user group. (required) + * @param array $request_body (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listUserGroupsAsyncWithHttpInfo($options) + public function updateAUserGroupAsyncWithHttpInfo($options) { $returnType = 'object'; - $request = $this->listUserGroupsRequest($options); + $request = $this->updateAUserGroupRequest($options); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2012,64 +4538,49 @@ function ($exception) { } /** - * Create request for operation 'listUserGroups' + * Create request for operation 'updateAUserGroup' * * 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 int $per_page Number of records per page. (optional, default to 20) - * @param int $page Current page. (optional) + * @param string $user_group_id Alphanumeric string identifying the user group. (required) + * @param array $request_body (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function listUserGroupsRequest($options) + public function updateAUserGroupRequest($options) { // unbox the parameters from the associative array - $per_page = array_key_exists('per_page', $options) ? $options['per_page'] : 20; - $page = array_key_exists('page', $options) ? $options['page'] : null; + $user_group_id = array_key_exists('user_group_id', $options) ? $options['user_group_id'] : null; + $request_body = array_key_exists('request_body', $options) ? $options['request_body'] : null; - if ($per_page !== null && $per_page > 100) { - throw new \InvalidArgumentException('invalid value for "$per_page" when calling IamUserGroupsApi.listUserGroups, must be smaller than or equal to 100.'); - } - if ($per_page !== null && $per_page < 1) { - throw new \InvalidArgumentException('invalid value for "$per_page" when calling IamUserGroupsApi.listUserGroups, must be bigger than or equal to 1.'); + // verify the required parameter 'user_group_id' is set + if ($user_group_id === null || (is_array($user_group_id) && count($user_group_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $user_group_id when calling updateAUserGroup' + ); } - - $resourcePath = '/user-groups'; + $resourcePath = '/user-groups/{user_group_id}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if ($per_page !== null) { - if('form' === 'form' && is_array($per_page)) { - foreach($per_page as $key => $value) { - $queryParams[$key] = ObjectSerializer::toString($value); - } - } - else { - $queryParams['per_page'] = ObjectSerializer::toString($per_page); - } - } - // query params - if ($page !== null) { - if('form' === 'form' && is_array($page)) { - foreach($page as $key => $value) { - $queryParams[$key] = ObjectSerializer::toString($value); - } - } - else { - $queryParams['page'] = ObjectSerializer::toString($page); - } - } + // path params + if ($user_group_id !== null) { + $resourcePath = str_replace( + '{' . 'user_group_id' . '}', + ObjectSerializer::toPathValue($user_group_id), + $resourcePath + ); + } if ($multipart) { @@ -2079,12 +4590,18 @@ public function listUserGroupsRequest($options) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - [] + ['application/json'] ); } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($request_body)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($request_body)); + } else { + $httpBody = $request_body; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -2133,7 +4650,7 @@ public function listUserGroupsRequest($options) $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( - 'GET', + 'PATCH', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody diff --git a/lib/Api/LegacyWafConfigurationSetsApi.php b/lib/Api/LegacyWafConfigurationSetsApi.php new file mode 100644 index 00000000..791540b2 --- /dev/null +++ b/lib/Api/LegacyWafConfigurationSetsApi.php @@ -0,0 +1,1103 @@ +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 listWafConfigSets + * + * List configuration sets + * + * 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 object + * @deprecated + */ + public function listWafConfigSets($options) + { + list($response) = $this->listWafConfigSetsWithHttpInfo($options); + return $response; + } + + /** + * Operation listWafConfigSetsWithHttpInfo + * + * List configuration sets + * + * 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 object, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function listWafConfigSetsWithHttpInfo($options) + { + $request = $this->listWafConfigSetsRequest($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 ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'object'; + 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(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listWafConfigSetsAsync + * + * List configuration sets + * + * 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 + * @deprecated + */ + public function listWafConfigSetsAsync($options) + { + return $this->listWafConfigSetsAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listWafConfigSetsAsyncWithHttpInfo + * + * List configuration sets + * + * 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 + * @deprecated + */ + public function listWafConfigSetsAsyncWithHttpInfo($options) + { + $returnType = 'object'; + $request = $this->listWafConfigSetsRequest($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 'listWafConfigSets' + * + * 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 + * @deprecated + */ + public function listWafConfigSetsRequest($options) + { + // unbox the parameters from the associative array + + + $resourcePath = '/wafs/configuration_sets'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+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 listWafsConfigSet + * + * List WAFs currently using a configuration set + * + * 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 $configuration_set_id Alphanumeric string identifying a WAF configuration set. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return object + * @deprecated + */ + public function listWafsConfigSet($options) + { + list($response) = $this->listWafsConfigSetWithHttpInfo($options); + return $response; + } + + /** + * Operation listWafsConfigSetWithHttpInfo + * + * List WAFs currently using a configuration set + * + * 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 $configuration_set_id Alphanumeric string identifying a WAF configuration set. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function listWafsConfigSetWithHttpInfo($options) + { + $request = $this->listWafsConfigSetRequest($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 ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'object'; + 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(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listWafsConfigSetAsync + * + * List WAFs currently using a configuration set + * + * 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 $configuration_set_id Alphanumeric string identifying a WAF configuration set. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function listWafsConfigSetAsync($options) + { + return $this->listWafsConfigSetAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listWafsConfigSetAsyncWithHttpInfo + * + * List WAFs currently using a configuration set + * + * 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 $configuration_set_id Alphanumeric string identifying a WAF configuration set. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function listWafsConfigSetAsyncWithHttpInfo($options) + { + $returnType = 'object'; + $request = $this->listWafsConfigSetRequest($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 'listWafsConfigSet' + * + * 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 $configuration_set_id Alphanumeric string identifying a WAF configuration set. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + * @deprecated + */ + public function listWafsConfigSetRequest($options) + { + // unbox the parameters from the associative array + $configuration_set_id = array_key_exists('configuration_set_id', $options) ? $options['configuration_set_id'] : null; + + // verify the required parameter 'configuration_set_id' is set + if ($configuration_set_id === null || (is_array($configuration_set_id) && count($configuration_set_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $configuration_set_id when calling listWafsConfigSet' + ); + } + + $resourcePath = '/wafs/configuration_sets/{configuration_set_id}/relationships/wafs'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($configuration_set_id !== null) { + $resourcePath = str_replace( + '{' . 'configuration_set_id' . '}', + ObjectSerializer::toPathValue($configuration_set_id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+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 useWafConfigSet + * + * Apply a configuration set to a WAF + * + * 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 $configuration_set_id Alphanumeric string identifying a WAF configuration set. (required) + * @param array $request_body request_body (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return object + * @deprecated + */ + public function useWafConfigSet($options) + { + list($response) = $this->useWafConfigSetWithHttpInfo($options); + return $response; + } + + /** + * Operation useWafConfigSetWithHttpInfo + * + * Apply a configuration set to a WAF + * + * 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 $configuration_set_id Alphanumeric string identifying a WAF configuration set. (required) + * @param array $request_body (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function useWafConfigSetWithHttpInfo($options) + { + $request = $this->useWafConfigSetRequest($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 ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'object'; + 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(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation useWafConfigSetAsync + * + * Apply a configuration set to a WAF + * + * 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 $configuration_set_id Alphanumeric string identifying a WAF configuration set. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function useWafConfigSetAsync($options) + { + return $this->useWafConfigSetAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation useWafConfigSetAsyncWithHttpInfo + * + * Apply a configuration set to a WAF + * + * 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 $configuration_set_id Alphanumeric string identifying a WAF configuration set. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function useWafConfigSetAsyncWithHttpInfo($options) + { + $returnType = 'object'; + $request = $this->useWafConfigSetRequest($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 'useWafConfigSet' + * + * 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 $configuration_set_id Alphanumeric string identifying a WAF configuration set. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + * @deprecated + */ + public function useWafConfigSetRequest($options) + { + // unbox the parameters from the associative array + $configuration_set_id = array_key_exists('configuration_set_id', $options) ? $options['configuration_set_id'] : null; + $request_body = array_key_exists('request_body', $options) ? $options['request_body'] : null; + + // verify the required parameter 'configuration_set_id' is set + if ($configuration_set_id === null || (is_array($configuration_set_id) && count($configuration_set_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $configuration_set_id when calling useWafConfigSet' + ); + } + + $resourcePath = '/wafs/configuration_sets/{configuration_set_id}/relationships/wafs'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($configuration_set_id !== null) { + $resourcePath = str_replace( + '{' . 'configuration_set_id' . '}', + ObjectSerializer::toPathValue($configuration_set_id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+json'], + ['application/vnd.api+json'] + ); + } + + // for model (json/xml) + if (isset($request_body)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($request_body)); + } else { + $httpBody = $request_body; + } + } 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/LegacyWafFirewallApi.php b/lib/Api/LegacyWafFirewallApi.php new file mode 100644 index 00000000..6c484427 --- /dev/null +++ b/lib/Api/LegacyWafFirewallApi.php @@ -0,0 +1,3044 @@ +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 createLegacyWafFirewallService + * + * Create a firewall + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param array $request_body request_body (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return object + * @deprecated + */ + public function createLegacyWafFirewallService($options) + { + list($response) = $this->createLegacyWafFirewallServiceWithHttpInfo($options); + return $response; + } + + /** + * Operation createLegacyWafFirewallServiceWithHttpInfo + * + * Create a firewall + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param array $request_body (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function createLegacyWafFirewallServiceWithHttpInfo($options) + { + $request = $this->createLegacyWafFirewallServiceRequest($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 201: + if ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'object'; + 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 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createLegacyWafFirewallServiceAsync + * + * Create a firewall + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function createLegacyWafFirewallServiceAsync($options) + { + return $this->createLegacyWafFirewallServiceAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createLegacyWafFirewallServiceAsyncWithHttpInfo + * + * Create a firewall + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function createLegacyWafFirewallServiceAsyncWithHttpInfo($options) + { + $returnType = 'object'; + $request = $this->createLegacyWafFirewallServiceRequest($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 'createLegacyWafFirewallService' + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + * @deprecated + */ + public function createLegacyWafFirewallServiceRequest($options) + { + // unbox the parameters from the associative array + $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null; + $version_id = array_key_exists('version_id', $options) ? $options['version_id'] : null; + $request_body = array_key_exists('request_body', $options) ? $options['request_body'] : null; + + // verify the required parameter 'service_id' is set + if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $service_id when calling createLegacyWafFirewallService' + ); + } + // verify the required parameter 'version_id' is set + if ($version_id === null || (is_array($version_id) && count($version_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $version_id when calling createLegacyWafFirewallService' + ); + } + + $resourcePath = '/service/{service_id}/version/{version_id}/wafs'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($service_id !== null) { + $resourcePath = str_replace( + '{' . 'service_id' . '}', + ObjectSerializer::toPathValue($service_id), + $resourcePath + ); + } + // path params + if ($version_id !== null) { + $resourcePath = str_replace( + '{' . 'version_id' . '}', + ObjectSerializer::toPathValue($version_id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+json'], + ['application/vnd.api+json'] + ); + } + + // for model (json/xml) + if (isset($request_body)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($request_body)); + } else { + $httpBody = $request_body; + } + } 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 disableLegacyWafFirewall + * + * Disable a firewall + * + * 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 $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param array $request_body request_body (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return object + * @deprecated + */ + public function disableLegacyWafFirewall($options) + { + list($response) = $this->disableLegacyWafFirewallWithHttpInfo($options); + return $response; + } + + /** + * Operation disableLegacyWafFirewallWithHttpInfo + * + * Disable a firewall + * + * 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 $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param array $request_body (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function disableLegacyWafFirewallWithHttpInfo($options) + { + $request = $this->disableLegacyWafFirewallRequest($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 202: + if ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'object'; + 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 202: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation disableLegacyWafFirewallAsync + * + * Disable a firewall + * + * 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 $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function disableLegacyWafFirewallAsync($options) + { + return $this->disableLegacyWafFirewallAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation disableLegacyWafFirewallAsyncWithHttpInfo + * + * Disable a firewall + * + * 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 $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function disableLegacyWafFirewallAsyncWithHttpInfo($options) + { + $returnType = 'object'; + $request = $this->disableLegacyWafFirewallRequest($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 'disableLegacyWafFirewall' + * + * 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 $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + * @deprecated + */ + public function disableLegacyWafFirewallRequest($options) + { + // unbox the parameters from the associative array + $firewall_id = array_key_exists('firewall_id', $options) ? $options['firewall_id'] : null; + $request_body = array_key_exists('request_body', $options) ? $options['request_body'] : null; + + // verify the required parameter 'firewall_id' is set + if ($firewall_id === null || (is_array($firewall_id) && count($firewall_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $firewall_id when calling disableLegacyWafFirewall' + ); + } + + $resourcePath = '/wafs/{firewall_id}/disable'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($firewall_id !== null) { + $resourcePath = str_replace( + '{' . 'firewall_id' . '}', + ObjectSerializer::toPathValue($firewall_id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+json'], + ['application/vnd.api+json'] + ); + } + + // for model (json/xml) + if (isset($request_body)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($request_body)); + } else { + $httpBody = $request_body; + } + } 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 + ); + } + + /** + * Operation enableLegacyWafFirewall + * + * Enable a firewall + * + * 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 $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param array $request_body request_body (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return object + * @deprecated + */ + public function enableLegacyWafFirewall($options) + { + list($response) = $this->enableLegacyWafFirewallWithHttpInfo($options); + return $response; + } + + /** + * Operation enableLegacyWafFirewallWithHttpInfo + * + * Enable a firewall + * + * 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 $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param array $request_body (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function enableLegacyWafFirewallWithHttpInfo($options) + { + $request = $this->enableLegacyWafFirewallRequest($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 202: + if ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'object'; + 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 202: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation enableLegacyWafFirewallAsync + * + * Enable a firewall + * + * 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 $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function enableLegacyWafFirewallAsync($options) + { + return $this->enableLegacyWafFirewallAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation enableLegacyWafFirewallAsyncWithHttpInfo + * + * Enable a firewall + * + * 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 $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function enableLegacyWafFirewallAsyncWithHttpInfo($options) + { + $returnType = 'object'; + $request = $this->enableLegacyWafFirewallRequest($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 'enableLegacyWafFirewall' + * + * 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 $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + * @deprecated + */ + public function enableLegacyWafFirewallRequest($options) + { + // unbox the parameters from the associative array + $firewall_id = array_key_exists('firewall_id', $options) ? $options['firewall_id'] : null; + $request_body = array_key_exists('request_body', $options) ? $options['request_body'] : null; + + // verify the required parameter 'firewall_id' is set + if ($firewall_id === null || (is_array($firewall_id) && count($firewall_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $firewall_id when calling enableLegacyWafFirewall' + ); + } + + $resourcePath = '/wafs/{firewall_id}/enable'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($firewall_id !== null) { + $resourcePath = str_replace( + '{' . 'firewall_id' . '}', + ObjectSerializer::toPathValue($firewall_id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+json'], + ['application/vnd.api+json'] + ); + } + + // for model (json/xml) + if (isset($request_body)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($request_body)); + } else { + $httpBody = $request_body; + } + } 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 + ); + } + + /** + * Operation getLegacyWafFirewall + * + * Get a firewall object + * + * 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 $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param string $include Include relationships. Optional, comma separated values. Permitted values: `configuration_set`, `owasp`, `rules`, `rule_statuses`. (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return object + * @deprecated + */ + public function getLegacyWafFirewall($options) + { + list($response) = $this->getLegacyWafFirewallWithHttpInfo($options); + return $response; + } + + /** + * Operation getLegacyWafFirewallWithHttpInfo + * + * Get a firewall object + * + * 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 $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param string $include Include relationships. Optional, comma separated values. Permitted values: `configuration_set`, `owasp`, `rules`, `rule_statuses`. (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function getLegacyWafFirewallWithHttpInfo($options) + { + $request = $this->getLegacyWafFirewallRequest($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 ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'object'; + 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(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getLegacyWafFirewallAsync + * + * Get a firewall object + * + * 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 $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param string $include Include relationships. Optional, comma separated values. Permitted values: `configuration_set`, `owasp`, `rules`, `rule_statuses`. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function getLegacyWafFirewallAsync($options) + { + return $this->getLegacyWafFirewallAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getLegacyWafFirewallAsyncWithHttpInfo + * + * Get a firewall object + * + * 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 $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param string $include Include relationships. Optional, comma separated values. Permitted values: `configuration_set`, `owasp`, `rules`, `rule_statuses`. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function getLegacyWafFirewallAsyncWithHttpInfo($options) + { + $returnType = 'object'; + $request = $this->getLegacyWafFirewallRequest($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 'getLegacyWafFirewall' + * + * 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 $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param string $include Include relationships. Optional, comma separated values. Permitted values: `configuration_set`, `owasp`, `rules`, `rule_statuses`. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + * @deprecated + */ + public function getLegacyWafFirewallRequest($options) + { + // unbox the parameters from the associative array + $firewall_id = array_key_exists('firewall_id', $options) ? $options['firewall_id'] : null; + $include = array_key_exists('include', $options) ? $options['include'] : null; + + // verify the required parameter 'firewall_id' is set + if ($firewall_id === null || (is_array($firewall_id) && count($firewall_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $firewall_id when calling getLegacyWafFirewall' + ); + } + + $resourcePath = '/wafs/{firewall_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($include !== null) { + if('form' === 'form' && is_array($include)) { + foreach($include as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['include'] = ObjectSerializer::toString($include); + } + } + + + // path params + if ($firewall_id !== null) { + $resourcePath = str_replace( + '{' . 'firewall_id' . '}', + ObjectSerializer::toPathValue($firewall_id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+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 getLegacyWafFirewallService + * + * Get a firewall + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return object + * @deprecated + */ + public function getLegacyWafFirewallService($options) + { + list($response) = $this->getLegacyWafFirewallServiceWithHttpInfo($options); + return $response; + } + + /** + * Operation getLegacyWafFirewallServiceWithHttpInfo + * + * Get a firewall + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function getLegacyWafFirewallServiceWithHttpInfo($options) + { + $request = $this->getLegacyWafFirewallServiceRequest($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 ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'object'; + 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(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getLegacyWafFirewallServiceAsync + * + * Get a firewall + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function getLegacyWafFirewallServiceAsync($options) + { + return $this->getLegacyWafFirewallServiceAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getLegacyWafFirewallServiceAsyncWithHttpInfo + * + * Get a firewall + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function getLegacyWafFirewallServiceAsyncWithHttpInfo($options) + { + $returnType = 'object'; + $request = $this->getLegacyWafFirewallServiceRequest($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 'getLegacyWafFirewallService' + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + * @deprecated + */ + public function getLegacyWafFirewallServiceRequest($options) + { + // unbox the parameters from the associative array + $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null; + $version_id = array_key_exists('version_id', $options) ? $options['version_id'] : null; + $firewall_id = array_key_exists('firewall_id', $options) ? $options['firewall_id'] : null; + + // verify the required parameter 'service_id' is set + if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $service_id when calling getLegacyWafFirewallService' + ); + } + // verify the required parameter 'version_id' is set + if ($version_id === null || (is_array($version_id) && count($version_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $version_id when calling getLegacyWafFirewallService' + ); + } + // verify the required parameter 'firewall_id' is set + if ($firewall_id === null || (is_array($firewall_id) && count($firewall_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $firewall_id when calling getLegacyWafFirewallService' + ); + } + + $resourcePath = '/service/{service_id}/version/{version_id}/wafs/{firewall_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($service_id !== null) { + $resourcePath = str_replace( + '{' . 'service_id' . '}', + ObjectSerializer::toPathValue($service_id), + $resourcePath + ); + } + // path params + if ($version_id !== null) { + $resourcePath = str_replace( + '{' . 'version_id' . '}', + ObjectSerializer::toPathValue($version_id), + $resourcePath + ); + } + // path params + if ($firewall_id !== null) { + $resourcePath = str_replace( + '{' . 'firewall_id' . '}', + ObjectSerializer::toPathValue($firewall_id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+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 listLegacyWafFirewalls + * + * List active firewalls + * + * 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 $filter_rules_rule_id Limit the returned firewalls to a specific rule ID. (optional) + * @param int $page_number Current page. (optional) + * @param int $page_size Number of records per page. (optional, default to 20) + * @param string $include Include relationships. Optional, comma separated values. Permitted values: `configuration_set`, `owasp`. (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return object + * @deprecated + */ + public function listLegacyWafFirewalls($options) + { + list($response) = $this->listLegacyWafFirewallsWithHttpInfo($options); + return $response; + } + + /** + * Operation listLegacyWafFirewallsWithHttpInfo + * + * List active firewalls + * + * 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 $filter_rules_rule_id Limit the returned firewalls to a specific rule ID. (optional) + * @param int $page_number Current page. (optional) + * @param int $page_size Number of records per page. (optional, default to 20) + * @param string $include Include relationships. Optional, comma separated values. Permitted values: `configuration_set`, `owasp`. (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function listLegacyWafFirewallsWithHttpInfo($options) + { + $request = $this->listLegacyWafFirewallsRequest($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 ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'object'; + 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(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listLegacyWafFirewallsAsync + * + * List active firewalls + * + * 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 $filter_rules_rule_id Limit the returned firewalls to a specific rule ID. (optional) + * @param int $page_number Current page. (optional) + * @param int $page_size Number of records per page. (optional, default to 20) + * @param string $include Include relationships. Optional, comma separated values. Permitted values: `configuration_set`, `owasp`. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function listLegacyWafFirewallsAsync($options) + { + return $this->listLegacyWafFirewallsAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listLegacyWafFirewallsAsyncWithHttpInfo + * + * List active firewalls + * + * 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 $filter_rules_rule_id Limit the returned firewalls to a specific rule ID. (optional) + * @param int $page_number Current page. (optional) + * @param int $page_size Number of records per page. (optional, default to 20) + * @param string $include Include relationships. Optional, comma separated values. Permitted values: `configuration_set`, `owasp`. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function listLegacyWafFirewallsAsyncWithHttpInfo($options) + { + $returnType = 'object'; + $request = $this->listLegacyWafFirewallsRequest($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 'listLegacyWafFirewalls' + * + * 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 $filter_rules_rule_id Limit the returned firewalls to a specific rule ID. (optional) + * @param int $page_number Current page. (optional) + * @param int $page_size Number of records per page. (optional, default to 20) + * @param string $include Include relationships. Optional, comma separated values. Permitted values: `configuration_set`, `owasp`. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + * @deprecated + */ + public function listLegacyWafFirewallsRequest($options) + { + // unbox the parameters from the associative array + $filter_rules_rule_id = array_key_exists('filter_rules_rule_id', $options) ? $options['filter_rules_rule_id'] : null; + $page_number = array_key_exists('page_number', $options) ? $options['page_number'] : null; + $page_size = array_key_exists('page_size', $options) ? $options['page_size'] : 20; + $include = array_key_exists('include', $options) ? $options['include'] : null; + + if ($page_size !== null && $page_size > 100) { + throw new \InvalidArgumentException('invalid value for "$page_size" when calling LegacyWafFirewallApi.listLegacyWafFirewalls, must be smaller than or equal to 100.'); + } + if ($page_size !== null && $page_size < 1) { + throw new \InvalidArgumentException('invalid value for "$page_size" when calling LegacyWafFirewallApi.listLegacyWafFirewalls, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/wafs'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($filter_rules_rule_id !== null) { + if('form' === 'form' && is_array($filter_rules_rule_id)) { + foreach($filter_rules_rule_id as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['filter[rules][rule_id]'] = ObjectSerializer::toString($filter_rules_rule_id); + } + } + // query params + if ($page_number !== null) { + if('form' === 'form' && is_array($page_number)) { + foreach($page_number as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['page[number]'] = ObjectSerializer::toString($page_number); + } + } + // query params + if ($page_size !== null) { + if('form' === 'form' && is_array($page_size)) { + foreach($page_size as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['page[size]'] = ObjectSerializer::toString($page_size); + } + } + // query params + if ($include !== null) { + if('form' === 'form' && is_array($include)) { + foreach($include as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['include'] = ObjectSerializer::toString($include); + } + } + + + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+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 listLegacyWafFirewallsService + * + * List firewalls + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param int $page_number Current page. (optional) + * @param int $page_size Number of records per page. (optional, default to 20) + * @param string $include Include relationships. Optional, comma separated values. Permitted values: `configuration_set`, `owasp`. (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return object + * @deprecated + */ + public function listLegacyWafFirewallsService($options) + { + list($response) = $this->listLegacyWafFirewallsServiceWithHttpInfo($options); + return $response; + } + + /** + * Operation listLegacyWafFirewallsServiceWithHttpInfo + * + * List firewalls + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param int $page_number Current page. (optional) + * @param int $page_size Number of records per page. (optional, default to 20) + * @param string $include Include relationships. Optional, comma separated values. Permitted values: `configuration_set`, `owasp`. (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function listLegacyWafFirewallsServiceWithHttpInfo($options) + { + $request = $this->listLegacyWafFirewallsServiceRequest($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 ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'object'; + 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(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listLegacyWafFirewallsServiceAsync + * + * List firewalls + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param int $page_number Current page. (optional) + * @param int $page_size Number of records per page. (optional, default to 20) + * @param string $include Include relationships. Optional, comma separated values. Permitted values: `configuration_set`, `owasp`. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function listLegacyWafFirewallsServiceAsync($options) + { + return $this->listLegacyWafFirewallsServiceAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listLegacyWafFirewallsServiceAsyncWithHttpInfo + * + * List firewalls + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param int $page_number Current page. (optional) + * @param int $page_size Number of records per page. (optional, default to 20) + * @param string $include Include relationships. Optional, comma separated values. Permitted values: `configuration_set`, `owasp`. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function listLegacyWafFirewallsServiceAsyncWithHttpInfo($options) + { + $returnType = 'object'; + $request = $this->listLegacyWafFirewallsServiceRequest($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 'listLegacyWafFirewallsService' + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param int $page_number Current page. (optional) + * @param int $page_size Number of records per page. (optional, default to 20) + * @param string $include Include relationships. Optional, comma separated values. Permitted values: `configuration_set`, `owasp`. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + * @deprecated + */ + public function listLegacyWafFirewallsServiceRequest($options) + { + // unbox the parameters from the associative array + $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null; + $version_id = array_key_exists('version_id', $options) ? $options['version_id'] : null; + $page_number = array_key_exists('page_number', $options) ? $options['page_number'] : null; + $page_size = array_key_exists('page_size', $options) ? $options['page_size'] : 20; + $include = array_key_exists('include', $options) ? $options['include'] : null; + + // verify the required parameter 'service_id' is set + if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $service_id when calling listLegacyWafFirewallsService' + ); + } + // verify the required parameter 'version_id' is set + if ($version_id === null || (is_array($version_id) && count($version_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $version_id when calling listLegacyWafFirewallsService' + ); + } + if ($page_size !== null && $page_size > 100) { + throw new \InvalidArgumentException('invalid value for "$page_size" when calling LegacyWafFirewallApi.listLegacyWafFirewallsService, must be smaller than or equal to 100.'); + } + if ($page_size !== null && $page_size < 1) { + throw new \InvalidArgumentException('invalid value for "$page_size" when calling LegacyWafFirewallApi.listLegacyWafFirewallsService, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/service/{service_id}/version/{version_id}/wafs'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($page_number !== null) { + if('form' === 'form' && is_array($page_number)) { + foreach($page_number as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['page[number]'] = ObjectSerializer::toString($page_number); + } + } + // query params + if ($page_size !== null) { + if('form' === 'form' && is_array($page_size)) { + foreach($page_size as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['page[size]'] = ObjectSerializer::toString($page_size); + } + } + // query params + if ($include !== null) { + if('form' === 'form' && is_array($include)) { + foreach($include as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['include'] = ObjectSerializer::toString($include); + } + } + + + // path params + if ($service_id !== null) { + $resourcePath = str_replace( + '{' . 'service_id' . '}', + ObjectSerializer::toPathValue($service_id), + $resourcePath + ); + } + // path params + if ($version_id !== null) { + $resourcePath = str_replace( + '{' . 'version_id' . '}', + ObjectSerializer::toPathValue($version_id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+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 updateLegacyWafFirewallService + * + * Update a firewall + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param array $request_body request_body (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return object + * @deprecated + */ + public function updateLegacyWafFirewallService($options) + { + list($response) = $this->updateLegacyWafFirewallServiceWithHttpInfo($options); + return $response; + } + + /** + * Operation updateLegacyWafFirewallServiceWithHttpInfo + * + * Update a firewall + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param array $request_body (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function updateLegacyWafFirewallServiceWithHttpInfo($options) + { + $request = $this->updateLegacyWafFirewallServiceRequest($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 ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'object'; + 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(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateLegacyWafFirewallServiceAsync + * + * Update a firewall + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function updateLegacyWafFirewallServiceAsync($options) + { + return $this->updateLegacyWafFirewallServiceAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateLegacyWafFirewallServiceAsyncWithHttpInfo + * + * Update a firewall + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function updateLegacyWafFirewallServiceAsyncWithHttpInfo($options) + { + $returnType = 'object'; + $request = $this->updateLegacyWafFirewallServiceRequest($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 'updateLegacyWafFirewallService' + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + * @deprecated + */ + public function updateLegacyWafFirewallServiceRequest($options) + { + // unbox the parameters from the associative array + $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null; + $version_id = array_key_exists('version_id', $options) ? $options['version_id'] : null; + $firewall_id = array_key_exists('firewall_id', $options) ? $options['firewall_id'] : null; + $request_body = array_key_exists('request_body', $options) ? $options['request_body'] : null; + + // verify the required parameter 'service_id' is set + if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $service_id when calling updateLegacyWafFirewallService' + ); + } + // verify the required parameter 'version_id' is set + if ($version_id === null || (is_array($version_id) && count($version_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $version_id when calling updateLegacyWafFirewallService' + ); + } + // verify the required parameter 'firewall_id' is set + if ($firewall_id === null || (is_array($firewall_id) && count($firewall_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $firewall_id when calling updateLegacyWafFirewallService' + ); + } + + $resourcePath = '/service/{service_id}/version/{version_id}/wafs/{firewall_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($service_id !== null) { + $resourcePath = str_replace( + '{' . 'service_id' . '}', + ObjectSerializer::toPathValue($service_id), + $resourcePath + ); + } + // path params + if ($version_id !== null) { + $resourcePath = str_replace( + '{' . 'version_id' . '}', + ObjectSerializer::toPathValue($version_id), + $resourcePath + ); + } + // path params + if ($firewall_id !== null) { + $resourcePath = str_replace( + '{' . 'firewall_id' . '}', + ObjectSerializer::toPathValue($firewall_id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+json'], + ['application/vnd.api+json'] + ); + } + + // for model (json/xml) + if (isset($request_body)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($request_body)); + } else { + $httpBody = $request_body; + } + } 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/LegacyWafOwaspApi.php b/lib/Api/LegacyWafOwaspApi.php new file mode 100644 index 00000000..eef1985a --- /dev/null +++ b/lib/Api/LegacyWafOwaspApi.php @@ -0,0 +1,1195 @@ +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 createOwaspSettings + * + * Create an OWASP settings object + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param array $request_body request_body (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return object + * @deprecated + */ + public function createOwaspSettings($options) + { + list($response) = $this->createOwaspSettingsWithHttpInfo($options); + return $response; + } + + /** + * Operation createOwaspSettingsWithHttpInfo + * + * Create an OWASP settings object + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param array $request_body (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function createOwaspSettingsWithHttpInfo($options) + { + $request = $this->createOwaspSettingsRequest($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 201: + if ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'object'; + 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 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createOwaspSettingsAsync + * + * Create an OWASP settings object + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function createOwaspSettingsAsync($options) + { + return $this->createOwaspSettingsAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createOwaspSettingsAsyncWithHttpInfo + * + * Create an OWASP settings object + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function createOwaspSettingsAsyncWithHttpInfo($options) + { + $returnType = 'object'; + $request = $this->createOwaspSettingsRequest($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 'createOwaspSettings' + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + * @deprecated + */ + public function createOwaspSettingsRequest($options) + { + // unbox the parameters from the associative array + $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null; + $firewall_id = array_key_exists('firewall_id', $options) ? $options['firewall_id'] : null; + $request_body = array_key_exists('request_body', $options) ? $options['request_body'] : null; + + // verify the required parameter 'service_id' is set + if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $service_id when calling createOwaspSettings' + ); + } + // verify the required parameter 'firewall_id' is set + if ($firewall_id === null || (is_array($firewall_id) && count($firewall_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $firewall_id when calling createOwaspSettings' + ); + } + + $resourcePath = '/service/{service_id}/wafs/{firewall_id}/owasp'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($service_id !== null) { + $resourcePath = str_replace( + '{' . 'service_id' . '}', + ObjectSerializer::toPathValue($service_id), + $resourcePath + ); + } + // path params + if ($firewall_id !== null) { + $resourcePath = str_replace( + '{' . 'firewall_id' . '}', + ObjectSerializer::toPathValue($firewall_id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+json'], + ['application/vnd.api+json'] + ); + } + + // for model (json/xml) + if (isset($request_body)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($request_body)); + } else { + $httpBody = $request_body; + } + } 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 getOwaspSettings + * + * Get the OWASP settings object + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return object + * @deprecated + */ + public function getOwaspSettings($options) + { + list($response) = $this->getOwaspSettingsWithHttpInfo($options); + return $response; + } + + /** + * Operation getOwaspSettingsWithHttpInfo + * + * Get the OWASP settings object + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function getOwaspSettingsWithHttpInfo($options) + { + $request = $this->getOwaspSettingsRequest($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 ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'object'; + 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(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getOwaspSettingsAsync + * + * Get the OWASP settings object + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function getOwaspSettingsAsync($options) + { + return $this->getOwaspSettingsAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOwaspSettingsAsyncWithHttpInfo + * + * Get the OWASP settings object + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function getOwaspSettingsAsyncWithHttpInfo($options) + { + $returnType = 'object'; + $request = $this->getOwaspSettingsRequest($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 'getOwaspSettings' + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + * @deprecated + */ + public function getOwaspSettingsRequest($options) + { + // unbox the parameters from the associative array + $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null; + $firewall_id = array_key_exists('firewall_id', $options) ? $options['firewall_id'] : null; + + // verify the required parameter 'service_id' is set + if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $service_id when calling getOwaspSettings' + ); + } + // verify the required parameter 'firewall_id' is set + if ($firewall_id === null || (is_array($firewall_id) && count($firewall_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $firewall_id when calling getOwaspSettings' + ); + } + + $resourcePath = '/service/{service_id}/wafs/{firewall_id}/owasp'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($service_id !== null) { + $resourcePath = str_replace( + '{' . 'service_id' . '}', + ObjectSerializer::toPathValue($service_id), + $resourcePath + ); + } + // path params + if ($firewall_id !== null) { + $resourcePath = str_replace( + '{' . 'firewall_id' . '}', + ObjectSerializer::toPathValue($firewall_id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+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 updateOwaspSettings + * + * Update the OWASP settings object + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param array $request_body request_body (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return object + * @deprecated + */ + public function updateOwaspSettings($options) + { + list($response) = $this->updateOwaspSettingsWithHttpInfo($options); + return $response; + } + + /** + * Operation updateOwaspSettingsWithHttpInfo + * + * Update the OWASP settings object + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param array $request_body (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function updateOwaspSettingsWithHttpInfo($options) + { + $request = $this->updateOwaspSettingsRequest($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 ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'object'; + 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(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateOwaspSettingsAsync + * + * Update the OWASP settings object + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function updateOwaspSettingsAsync($options) + { + return $this->updateOwaspSettingsAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateOwaspSettingsAsyncWithHttpInfo + * + * Update the OWASP settings object + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function updateOwaspSettingsAsyncWithHttpInfo($options) + { + $returnType = 'object'; + $request = $this->updateOwaspSettingsRequest($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 'updateOwaspSettings' + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + * @deprecated + */ + public function updateOwaspSettingsRequest($options) + { + // unbox the parameters from the associative array + $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null; + $firewall_id = array_key_exists('firewall_id', $options) ? $options['firewall_id'] : null; + $request_body = array_key_exists('request_body', $options) ? $options['request_body'] : null; + + // verify the required parameter 'service_id' is set + if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $service_id when calling updateOwaspSettings' + ); + } + // verify the required parameter 'firewall_id' is set + if ($firewall_id === null || (is_array($firewall_id) && count($firewall_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $firewall_id when calling updateOwaspSettings' + ); + } + + $resourcePath = '/service/{service_id}/wafs/{firewall_id}/owasp'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($service_id !== null) { + $resourcePath = str_replace( + '{' . 'service_id' . '}', + ObjectSerializer::toPathValue($service_id), + $resourcePath + ); + } + // path params + if ($firewall_id !== null) { + $resourcePath = str_replace( + '{' . 'firewall_id' . '}', + ObjectSerializer::toPathValue($firewall_id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+json'], + ['application/vnd.api+json'] + ); + } + + // for model (json/xml) + if (isset($request_body)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($request_body)); + } else { + $httpBody = $request_body; + } + } 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/LegacyWafRuleApi.php b/lib/Api/LegacyWafRuleApi.php new file mode 100644 index 00000000..756f2551 --- /dev/null +++ b/lib/Api/LegacyWafRuleApi.php @@ -0,0 +1,1598 @@ +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 getLegacyWafFirewallRuleVcl + * + * Get VCL for a rule associated with a firewall + * + * 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 $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param string $waf_rule_id Alphanumeric string identifying a WAF rule. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return object + * @deprecated + */ + public function getLegacyWafFirewallRuleVcl($options) + { + list($response) = $this->getLegacyWafFirewallRuleVclWithHttpInfo($options); + return $response; + } + + /** + * Operation getLegacyWafFirewallRuleVclWithHttpInfo + * + * Get VCL for a rule associated with a firewall + * + * 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 $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param string $waf_rule_id Alphanumeric string identifying a WAF rule. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function getLegacyWafFirewallRuleVclWithHttpInfo($options) + { + $request = $this->getLegacyWafFirewallRuleVclRequest($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 ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'object'; + 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(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getLegacyWafFirewallRuleVclAsync + * + * Get VCL for a rule associated with a firewall + * + * 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 $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param string $waf_rule_id Alphanumeric string identifying a WAF rule. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function getLegacyWafFirewallRuleVclAsync($options) + { + return $this->getLegacyWafFirewallRuleVclAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getLegacyWafFirewallRuleVclAsyncWithHttpInfo + * + * Get VCL for a rule associated with a firewall + * + * 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 $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param string $waf_rule_id Alphanumeric string identifying a WAF rule. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function getLegacyWafFirewallRuleVclAsyncWithHttpInfo($options) + { + $returnType = 'object'; + $request = $this->getLegacyWafFirewallRuleVclRequest($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 'getLegacyWafFirewallRuleVcl' + * + * 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 $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param string $waf_rule_id Alphanumeric string identifying a WAF rule. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + * @deprecated + */ + public function getLegacyWafFirewallRuleVclRequest($options) + { + // unbox the parameters from the associative array + $firewall_id = array_key_exists('firewall_id', $options) ? $options['firewall_id'] : null; + $waf_rule_id = array_key_exists('waf_rule_id', $options) ? $options['waf_rule_id'] : null; + + // verify the required parameter 'firewall_id' is set + if ($firewall_id === null || (is_array($firewall_id) && count($firewall_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $firewall_id when calling getLegacyWafFirewallRuleVcl' + ); + } + // verify the required parameter 'waf_rule_id' is set + if ($waf_rule_id === null || (is_array($waf_rule_id) && count($waf_rule_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $waf_rule_id when calling getLegacyWafFirewallRuleVcl' + ); + } + + $resourcePath = '/wafs/{firewall_id}/rules/{waf_rule_id}/vcl'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($firewall_id !== null) { + $resourcePath = str_replace( + '{' . 'firewall_id' . '}', + ObjectSerializer::toPathValue($firewall_id), + $resourcePath + ); + } + // path params + if ($waf_rule_id !== null) { + $resourcePath = str_replace( + '{' . 'waf_rule_id' . '}', + ObjectSerializer::toPathValue($waf_rule_id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+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 getLegacyWafRule + * + * Get a rule + * + * 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 $filter_configuration_set_id Optional. Limit rule to a specific configuration set or pass \"all\" to search all configuration sets, including stale ones. (optional) + * @param string $include Include relationships. Optional. Comma separated values. Permitted values: `tags`, `rule_statuses`, `source`, and `vcl`. (optional) + * @param string $waf_rule_id Alphanumeric string identifying a WAF rule. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return object + * @deprecated + */ + public function getLegacyWafRule($options) + { + list($response) = $this->getLegacyWafRuleWithHttpInfo($options); + return $response; + } + + /** + * Operation getLegacyWafRuleWithHttpInfo + * + * Get a rule + * + * 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 $filter_configuration_set_id Optional. Limit rule to a specific configuration set or pass \"all\" to search all configuration sets, including stale ones. (optional) + * @param string $include Include relationships. Optional. Comma separated values. Permitted values: `tags`, `rule_statuses`, `source`, and `vcl`. (optional) + * @param string $waf_rule_id Alphanumeric string identifying a WAF rule. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function getLegacyWafRuleWithHttpInfo($options) + { + $request = $this->getLegacyWafRuleRequest($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 ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'object'; + 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(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getLegacyWafRuleAsync + * + * Get a rule + * + * 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 $filter_configuration_set_id Optional. Limit rule to a specific configuration set or pass \"all\" to search all configuration sets, including stale ones. (optional) + * @param string $include Include relationships. Optional. Comma separated values. Permitted values: `tags`, `rule_statuses`, `source`, and `vcl`. (optional) + * @param string $waf_rule_id Alphanumeric string identifying a WAF rule. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function getLegacyWafRuleAsync($options) + { + return $this->getLegacyWafRuleAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getLegacyWafRuleAsyncWithHttpInfo + * + * Get a rule + * + * 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 $filter_configuration_set_id Optional. Limit rule to a specific configuration set or pass \"all\" to search all configuration sets, including stale ones. (optional) + * @param string $include Include relationships. Optional. Comma separated values. Permitted values: `tags`, `rule_statuses`, `source`, and `vcl`. (optional) + * @param string $waf_rule_id Alphanumeric string identifying a WAF rule. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function getLegacyWafRuleAsyncWithHttpInfo($options) + { + $returnType = 'object'; + $request = $this->getLegacyWafRuleRequest($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 'getLegacyWafRule' + * + * 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 $filter_configuration_set_id Optional. Limit rule to a specific configuration set or pass \"all\" to search all configuration sets, including stale ones. (optional) + * @param string $include Include relationships. Optional. Comma separated values. Permitted values: `tags`, `rule_statuses`, `source`, and `vcl`. (optional) + * @param string $waf_rule_id Alphanumeric string identifying a WAF rule. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + * @deprecated + */ + public function getLegacyWafRuleRequest($options) + { + // unbox the parameters from the associative array + $filter_configuration_set_id = array_key_exists('filter_configuration_set_id', $options) ? $options['filter_configuration_set_id'] : null; + $include = array_key_exists('include', $options) ? $options['include'] : null; + $waf_rule_id = array_key_exists('waf_rule_id', $options) ? $options['waf_rule_id'] : null; + + // verify the required parameter 'waf_rule_id' is set + if ($waf_rule_id === null || (is_array($waf_rule_id) && count($waf_rule_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $waf_rule_id when calling getLegacyWafRule' + ); + } + + $resourcePath = '/wafs/rules/{waf_rule_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($filter_configuration_set_id !== null) { + if('form' === 'form' && is_array($filter_configuration_set_id)) { + foreach($filter_configuration_set_id as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['filter[configuration_set_id]'] = ObjectSerializer::toString($filter_configuration_set_id); + } + } + // query params + if ($include !== null) { + if('form' === 'form' && is_array($include)) { + foreach($include as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['include'] = ObjectSerializer::toString($include); + } + } + + + // path params + if ($waf_rule_id !== null) { + $resourcePath = str_replace( + '{' . 'waf_rule_id' . '}', + ObjectSerializer::toPathValue($waf_rule_id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+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 getLegacyWafRuleVcl + * + * Get VCL for a rule + * + * 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 $waf_rule_id Alphanumeric string identifying a WAF rule. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return object + * @deprecated + */ + public function getLegacyWafRuleVcl($options) + { + list($response) = $this->getLegacyWafRuleVclWithHttpInfo($options); + return $response; + } + + /** + * Operation getLegacyWafRuleVclWithHttpInfo + * + * Get VCL for a rule + * + * 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 $waf_rule_id Alphanumeric string identifying a WAF rule. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function getLegacyWafRuleVclWithHttpInfo($options) + { + $request = $this->getLegacyWafRuleVclRequest($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 ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'object'; + 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(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getLegacyWafRuleVclAsync + * + * Get VCL for a rule + * + * 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 $waf_rule_id Alphanumeric string identifying a WAF rule. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function getLegacyWafRuleVclAsync($options) + { + return $this->getLegacyWafRuleVclAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getLegacyWafRuleVclAsyncWithHttpInfo + * + * Get VCL for a rule + * + * 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 $waf_rule_id Alphanumeric string identifying a WAF rule. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function getLegacyWafRuleVclAsyncWithHttpInfo($options) + { + $returnType = 'object'; + $request = $this->getLegacyWafRuleVclRequest($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 'getLegacyWafRuleVcl' + * + * 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 $waf_rule_id Alphanumeric string identifying a WAF rule. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + * @deprecated + */ + public function getLegacyWafRuleVclRequest($options) + { + // unbox the parameters from the associative array + $waf_rule_id = array_key_exists('waf_rule_id', $options) ? $options['waf_rule_id'] : null; + + // verify the required parameter 'waf_rule_id' is set + if ($waf_rule_id === null || (is_array($waf_rule_id) && count($waf_rule_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $waf_rule_id when calling getLegacyWafRuleVcl' + ); + } + + $resourcePath = '/wafs/rules/{waf_rule_id}/vcl'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($waf_rule_id !== null) { + $resourcePath = str_replace( + '{' . 'waf_rule_id' . '}', + ObjectSerializer::toPathValue($waf_rule_id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+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 listLegacyWafRules + * + * List rules in the latest configuration set + * + * 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 $filter_rule_id Limit the returned rules to a specific rule ID. (optional) + * @param string $filter_severity Limit the returned rules to a specific severity. (optional) + * @param string $filter_tags_name Limit the returned rules to a set linked to a tag by name. (optional) + * @param string $filter_configuration_set_id Optional. Limit rules to specific configuration set or pass \"all\" to search all configuration sets, including stale ones. (optional) + * @param int $page_number Current page. (optional) + * @param int $page_size Number of records per page. (optional, default to 20) + * @param string $include Include relationships. Optional. Comma separated values. Permitted values: `tags`, `rule_statuses`, and `source`. (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return object[] + * @deprecated + */ + public function listLegacyWafRules($options) + { + list($response) = $this->listLegacyWafRulesWithHttpInfo($options); + return $response; + } + + /** + * Operation listLegacyWafRulesWithHttpInfo + * + * List rules in the latest configuration set + * + * 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 $filter_rule_id Limit the returned rules to a specific rule ID. (optional) + * @param string $filter_severity Limit the returned rules to a specific severity. (optional) + * @param string $filter_tags_name Limit the returned rules to a set linked to a tag by name. (optional) + * @param string $filter_configuration_set_id Optional. Limit rules to specific configuration set or pass \"all\" to search all configuration sets, including stale ones. (optional) + * @param int $page_number Current page. (optional) + * @param int $page_size Number of records per page. (optional, default to 20) + * @param string $include Include relationships. Optional. Comma separated values. Permitted values: `tags`, `rule_statuses`, and `source`. (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of object[], HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function listLegacyWafRulesWithHttpInfo($options) + { + $request = $this->listLegacyWafRulesRequest($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 ('object[]' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'object[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'object[]'; + 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(), + 'object[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listLegacyWafRulesAsync + * + * List rules in the latest configuration set + * + * 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 $filter_rule_id Limit the returned rules to a specific rule ID. (optional) + * @param string $filter_severity Limit the returned rules to a specific severity. (optional) + * @param string $filter_tags_name Limit the returned rules to a set linked to a tag by name. (optional) + * @param string $filter_configuration_set_id Optional. Limit rules to specific configuration set or pass \"all\" to search all configuration sets, including stale ones. (optional) + * @param int $page_number Current page. (optional) + * @param int $page_size Number of records per page. (optional, default to 20) + * @param string $include Include relationships. Optional. Comma separated values. Permitted values: `tags`, `rule_statuses`, and `source`. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function listLegacyWafRulesAsync($options) + { + return $this->listLegacyWafRulesAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listLegacyWafRulesAsyncWithHttpInfo + * + * List rules in the latest configuration set + * + * 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 $filter_rule_id Limit the returned rules to a specific rule ID. (optional) + * @param string $filter_severity Limit the returned rules to a specific severity. (optional) + * @param string $filter_tags_name Limit the returned rules to a set linked to a tag by name. (optional) + * @param string $filter_configuration_set_id Optional. Limit rules to specific configuration set or pass \"all\" to search all configuration sets, including stale ones. (optional) + * @param int $page_number Current page. (optional) + * @param int $page_size Number of records per page. (optional, default to 20) + * @param string $include Include relationships. Optional. Comma separated values. Permitted values: `tags`, `rule_statuses`, and `source`. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function listLegacyWafRulesAsyncWithHttpInfo($options) + { + $returnType = 'object[]'; + $request = $this->listLegacyWafRulesRequest($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 'listLegacyWafRules' + * + * 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 $filter_rule_id Limit the returned rules to a specific rule ID. (optional) + * @param string $filter_severity Limit the returned rules to a specific severity. (optional) + * @param string $filter_tags_name Limit the returned rules to a set linked to a tag by name. (optional) + * @param string $filter_configuration_set_id Optional. Limit rules to specific configuration set or pass \"all\" to search all configuration sets, including stale ones. (optional) + * @param int $page_number Current page. (optional) + * @param int $page_size Number of records per page. (optional, default to 20) + * @param string $include Include relationships. Optional. Comma separated values. Permitted values: `tags`, `rule_statuses`, and `source`. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + * @deprecated + */ + public function listLegacyWafRulesRequest($options) + { + // unbox the parameters from the associative array + $filter_rule_id = array_key_exists('filter_rule_id', $options) ? $options['filter_rule_id'] : null; + $filter_severity = array_key_exists('filter_severity', $options) ? $options['filter_severity'] : null; + $filter_tags_name = array_key_exists('filter_tags_name', $options) ? $options['filter_tags_name'] : null; + $filter_configuration_set_id = array_key_exists('filter_configuration_set_id', $options) ? $options['filter_configuration_set_id'] : null; + $page_number = array_key_exists('page_number', $options) ? $options['page_number'] : null; + $page_size = array_key_exists('page_size', $options) ? $options['page_size'] : 20; + $include = array_key_exists('include', $options) ? $options['include'] : null; + + if ($page_size !== null && $page_size > 100) { + throw new \InvalidArgumentException('invalid value for "$page_size" when calling LegacyWafRuleApi.listLegacyWafRules, must be smaller than or equal to 100.'); + } + if ($page_size !== null && $page_size < 1) { + throw new \InvalidArgumentException('invalid value for "$page_size" when calling LegacyWafRuleApi.listLegacyWafRules, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/wafs/rules'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($filter_rule_id !== null) { + if('form' === 'form' && is_array($filter_rule_id)) { + foreach($filter_rule_id as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['filter[rule_id]'] = ObjectSerializer::toString($filter_rule_id); + } + } + // query params + if ($filter_severity !== null) { + if('form' === 'form' && is_array($filter_severity)) { + foreach($filter_severity as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['filter[severity]'] = ObjectSerializer::toString($filter_severity); + } + } + // query params + if ($filter_tags_name !== null) { + if('form' === 'form' && is_array($filter_tags_name)) { + foreach($filter_tags_name as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['filter[tags][name]'] = ObjectSerializer::toString($filter_tags_name); + } + } + // query params + if ($filter_configuration_set_id !== null) { + if('form' === 'form' && is_array($filter_configuration_set_id)) { + foreach($filter_configuration_set_id as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['filter[configuration_set_id]'] = ObjectSerializer::toString($filter_configuration_set_id); + } + } + // query params + if ($page_number !== null) { + if('form' === 'form' && is_array($page_number)) { + foreach($page_number as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['page[number]'] = ObjectSerializer::toString($page_number); + } + } + // query params + if ($page_size !== null) { + if('form' === 'form' && is_array($page_size)) { + foreach($page_size as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['page[size]'] = ObjectSerializer::toString($page_size); + } + } + // query params + if ($include !== null) { + if('form' === 'form' && is_array($include)) { + foreach($include as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['include'] = ObjectSerializer::toString($include); + } + } + + + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+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/LegacyWafRuleStatusApi.php b/lib/Api/LegacyWafRuleStatusApi.php new file mode 100644 index 00000000..7726caf0 --- /dev/null +++ b/lib/Api/LegacyWafRuleStatusApi.php @@ -0,0 +1,1759 @@ +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 getWafFirewallRuleStatus + * + * Get the status of a rule on a firewall + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param string $waf_rule_id Alphanumeric string identifying a WAF rule. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return object + * @deprecated + */ + public function getWafFirewallRuleStatus($options) + { + list($response) = $this->getWafFirewallRuleStatusWithHttpInfo($options); + return $response; + } + + /** + * Operation getWafFirewallRuleStatusWithHttpInfo + * + * Get the status of a rule on a firewall + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param string $waf_rule_id Alphanumeric string identifying a WAF rule. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function getWafFirewallRuleStatusWithHttpInfo($options) + { + $request = $this->getWafFirewallRuleStatusRequest($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 ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'object'; + 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(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getWafFirewallRuleStatusAsync + * + * Get the status of a rule on a firewall + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param string $waf_rule_id Alphanumeric string identifying a WAF rule. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function getWafFirewallRuleStatusAsync($options) + { + return $this->getWafFirewallRuleStatusAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getWafFirewallRuleStatusAsyncWithHttpInfo + * + * Get the status of a rule on a firewall + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param string $waf_rule_id Alphanumeric string identifying a WAF rule. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function getWafFirewallRuleStatusAsyncWithHttpInfo($options) + { + $returnType = 'object'; + $request = $this->getWafFirewallRuleStatusRequest($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 'getWafFirewallRuleStatus' + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param string $waf_rule_id Alphanumeric string identifying a WAF rule. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + * @deprecated + */ + public function getWafFirewallRuleStatusRequest($options) + { + // unbox the parameters from the associative array + $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null; + $firewall_id = array_key_exists('firewall_id', $options) ? $options['firewall_id'] : null; + $waf_rule_id = array_key_exists('waf_rule_id', $options) ? $options['waf_rule_id'] : null; + + // verify the required parameter 'service_id' is set + if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $service_id when calling getWafFirewallRuleStatus' + ); + } + // verify the required parameter 'firewall_id' is set + if ($firewall_id === null || (is_array($firewall_id) && count($firewall_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $firewall_id when calling getWafFirewallRuleStatus' + ); + } + // verify the required parameter 'waf_rule_id' is set + if ($waf_rule_id === null || (is_array($waf_rule_id) && count($waf_rule_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $waf_rule_id when calling getWafFirewallRuleStatus' + ); + } + + $resourcePath = '/service/{service_id}/wafs/{firewall_id}/rules/{waf_rule_id}/rule_status'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($service_id !== null) { + $resourcePath = str_replace( + '{' . 'service_id' . '}', + ObjectSerializer::toPathValue($service_id), + $resourcePath + ); + } + // path params + if ($firewall_id !== null) { + $resourcePath = str_replace( + '{' . 'firewall_id' . '}', + ObjectSerializer::toPathValue($firewall_id), + $resourcePath + ); + } + // path params + if ($waf_rule_id !== null) { + $resourcePath = str_replace( + '{' . 'waf_rule_id' . '}', + ObjectSerializer::toPathValue($waf_rule_id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+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 listWafFirewallRuleStatuses + * + * List rule statuses + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param string $filter_status Limit results to rule statuses with the specified status. (optional) + * @param string $filter_rule_message Limit results to rule statuses whose rules have the specified message. (optional) + * @param string $filter_rule_rule_id Limit results to rule statuses whose rules represent the specified ModSecurity rule_id. (optional) + * @param string $filter_rule_tags Limit results to rule statuses whose rules relate to the specified tag IDs. (optional) + * @param string $filter_rule_tags_name Limit results to rule statuses whose rules related to the named tags. (optional) + * @param string $include Include relationships. Optional, comma separated values. Permitted values: `tags`. (optional) + * @param int $page_number Current page. (optional) + * @param int $page_size Number of records per page. (optional, default to 20) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return object + * @deprecated + */ + public function listWafFirewallRuleStatuses($options) + { + list($response) = $this->listWafFirewallRuleStatusesWithHttpInfo($options); + return $response; + } + + /** + * Operation listWafFirewallRuleStatusesWithHttpInfo + * + * List rule statuses + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param string $filter_status Limit results to rule statuses with the specified status. (optional) + * @param string $filter_rule_message Limit results to rule statuses whose rules have the specified message. (optional) + * @param string $filter_rule_rule_id Limit results to rule statuses whose rules represent the specified ModSecurity rule_id. (optional) + * @param string $filter_rule_tags Limit results to rule statuses whose rules relate to the specified tag IDs. (optional) + * @param string $filter_rule_tags_name Limit results to rule statuses whose rules related to the named tags. (optional) + * @param string $include Include relationships. Optional, comma separated values. Permitted values: `tags`. (optional) + * @param int $page_number Current page. (optional) + * @param int $page_size Number of records per page. (optional, default to 20) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function listWafFirewallRuleStatusesWithHttpInfo($options) + { + $request = $this->listWafFirewallRuleStatusesRequest($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 ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'object'; + 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(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listWafFirewallRuleStatusesAsync + * + * List rule statuses + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param string $filter_status Limit results to rule statuses with the specified status. (optional) + * @param string $filter_rule_message Limit results to rule statuses whose rules have the specified message. (optional) + * @param string $filter_rule_rule_id Limit results to rule statuses whose rules represent the specified ModSecurity rule_id. (optional) + * @param string $filter_rule_tags Limit results to rule statuses whose rules relate to the specified tag IDs. (optional) + * @param string $filter_rule_tags_name Limit results to rule statuses whose rules related to the named tags. (optional) + * @param string $include Include relationships. Optional, comma separated values. Permitted values: `tags`. (optional) + * @param int $page_number Current page. (optional) + * @param int $page_size Number of records per page. (optional, default to 20) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function listWafFirewallRuleStatusesAsync($options) + { + return $this->listWafFirewallRuleStatusesAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listWafFirewallRuleStatusesAsyncWithHttpInfo + * + * List rule statuses + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param string $filter_status Limit results to rule statuses with the specified status. (optional) + * @param string $filter_rule_message Limit results to rule statuses whose rules have the specified message. (optional) + * @param string $filter_rule_rule_id Limit results to rule statuses whose rules represent the specified ModSecurity rule_id. (optional) + * @param string $filter_rule_tags Limit results to rule statuses whose rules relate to the specified tag IDs. (optional) + * @param string $filter_rule_tags_name Limit results to rule statuses whose rules related to the named tags. (optional) + * @param string $include Include relationships. Optional, comma separated values. Permitted values: `tags`. (optional) + * @param int $page_number Current page. (optional) + * @param int $page_size Number of records per page. (optional, default to 20) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function listWafFirewallRuleStatusesAsyncWithHttpInfo($options) + { + $returnType = 'object'; + $request = $this->listWafFirewallRuleStatusesRequest($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 'listWafFirewallRuleStatuses' + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param string $filter_status Limit results to rule statuses with the specified status. (optional) + * @param string $filter_rule_message Limit results to rule statuses whose rules have the specified message. (optional) + * @param string $filter_rule_rule_id Limit results to rule statuses whose rules represent the specified ModSecurity rule_id. (optional) + * @param string $filter_rule_tags Limit results to rule statuses whose rules relate to the specified tag IDs. (optional) + * @param string $filter_rule_tags_name Limit results to rule statuses whose rules related to the named tags. (optional) + * @param string $include Include relationships. Optional, comma separated values. Permitted values: `tags`. (optional) + * @param int $page_number Current page. (optional) + * @param int $page_size Number of records per page. (optional, default to 20) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + * @deprecated + */ + public function listWafFirewallRuleStatusesRequest($options) + { + // unbox the parameters from the associative array + $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null; + $firewall_id = array_key_exists('firewall_id', $options) ? $options['firewall_id'] : null; + $filter_status = array_key_exists('filter_status', $options) ? $options['filter_status'] : null; + $filter_rule_message = array_key_exists('filter_rule_message', $options) ? $options['filter_rule_message'] : null; + $filter_rule_rule_id = array_key_exists('filter_rule_rule_id', $options) ? $options['filter_rule_rule_id'] : null; + $filter_rule_tags = array_key_exists('filter_rule_tags', $options) ? $options['filter_rule_tags'] : null; + $filter_rule_tags_name = array_key_exists('filter_rule_tags_name', $options) ? $options['filter_rule_tags_name'] : null; + $include = array_key_exists('include', $options) ? $options['include'] : null; + $page_number = array_key_exists('page_number', $options) ? $options['page_number'] : null; + $page_size = array_key_exists('page_size', $options) ? $options['page_size'] : 20; + + // verify the required parameter 'service_id' is set + if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $service_id when calling listWafFirewallRuleStatuses' + ); + } + // verify the required parameter 'firewall_id' is set + if ($firewall_id === null || (is_array($firewall_id) && count($firewall_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $firewall_id when calling listWafFirewallRuleStatuses' + ); + } + if ($page_size !== null && $page_size > 100) { + throw new \InvalidArgumentException('invalid value for "$page_size" when calling LegacyWafRuleStatusApi.listWafFirewallRuleStatuses, must be smaller than or equal to 100.'); + } + if ($page_size !== null && $page_size < 1) { + throw new \InvalidArgumentException('invalid value for "$page_size" when calling LegacyWafRuleStatusApi.listWafFirewallRuleStatuses, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/service/{service_id}/wafs/{firewall_id}/rule_statuses'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($filter_status !== null) { + if('form' === 'form' && is_array($filter_status)) { + foreach($filter_status as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['filter[status]'] = ObjectSerializer::toString($filter_status); + } + } + // query params + if ($filter_rule_message !== null) { + if('form' === 'form' && is_array($filter_rule_message)) { + foreach($filter_rule_message as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['filter[rule][message]'] = ObjectSerializer::toString($filter_rule_message); + } + } + // query params + if ($filter_rule_rule_id !== null) { + if('form' === 'form' && is_array($filter_rule_rule_id)) { + foreach($filter_rule_rule_id as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['filter[rule][rule_id]'] = ObjectSerializer::toString($filter_rule_rule_id); + } + } + // query params + if ($filter_rule_tags !== null) { + if('form' === 'form' && is_array($filter_rule_tags)) { + foreach($filter_rule_tags as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['filter[rule][tags]'] = ObjectSerializer::toString($filter_rule_tags); + } + } + // query params + if ($filter_rule_tags_name !== null) { + if('form' === 'form' && is_array($filter_rule_tags_name)) { + foreach($filter_rule_tags_name as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['filter[rule][tags][name]'] = ObjectSerializer::toString($filter_rule_tags_name); + } + } + // query params + if ($include !== null) { + if('form' === 'form' && is_array($include)) { + foreach($include as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['include'] = ObjectSerializer::toString($include); + } + } + // query params + if ($page_number !== null) { + if('form' === 'form' && is_array($page_number)) { + foreach($page_number as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['page[number]'] = ObjectSerializer::toString($page_number); + } + } + // query params + if ($page_size !== null) { + if('form' === 'form' && is_array($page_size)) { + foreach($page_size as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['page[size]'] = ObjectSerializer::toString($page_size); + } + } + + + // path params + if ($service_id !== null) { + $resourcePath = str_replace( + '{' . 'service_id' . '}', + ObjectSerializer::toPathValue($service_id), + $resourcePath + ); + } + // path params + if ($firewall_id !== null) { + $resourcePath = str_replace( + '{' . 'firewall_id' . '}', + ObjectSerializer::toPathValue($firewall_id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+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 updateWafFirewallRuleStatus + * + * Update the status of a rule + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param string $waf_rule_id Alphanumeric string identifying a WAF rule. (required) + * @param array $request_body request_body (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return object + * @deprecated + */ + public function updateWafFirewallRuleStatus($options) + { + list($response) = $this->updateWafFirewallRuleStatusWithHttpInfo($options); + return $response; + } + + /** + * Operation updateWafFirewallRuleStatusWithHttpInfo + * + * Update the status of a rule + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param string $waf_rule_id Alphanumeric string identifying a WAF rule. (required) + * @param array $request_body (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function updateWafFirewallRuleStatusWithHttpInfo($options) + { + $request = $this->updateWafFirewallRuleStatusRequest($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 ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'object'; + 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(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateWafFirewallRuleStatusAsync + * + * Update the status of a rule + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param string $waf_rule_id Alphanumeric string identifying a WAF rule. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function updateWafFirewallRuleStatusAsync($options) + { + return $this->updateWafFirewallRuleStatusAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateWafFirewallRuleStatusAsyncWithHttpInfo + * + * Update the status of a rule + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param string $waf_rule_id Alphanumeric string identifying a WAF rule. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function updateWafFirewallRuleStatusAsyncWithHttpInfo($options) + { + $returnType = 'object'; + $request = $this->updateWafFirewallRuleStatusRequest($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 'updateWafFirewallRuleStatus' + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param string $waf_rule_id Alphanumeric string identifying a WAF rule. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + * @deprecated + */ + public function updateWafFirewallRuleStatusRequest($options) + { + // unbox the parameters from the associative array + $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null; + $firewall_id = array_key_exists('firewall_id', $options) ? $options['firewall_id'] : null; + $waf_rule_id = array_key_exists('waf_rule_id', $options) ? $options['waf_rule_id'] : null; + $request_body = array_key_exists('request_body', $options) ? $options['request_body'] : null; + + // verify the required parameter 'service_id' is set + if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $service_id when calling updateWafFirewallRuleStatus' + ); + } + // verify the required parameter 'firewall_id' is set + if ($firewall_id === null || (is_array($firewall_id) && count($firewall_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $firewall_id when calling updateWafFirewallRuleStatus' + ); + } + // verify the required parameter 'waf_rule_id' is set + if ($waf_rule_id === null || (is_array($waf_rule_id) && count($waf_rule_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $waf_rule_id when calling updateWafFirewallRuleStatus' + ); + } + + $resourcePath = '/service/{service_id}/wafs/{firewall_id}/rules/{waf_rule_id}/rule_status'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($service_id !== null) { + $resourcePath = str_replace( + '{' . 'service_id' . '}', + ObjectSerializer::toPathValue($service_id), + $resourcePath + ); + } + // path params + if ($firewall_id !== null) { + $resourcePath = str_replace( + '{' . 'firewall_id' . '}', + ObjectSerializer::toPathValue($firewall_id), + $resourcePath + ); + } + // path params + if ($waf_rule_id !== null) { + $resourcePath = str_replace( + '{' . 'waf_rule_id' . '}', + ObjectSerializer::toPathValue($waf_rule_id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+json'], + ['application/vnd.api+json'] + ); + } + + // for model (json/xml) + if (isset($request_body)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($request_body)); + } else { + $httpBody = $request_body; + } + } 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 + ); + } + + /** + * Operation updateWafFirewallRuleStatusesTag + * + * Create or update status of a tagged group of rules + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param string $name The tag name to use to determine the set of rules to update. For example, OWASP or language-php. (optional) + * @param string $force Whether or not to update rule statuses for disabled rules. Optional. (optional) + * @param array $request_body request_body (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return object + * @deprecated + */ + public function updateWafFirewallRuleStatusesTag($options) + { + list($response) = $this->updateWafFirewallRuleStatusesTagWithHttpInfo($options); + return $response; + } + + /** + * Operation updateWafFirewallRuleStatusesTagWithHttpInfo + * + * Create or update status of a tagged group of rules + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param string $name The tag name to use to determine the set of rules to update. For example, OWASP or language-php. (optional) + * @param string $force Whether or not to update rule statuses for disabled rules. Optional. (optional) + * @param array $request_body (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function updateWafFirewallRuleStatusesTagWithHttpInfo($options) + { + $request = $this->updateWafFirewallRuleStatusesTagRequest($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 ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'object'; + 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(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateWafFirewallRuleStatusesTagAsync + * + * Create or update status of a tagged group of rules + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param string $name The tag name to use to determine the set of rules to update. For example, OWASP or language-php. (optional) + * @param string $force Whether or not to update rule statuses for disabled rules. Optional. (optional) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function updateWafFirewallRuleStatusesTagAsync($options) + { + return $this->updateWafFirewallRuleStatusesTagAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateWafFirewallRuleStatusesTagAsyncWithHttpInfo + * + * Create or update status of a tagged group of rules + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param string $name The tag name to use to determine the set of rules to update. For example, OWASP or language-php. (optional) + * @param string $force Whether or not to update rule statuses for disabled rules. Optional. (optional) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function updateWafFirewallRuleStatusesTagAsyncWithHttpInfo($options) + { + $returnType = 'object'; + $request = $this->updateWafFirewallRuleStatusesTagRequest($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 'updateWafFirewallRuleStatusesTag' + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param string $name The tag name to use to determine the set of rules to update. For example, OWASP or language-php. (optional) + * @param string $force Whether or not to update rule statuses for disabled rules. Optional. (optional) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + * @deprecated + */ + public function updateWafFirewallRuleStatusesTagRequest($options) + { + // unbox the parameters from the associative array + $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null; + $firewall_id = array_key_exists('firewall_id', $options) ? $options['firewall_id'] : null; + $name = array_key_exists('name', $options) ? $options['name'] : null; + $force = array_key_exists('force', $options) ? $options['force'] : null; + $request_body = array_key_exists('request_body', $options) ? $options['request_body'] : null; + + // verify the required parameter 'service_id' is set + if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $service_id when calling updateWafFirewallRuleStatusesTag' + ); + } + // verify the required parameter 'firewall_id' is set + if ($firewall_id === null || (is_array($firewall_id) && count($firewall_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $firewall_id when calling updateWafFirewallRuleStatusesTag' + ); + } + + $resourcePath = '/service/{service_id}/wafs/{firewall_id}/rule_statuses'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($name !== null) { + if('form' === 'form' && is_array($name)) { + foreach($name as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['name'] = ObjectSerializer::toString($name); + } + } + // query params + if ($force !== null) { + if('form' === 'form' && is_array($force)) { + foreach($force as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['force'] = ObjectSerializer::toString($force); + } + } + + + // path params + if ($service_id !== null) { + $resourcePath = str_replace( + '{' . 'service_id' . '}', + ObjectSerializer::toPathValue($service_id), + $resourcePath + ); + } + // path params + if ($firewall_id !== null) { + $resourcePath = str_replace( + '{' . 'firewall_id' . '}', + ObjectSerializer::toPathValue($firewall_id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+json'], + ['application/vnd.api+json'] + ); + } + + // for model (json/xml) + if (isset($request_body)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($request_body)); + } else { + $httpBody = $request_body; + } + } 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 + ); + } + + /** + * 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/LegacyWafRulesetApi.php b/lib/Api/LegacyWafRulesetApi.php new file mode 100644 index 00000000..d7a9d986 --- /dev/null +++ b/lib/Api/LegacyWafRulesetApi.php @@ -0,0 +1,1183 @@ +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 getWafRuleset + * + * Get a WAF ruleset + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return object + * @deprecated + */ + public function getWafRuleset($options) + { + list($response) = $this->getWafRulesetWithHttpInfo($options); + return $response; + } + + /** + * Operation getWafRulesetWithHttpInfo + * + * Get a WAF ruleset + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function getWafRulesetWithHttpInfo($options) + { + $request = $this->getWafRulesetRequest($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 ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'object'; + 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(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getWafRulesetAsync + * + * Get a WAF ruleset + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function getWafRulesetAsync($options) + { + return $this->getWafRulesetAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getWafRulesetAsyncWithHttpInfo + * + * Get a WAF ruleset + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function getWafRulesetAsyncWithHttpInfo($options) + { + $returnType = 'object'; + $request = $this->getWafRulesetRequest($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 'getWafRuleset' + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + * @deprecated + */ + public function getWafRulesetRequest($options) + { + // unbox the parameters from the associative array + $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null; + $firewall_id = array_key_exists('firewall_id', $options) ? $options['firewall_id'] : null; + + // verify the required parameter 'service_id' is set + if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $service_id when calling getWafRuleset' + ); + } + // verify the required parameter 'firewall_id' is set + if ($firewall_id === null || (is_array($firewall_id) && count($firewall_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $firewall_id when calling getWafRuleset' + ); + } + + $resourcePath = '/service/{service_id}/wafs/{firewall_id}/ruleset'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($service_id !== null) { + $resourcePath = str_replace( + '{' . 'service_id' . '}', + ObjectSerializer::toPathValue($service_id), + $resourcePath + ); + } + // path params + if ($firewall_id !== null) { + $resourcePath = str_replace( + '{' . 'firewall_id' . '}', + ObjectSerializer::toPathValue($firewall_id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+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 getWafRulesetVcl + * + * Generate WAF ruleset VCL + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return object + * @deprecated + */ + public function getWafRulesetVcl($options) + { + list($response) = $this->getWafRulesetVclWithHttpInfo($options); + return $response; + } + + /** + * Operation getWafRulesetVclWithHttpInfo + * + * Generate WAF ruleset VCL + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function getWafRulesetVclWithHttpInfo($options) + { + $request = $this->getWafRulesetVclRequest($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 202: + if ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'object'; + 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 202: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getWafRulesetVclAsync + * + * Generate WAF ruleset VCL + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function getWafRulesetVclAsync($options) + { + return $this->getWafRulesetVclAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getWafRulesetVclAsyncWithHttpInfo + * + * Generate WAF ruleset VCL + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function getWafRulesetVclAsyncWithHttpInfo($options) + { + $returnType = 'object'; + $request = $this->getWafRulesetVclRequest($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 'getWafRulesetVcl' + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + * @deprecated + */ + public function getWafRulesetVclRequest($options) + { + // unbox the parameters from the associative array + $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null; + $firewall_id = array_key_exists('firewall_id', $options) ? $options['firewall_id'] : null; + + // verify the required parameter 'service_id' is set + if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $service_id when calling getWafRulesetVcl' + ); + } + // verify the required parameter 'firewall_id' is set + if ($firewall_id === null || (is_array($firewall_id) && count($firewall_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $firewall_id when calling getWafRulesetVcl' + ); + } + + $resourcePath = '/service/{service_id}/wafs/{firewall_id}/ruleset/preview'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($service_id !== null) { + $resourcePath = str_replace( + '{' . 'service_id' . '}', + ObjectSerializer::toPathValue($service_id), + $resourcePath + ); + } + // path params + if ($firewall_id !== null) { + $resourcePath = str_replace( + '{' . 'firewall_id' . '}', + ObjectSerializer::toPathValue($firewall_id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+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 updateWafRuleset + * + * Update a WAF ruleset + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param array $request_body request_body (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return object + * @deprecated + */ + public function updateWafRuleset($options) + { + list($response) = $this->updateWafRulesetWithHttpInfo($options); + return $response; + } + + /** + * Operation updateWafRulesetWithHttpInfo + * + * Update a WAF ruleset + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param array $request_body (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function updateWafRulesetWithHttpInfo($options) + { + $request = $this->updateWafRulesetRequest($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 202: + if ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'object'; + 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 202: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateWafRulesetAsync + * + * Update a WAF ruleset + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function updateWafRulesetAsync($options) + { + return $this->updateWafRulesetAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateWafRulesetAsyncWithHttpInfo + * + * Update a WAF ruleset + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function updateWafRulesetAsyncWithHttpInfo($options) + { + $returnType = 'object'; + $request = $this->updateWafRulesetRequest($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 'updateWafRuleset' + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + * @deprecated + */ + public function updateWafRulesetRequest($options) + { + // unbox the parameters from the associative array + $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null; + $firewall_id = array_key_exists('firewall_id', $options) ? $options['firewall_id'] : null; + $request_body = array_key_exists('request_body', $options) ? $options['request_body'] : null; + + // verify the required parameter 'service_id' is set + if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $service_id when calling updateWafRuleset' + ); + } + // verify the required parameter 'firewall_id' is set + if ($firewall_id === null || (is_array($firewall_id) && count($firewall_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $firewall_id when calling updateWafRuleset' + ); + } + + $resourcePath = '/service/{service_id}/wafs/{firewall_id}/ruleset'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($service_id !== null) { + $resourcePath = str_replace( + '{' . 'service_id' . '}', + ObjectSerializer::toPathValue($service_id), + $resourcePath + ); + } + // path params + if ($firewall_id !== null) { + $resourcePath = str_replace( + '{' . 'firewall_id' . '}', + ObjectSerializer::toPathValue($firewall_id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+json'], + ['application/vnd.api+json'] + ); + } + + // for model (json/xml) + if (isset($request_body)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($request_body)); + } else { + $httpBody = $request_body; + } + } 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/LegacyWafTagApi.php b/lib/Api/LegacyWafTagApi.php new file mode 100644 index 00000000..a1443f7e --- /dev/null +++ b/lib/Api/LegacyWafTagApi.php @@ -0,0 +1,512 @@ +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 listLegacyWafTags + * + * List WAF tags + * + * 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 $filter_name Limit the returned tags to a specific name. (optional) + * @param int $page_number Current page. (optional) + * @param int $page_size Number of records per page. (optional, default to 20) + * @param string $include Include relationships. Optional, comma separated values. Permitted values: `rules`. (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return object + * @deprecated + */ + public function listLegacyWafTags($options) + { + list($response) = $this->listLegacyWafTagsWithHttpInfo($options); + return $response; + } + + /** + * Operation listLegacyWafTagsWithHttpInfo + * + * List WAF tags + * + * 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 $filter_name Limit the returned tags to a specific name. (optional) + * @param int $page_number Current page. (optional) + * @param int $page_size Number of records per page. (optional, default to 20) + * @param string $include Include relationships. Optional, comma separated values. Permitted values: `rules`. (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function listLegacyWafTagsWithHttpInfo($options) + { + $request = $this->listLegacyWafTagsRequest($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 ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'object'; + 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(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listLegacyWafTagsAsync + * + * List WAF tags + * + * 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 $filter_name Limit the returned tags to a specific name. (optional) + * @param int $page_number Current page. (optional) + * @param int $page_size Number of records per page. (optional, default to 20) + * @param string $include Include relationships. Optional, comma separated values. Permitted values: `rules`. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function listLegacyWafTagsAsync($options) + { + return $this->listLegacyWafTagsAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listLegacyWafTagsAsyncWithHttpInfo + * + * List WAF tags + * + * 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 $filter_name Limit the returned tags to a specific name. (optional) + * @param int $page_number Current page. (optional) + * @param int $page_size Number of records per page. (optional, default to 20) + * @param string $include Include relationships. Optional, comma separated values. Permitted values: `rules`. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function listLegacyWafTagsAsyncWithHttpInfo($options) + { + $returnType = 'object'; + $request = $this->listLegacyWafTagsRequest($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 'listLegacyWafTags' + * + * 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 $filter_name Limit the returned tags to a specific name. (optional) + * @param int $page_number Current page. (optional) + * @param int $page_size Number of records per page. (optional, default to 20) + * @param string $include Include relationships. Optional, comma separated values. Permitted values: `rules`. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + * @deprecated + */ + public function listLegacyWafTagsRequest($options) + { + // unbox the parameters from the associative array + $filter_name = array_key_exists('filter_name', $options) ? $options['filter_name'] : null; + $page_number = array_key_exists('page_number', $options) ? $options['page_number'] : null; + $page_size = array_key_exists('page_size', $options) ? $options['page_size'] : 20; + $include = array_key_exists('include', $options) ? $options['include'] : null; + + if ($page_size !== null && $page_size > 100) { + throw new \InvalidArgumentException('invalid value for "$page_size" when calling LegacyWafTagApi.listLegacyWafTags, must be smaller than or equal to 100.'); + } + if ($page_size !== null && $page_size < 1) { + throw new \InvalidArgumentException('invalid value for "$page_size" when calling LegacyWafTagApi.listLegacyWafTags, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/wafs/tags'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($filter_name !== null) { + if('form' === 'form' && is_array($filter_name)) { + foreach($filter_name as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['filter[name]'] = ObjectSerializer::toString($filter_name); + } + } + // query params + if ($page_number !== null) { + if('form' === 'form' && is_array($page_number)) { + foreach($page_number as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['page[number]'] = ObjectSerializer::toString($page_number); + } + } + // query params + if ($page_size !== null) { + if('form' === 'form' && is_array($page_size)) { + foreach($page_size as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['page[size]'] = ObjectSerializer::toString($page_size); + } + } + // query params + if ($include !== null) { + if('form' === 'form' && is_array($include)) { + foreach($include as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['include'] = ObjectSerializer::toString($include); + } + } + + + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+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/LegacyWafUpdateStatusApi.php b/lib/Api/LegacyWafUpdateStatusApi.php new file mode 100644 index 00000000..423bdc89 --- /dev/null +++ b/lib/Api/LegacyWafUpdateStatusApi.php @@ -0,0 +1,902 @@ +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 getWafUpdateStatus + * + * Get the status of a WAF update + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param string $update_status_id Alphanumeric string identifying a WAF update status. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return object + * @deprecated + */ + public function getWafUpdateStatus($options) + { + list($response) = $this->getWafUpdateStatusWithHttpInfo($options); + return $response; + } + + /** + * Operation getWafUpdateStatusWithHttpInfo + * + * Get the status of a WAF update + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param string $update_status_id Alphanumeric string identifying a WAF update status. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function getWafUpdateStatusWithHttpInfo($options) + { + $request = $this->getWafUpdateStatusRequest($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 ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'object'; + 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(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getWafUpdateStatusAsync + * + * Get the status of a WAF update + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param string $update_status_id Alphanumeric string identifying a WAF update status. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function getWafUpdateStatusAsync($options) + { + return $this->getWafUpdateStatusAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getWafUpdateStatusAsyncWithHttpInfo + * + * Get the status of a WAF update + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param string $update_status_id Alphanumeric string identifying a WAF update status. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function getWafUpdateStatusAsyncWithHttpInfo($options) + { + $returnType = 'object'; + $request = $this->getWafUpdateStatusRequest($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 'getWafUpdateStatus' + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * @param string $update_status_id Alphanumeric string identifying a WAF update status. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + * @deprecated + */ + public function getWafUpdateStatusRequest($options) + { + // unbox the parameters from the associative array + $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null; + $firewall_id = array_key_exists('firewall_id', $options) ? $options['firewall_id'] : null; + $update_status_id = array_key_exists('update_status_id', $options) ? $options['update_status_id'] : null; + + // verify the required parameter 'service_id' is set + if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $service_id when calling getWafUpdateStatus' + ); + } + // verify the required parameter 'firewall_id' is set + if ($firewall_id === null || (is_array($firewall_id) && count($firewall_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $firewall_id when calling getWafUpdateStatus' + ); + } + // verify the required parameter 'update_status_id' is set + if ($update_status_id === null || (is_array($update_status_id) && count($update_status_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $update_status_id when calling getWafUpdateStatus' + ); + } + + $resourcePath = '/service/{service_id}/wafs/{firewall_id}/update_statuses/{update_status_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($service_id !== null) { + $resourcePath = str_replace( + '{' . 'service_id' . '}', + ObjectSerializer::toPathValue($service_id), + $resourcePath + ); + } + // path params + if ($firewall_id !== null) { + $resourcePath = str_replace( + '{' . 'firewall_id' . '}', + ObjectSerializer::toPathValue($firewall_id), + $resourcePath + ); + } + // path params + if ($update_status_id !== null) { + $resourcePath = str_replace( + '{' . 'update_status_id' . '}', + ObjectSerializer::toPathValue($update_status_id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+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 listWafUpdateStatuses + * + * List update statuses + * + * 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 int $page_number Current page. (optional) + * @param int $page_size Number of records per page. (optional, default to 20) + * @param string $include Include relationships. Optional, comma separated values. Permitted values: `waf`. (optional) + * @param string $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return object + * @deprecated + */ + public function listWafUpdateStatuses($options) + { + list($response) = $this->listWafUpdateStatusesWithHttpInfo($options); + return $response; + } + + /** + * Operation listWafUpdateStatusesWithHttpInfo + * + * List update statuses + * + * 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 int $page_number Current page. (optional) + * @param int $page_size Number of records per page. (optional, default to 20) + * @param string $include Include relationships. Optional, comma separated values. Permitted values: `waf`. (optional) + * @param string $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function listWafUpdateStatusesWithHttpInfo($options) + { + $request = $this->listWafUpdateStatusesRequest($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 ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'object'; + 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(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listWafUpdateStatusesAsync + * + * List update statuses + * + * 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 int $page_number Current page. (optional) + * @param int $page_size Number of records per page. (optional, default to 20) + * @param string $include Include relationships. Optional, comma separated values. Permitted values: `waf`. (optional) + * @param string $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function listWafUpdateStatusesAsync($options) + { + return $this->listWafUpdateStatusesAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listWafUpdateStatusesAsyncWithHttpInfo + * + * List update statuses + * + * 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 int $page_number Current page. (optional) + * @param int $page_size Number of records per page. (optional, default to 20) + * @param string $include Include relationships. Optional, comma separated values. Permitted values: `waf`. (optional) + * @param string $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function listWafUpdateStatusesAsyncWithHttpInfo($options) + { + $returnType = 'object'; + $request = $this->listWafUpdateStatusesRequest($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 'listWafUpdateStatuses' + * + * 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 int $page_number Current page. (optional) + * @param int $page_size Number of records per page. (optional, default to 20) + * @param string $include Include relationships. Optional, comma separated values. Permitted values: `waf`. (optional) + * @param string $service_id Alphanumeric string identifying the service. (required) + * @param string $firewall_id Alphanumeric string identifying a Firewall. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + * @deprecated + */ + public function listWafUpdateStatusesRequest($options) + { + // unbox the parameters from the associative array + $page_number = array_key_exists('page_number', $options) ? $options['page_number'] : null; + $page_size = array_key_exists('page_size', $options) ? $options['page_size'] : 20; + $include = array_key_exists('include', $options) ? $options['include'] : null; + $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null; + $firewall_id = array_key_exists('firewall_id', $options) ? $options['firewall_id'] : null; + + if ($page_size !== null && $page_size > 100) { + throw new \InvalidArgumentException('invalid value for "$page_size" when calling LegacyWafUpdateStatusApi.listWafUpdateStatuses, must be smaller than or equal to 100.'); + } + if ($page_size !== null && $page_size < 1) { + throw new \InvalidArgumentException('invalid value for "$page_size" when calling LegacyWafUpdateStatusApi.listWafUpdateStatuses, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'service_id' is set + if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $service_id when calling listWafUpdateStatuses' + ); + } + // verify the required parameter 'firewall_id' is set + if ($firewall_id === null || (is_array($firewall_id) && count($firewall_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $firewall_id when calling listWafUpdateStatuses' + ); + } + + $resourcePath = '/service/{service_id}/wafs/{firewall_id}/update_statuses'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($page_number !== null) { + if('form' === 'form' && is_array($page_number)) { + foreach($page_number as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['page[number]'] = ObjectSerializer::toString($page_number); + } + } + // query params + if ($page_size !== null) { + if('form' === 'form' && is_array($page_size)) { + foreach($page_size as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['page[size]'] = ObjectSerializer::toString($page_size); + } + } + // query params + if ($include !== null) { + if('form' === 'form' && is_array($include)) { + foreach($include as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['include'] = ObjectSerializer::toString($include); + } + } + + + // path params + if ($service_id !== null) { + $resourcePath = str_replace( + '{' . 'service_id' . '}', + ObjectSerializer::toPathValue($service_id), + $resourcePath + ); + } + // path params + if ($firewall_id !== null) { + $resourcePath = str_replace( + '{' . 'firewall_id' . '}', + ObjectSerializer::toPathValue($firewall_id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+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/LoggingKafkaApi.php b/lib/Api/LoggingKafkaApi.php index c6edd3f8..89dbc5ee 100644 --- a/lib/Api/LoggingKafkaApi.php +++ b/lib/Api/LoggingKafkaApi.php @@ -1707,6 +1707,368 @@ public function listLogKafkaRequest($options) ); } + /** + * Operation updateLogKafka + * + * Update the Kafka log endpoint + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param string $logging_kafka_name The name for the real-time logging configuration. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Fastly\Model\LoggingKafkaResponse + */ + public function updateLogKafka($options) + { + list($response) = $this->updateLogKafkaWithHttpInfo($options); + return $response; + } + + /** + * Operation updateLogKafkaWithHttpInfo + * + * Update the Kafka log endpoint + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param string $logging_kafka_name The name for the real-time logging configuration. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Fastly\Model\LoggingKafkaResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updateLogKafkaWithHttpInfo($options) + { + $request = $this->updateLogKafkaRequest($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 ('PUT' != 'GET' && 'PUT' != '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\LoggingKafkaResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\LoggingKafkaResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Fastly\Model\LoggingKafkaResponse'; + 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\LoggingKafkaResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateLogKafkaAsync + * + * Update the Kafka log endpoint + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param string $logging_kafka_name The name for the real-time logging configuration. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateLogKafkaAsync($options) + { + return $this->updateLogKafkaAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateLogKafkaAsyncWithHttpInfo + * + * Update the Kafka log endpoint + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param string $logging_kafka_name The name for the real-time logging configuration. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateLogKafkaAsyncWithHttpInfo($options) + { + $returnType = '\Fastly\Model\LoggingKafkaResponse'; + $request = $this->updateLogKafkaRequest($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 'updateLogKafka' + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param string $logging_kafka_name The name for the real-time logging configuration. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateLogKafkaRequest($options) + { + // unbox the parameters from the associative array + $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null; + $version_id = array_key_exists('version_id', $options) ? $options['version_id'] : null; + $logging_kafka_name = array_key_exists('logging_kafka_name', $options) ? $options['logging_kafka_name'] : null; + + // verify the required parameter 'service_id' is set + if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $service_id when calling updateLogKafka' + ); + } + // verify the required parameter 'version_id' is set + if ($version_id === null || (is_array($version_id) && count($version_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $version_id when calling updateLogKafka' + ); + } + // verify the required parameter 'logging_kafka_name' is set + if ($logging_kafka_name === null || (is_array($logging_kafka_name) && count($logging_kafka_name) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $logging_kafka_name when calling updateLogKafka' + ); + } + + $resourcePath = '/service/{service_id}/version/{version_id}/logging/kafka/{logging_kafka_name}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($service_id !== null) { + $resourcePath = str_replace( + '{' . 'service_id' . '}', + ObjectSerializer::toPathValue($service_id), + $resourcePath + ); + } + // path params + if ($version_id !== null) { + $resourcePath = str_replace( + '{' . 'version_id' . '}', + ObjectSerializer::toPathValue($version_id), + $resourcePath + ); + } + // path params + if ($logging_kafka_name !== null) { + $resourcePath = str_replace( + '{' . 'logging_kafka_name' . '}', + ObjectSerializer::toPathValue($logging_kafka_name), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/x-www-form-urlencoded'] + ); + } + + // 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( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Create http client option * diff --git a/lib/Api/LoggingKinesisApi.php b/lib/Api/LoggingKinesisApi.php index 3c013bb9..feda761b 100644 --- a/lib/Api/LoggingKinesisApi.php +++ b/lib/Api/LoggingKinesisApi.php @@ -1607,6 +1607,368 @@ public function listLogKinesisRequest($options) ); } + /** + * Operation updateLogKinesis + * + * Update the Amazon Kinesis log endpoint + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param string $logging_kinesis_name The name for the real-time logging configuration. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Fastly\Model\LoggingKinesisResponse + */ + public function updateLogKinesis($options) + { + list($response) = $this->updateLogKinesisWithHttpInfo($options); + return $response; + } + + /** + * Operation updateLogKinesisWithHttpInfo + * + * Update the Amazon Kinesis log endpoint + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param string $logging_kinesis_name The name for the real-time logging configuration. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Fastly\Model\LoggingKinesisResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updateLogKinesisWithHttpInfo($options) + { + $request = $this->updateLogKinesisRequest($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 ('PUT' != 'GET' && 'PUT' != '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\LoggingKinesisResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\LoggingKinesisResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Fastly\Model\LoggingKinesisResponse'; + 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\LoggingKinesisResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateLogKinesisAsync + * + * Update the Amazon Kinesis log endpoint + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param string $logging_kinesis_name The name for the real-time logging configuration. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateLogKinesisAsync($options) + { + return $this->updateLogKinesisAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateLogKinesisAsyncWithHttpInfo + * + * Update the Amazon Kinesis log endpoint + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param string $logging_kinesis_name The name for the real-time logging configuration. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateLogKinesisAsyncWithHttpInfo($options) + { + $returnType = '\Fastly\Model\LoggingKinesisResponse'; + $request = $this->updateLogKinesisRequest($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 'updateLogKinesis' + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param string $logging_kinesis_name The name for the real-time logging configuration. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateLogKinesisRequest($options) + { + // unbox the parameters from the associative array + $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null; + $version_id = array_key_exists('version_id', $options) ? $options['version_id'] : null; + $logging_kinesis_name = array_key_exists('logging_kinesis_name', $options) ? $options['logging_kinesis_name'] : null; + + // verify the required parameter 'service_id' is set + if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $service_id when calling updateLogKinesis' + ); + } + // verify the required parameter 'version_id' is set + if ($version_id === null || (is_array($version_id) && count($version_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $version_id when calling updateLogKinesis' + ); + } + // verify the required parameter 'logging_kinesis_name' is set + if ($logging_kinesis_name === null || (is_array($logging_kinesis_name) && count($logging_kinesis_name) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $logging_kinesis_name when calling updateLogKinesis' + ); + } + + $resourcePath = '/service/{service_id}/version/{version_id}/logging/kinesis/{logging_kinesis_name}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($service_id !== null) { + $resourcePath = str_replace( + '{' . 'service_id' . '}', + ObjectSerializer::toPathValue($service_id), + $resourcePath + ); + } + // path params + if ($version_id !== null) { + $resourcePath = str_replace( + '{' . 'version_id' . '}', + ObjectSerializer::toPathValue($version_id), + $resourcePath + ); + } + // path params + if ($logging_kinesis_name !== null) { + $resourcePath = str_replace( + '{' . 'logging_kinesis_name' . '}', + ObjectSerializer::toPathValue($logging_kinesis_name), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/x-www-form-urlencoded'] + ); + } + + // 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( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Create http client option * diff --git a/lib/Api/OriginInspectorHistoricalApi.php b/lib/Api/OriginInspectorHistoricalApi.php new file mode 100644 index 00000000..4b015fb2 --- /dev/null +++ b/lib/Api/OriginInspectorHistoricalApi.php @@ -0,0 +1,614 @@ +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 getOriginInspectorHistorical + * + * Get historical origin data for a service + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $start A valid ISO-8601-formatted date and time, or UNIX timestamp, indicating the inclusive start of the query time range. If not provided, a default is chosen based on the provided `downsample` value. (optional) + * @param string $end A valid ISO-8601-formatted date and time, or UNIX timestamp, indicating the exclusive end of the query time range. If not provided, a default is chosen based on the provided `downsample` value. (optional) + * @param string $downsample Duration of sample windows. (optional, default to 'hour') + * @param string $metric The metric to retrieve. Up to ten comma-separated metrics are accepted. (optional, default to 'responses') + * @param string $group_by Dimensions to return in the query. Multiple dimensions may be separated by commas. For example, `group_by=host` will return one timeseries for every origin host, as a total across all POPs. (optional) + * @param string $limit Number of results per page. The maximum is 200. (optional, default to '100') + * @param string $cursor Cursor value from a previous response to retrieve the next page. To request the first page, this should be empty. (optional) + * @param string $region Limit query to one or more specific geographic regions. Values should be comma-separated. (optional) + * @param string $datacenter Limit query to one or more specific POPs. Values should be comma-separated. (optional) + * @param string $host Limit query to one or more specific origin hosts. Values should be comma-separated. (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Fastly\Model\HistoricalOriginsResponse + */ + public function getOriginInspectorHistorical($options) + { + list($response) = $this->getOriginInspectorHistoricalWithHttpInfo($options); + return $response; + } + + /** + * Operation getOriginInspectorHistoricalWithHttpInfo + * + * Get historical origin data for a service + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $start A valid ISO-8601-formatted date and time, or UNIX timestamp, indicating the inclusive start of the query time range. If not provided, a default is chosen based on the provided `downsample` value. (optional) + * @param string $end A valid ISO-8601-formatted date and time, or UNIX timestamp, indicating the exclusive end of the query time range. If not provided, a default is chosen based on the provided `downsample` value. (optional) + * @param string $downsample Duration of sample windows. (optional, default to 'hour') + * @param string $metric The metric to retrieve. Up to ten comma-separated metrics are accepted. (optional, default to 'responses') + * @param string $group_by Dimensions to return in the query. Multiple dimensions may be separated by commas. For example, `group_by=host` will return one timeseries for every origin host, as a total across all POPs. (optional) + * @param string $limit Number of results per page. The maximum is 200. (optional, default to '100') + * @param string $cursor Cursor value from a previous response to retrieve the next page. To request the first page, this should be empty. (optional) + * @param string $region Limit query to one or more specific geographic regions. Values should be comma-separated. (optional) + * @param string $datacenter Limit query to one or more specific POPs. Values should be comma-separated. (optional) + * @param string $host Limit query to one or more specific origin hosts. Values should be comma-separated. (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Fastly\Model\HistoricalOriginsResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getOriginInspectorHistoricalWithHttpInfo($options) + { + $request = $this->getOriginInspectorHistoricalRequest($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\HistoricalOriginsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\HistoricalOriginsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Fastly\Model\HistoricalOriginsResponse'; + 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\HistoricalOriginsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getOriginInspectorHistoricalAsync + * + * Get historical origin data for a service + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $start A valid ISO-8601-formatted date and time, or UNIX timestamp, indicating the inclusive start of the query time range. If not provided, a default is chosen based on the provided `downsample` value. (optional) + * @param string $end A valid ISO-8601-formatted date and time, or UNIX timestamp, indicating the exclusive end of the query time range. If not provided, a default is chosen based on the provided `downsample` value. (optional) + * @param string $downsample Duration of sample windows. (optional, default to 'hour') + * @param string $metric The metric to retrieve. Up to ten comma-separated metrics are accepted. (optional, default to 'responses') + * @param string $group_by Dimensions to return in the query. Multiple dimensions may be separated by commas. For example, `group_by=host` will return one timeseries for every origin host, as a total across all POPs. (optional) + * @param string $limit Number of results per page. The maximum is 200. (optional, default to '100') + * @param string $cursor Cursor value from a previous response to retrieve the next page. To request the first page, this should be empty. (optional) + * @param string $region Limit query to one or more specific geographic regions. Values should be comma-separated. (optional) + * @param string $datacenter Limit query to one or more specific POPs. Values should be comma-separated. (optional) + * @param string $host Limit query to one or more specific origin hosts. Values should be comma-separated. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOriginInspectorHistoricalAsync($options) + { + return $this->getOriginInspectorHistoricalAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOriginInspectorHistoricalAsyncWithHttpInfo + * + * Get historical origin data for a service + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $start A valid ISO-8601-formatted date and time, or UNIX timestamp, indicating the inclusive start of the query time range. If not provided, a default is chosen based on the provided `downsample` value. (optional) + * @param string $end A valid ISO-8601-formatted date and time, or UNIX timestamp, indicating the exclusive end of the query time range. If not provided, a default is chosen based on the provided `downsample` value. (optional) + * @param string $downsample Duration of sample windows. (optional, default to 'hour') + * @param string $metric The metric to retrieve. Up to ten comma-separated metrics are accepted. (optional, default to 'responses') + * @param string $group_by Dimensions to return in the query. Multiple dimensions may be separated by commas. For example, `group_by=host` will return one timeseries for every origin host, as a total across all POPs. (optional) + * @param string $limit Number of results per page. The maximum is 200. (optional, default to '100') + * @param string $cursor Cursor value from a previous response to retrieve the next page. To request the first page, this should be empty. (optional) + * @param string $region Limit query to one or more specific geographic regions. Values should be comma-separated. (optional) + * @param string $datacenter Limit query to one or more specific POPs. Values should be comma-separated. (optional) + * @param string $host Limit query to one or more specific origin hosts. Values should be comma-separated. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOriginInspectorHistoricalAsyncWithHttpInfo($options) + { + $returnType = '\Fastly\Model\HistoricalOriginsResponse'; + $request = $this->getOriginInspectorHistoricalRequest($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 'getOriginInspectorHistorical' + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param string $start A valid ISO-8601-formatted date and time, or UNIX timestamp, indicating the inclusive start of the query time range. If not provided, a default is chosen based on the provided `downsample` value. (optional) + * @param string $end A valid ISO-8601-formatted date and time, or UNIX timestamp, indicating the exclusive end of the query time range. If not provided, a default is chosen based on the provided `downsample` value. (optional) + * @param string $downsample Duration of sample windows. (optional, default to 'hour') + * @param string $metric The metric to retrieve. Up to ten comma-separated metrics are accepted. (optional, default to 'responses') + * @param string $group_by Dimensions to return in the query. Multiple dimensions may be separated by commas. For example, `group_by=host` will return one timeseries for every origin host, as a total across all POPs. (optional) + * @param string $limit Number of results per page. The maximum is 200. (optional, default to '100') + * @param string $cursor Cursor value from a previous response to retrieve the next page. To request the first page, this should be empty. (optional) + * @param string $region Limit query to one or more specific geographic regions. Values should be comma-separated. (optional) + * @param string $datacenter Limit query to one or more specific POPs. Values should be comma-separated. (optional) + * @param string $host Limit query to one or more specific origin hosts. Values should be comma-separated. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getOriginInspectorHistoricalRequest($options) + { + // unbox the parameters from the associative array + $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null; + $start = array_key_exists('start', $options) ? $options['start'] : null; + $end = array_key_exists('end', $options) ? $options['end'] : null; + $downsample = array_key_exists('downsample', $options) ? $options['downsample'] : 'hour'; + $metric = array_key_exists('metric', $options) ? $options['metric'] : 'responses'; + $group_by = array_key_exists('group_by', $options) ? $options['group_by'] : null; + $limit = array_key_exists('limit', $options) ? $options['limit'] : '100'; + $cursor = array_key_exists('cursor', $options) ? $options['cursor'] : null; + $region = array_key_exists('region', $options) ? $options['region'] : null; + $datacenter = array_key_exists('datacenter', $options) ? $options['datacenter'] : null; + $host = array_key_exists('host', $options) ? $options['host'] : null; + + // verify the required parameter 'service_id' is set + if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $service_id when calling getOriginInspectorHistorical' + ); + } + + $resourcePath = '/metrics/origins/services/{service_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($start !== null) { + if('form' === 'form' && is_array($start)) { + foreach($start as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['start'] = ObjectSerializer::toString($start); + } + } + // query params + if ($end !== null) { + if('form' === 'form' && is_array($end)) { + foreach($end as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['end'] = ObjectSerializer::toString($end); + } + } + // query params + if ($downsample !== null) { + if('form' === 'form' && is_array($downsample)) { + foreach($downsample as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['downsample'] = ObjectSerializer::toString($downsample); + } + } + // query params + if ($metric !== null) { + if('form' === 'form' && is_array($metric)) { + foreach($metric as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['metric'] = ObjectSerializer::toString($metric); + } + } + // query params + if ($group_by !== null) { + if('form' === 'form' && is_array($group_by)) { + foreach($group_by as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['group_by'] = ObjectSerializer::toString($group_by); + } + } + // 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); + } + } + // query params + if (is_array($region)) { + $region = ObjectSerializer::serializeCollection($region, 'form', true); + } + if ($region !== null) { + $queryParams['region'] = ObjectSerializer::toString($region); + } + // query params + if (is_array($datacenter)) { + $datacenter = ObjectSerializer::serializeCollection($datacenter, 'form', true); + } + if ($datacenter !== null) { + $queryParams['datacenter'] = ObjectSerializer::toString($datacenter); + } + // query params + if ($host !== null) { + if('form' === 'form' && is_array($host)) { + foreach($host as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['host'] = ObjectSerializer::toString($host); + } + } + + + // path params + if ($service_id !== null) { + $resourcePath = str_replace( + '{' . 'service_id' . '}', + ObjectSerializer::toPathValue($service_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/OriginInspectorRealtimeApi.php b/lib/Api/OriginInspectorRealtimeApi.php new file mode 100644 index 00000000..ca457f75 --- /dev/null +++ b/lib/Api/OriginInspectorRealtimeApi.php @@ -0,0 +1,1136 @@ +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 getOriginInspectorLast120Seconds + * + * Get real-time origin data for the last 120 seconds + * + * 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://rt.fastly.com + * + * @param string $service_id Alphanumeric string identifying the service. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Fastly\Model\OriginInspector + */ + public function getOriginInspectorLast120Seconds($options) + { + list($response) = $this->getOriginInspectorLast120SecondsWithHttpInfo($options); + return $response; + } + + /** + * Operation getOriginInspectorLast120SecondsWithHttpInfo + * + * Get real-time origin data for the last 120 seconds + * + * 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://rt.fastly.com + * + * @param string $service_id Alphanumeric string identifying the service. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Fastly\Model\OriginInspector, HTTP status code, HTTP response headers (array of strings) + */ + public function getOriginInspectorLast120SecondsWithHttpInfo($options) + { + $request = $this->getOriginInspectorLast120SecondsRequest($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\OriginInspector' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\OriginInspector', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Fastly\Model\OriginInspector'; + 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\OriginInspector', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getOriginInspectorLast120SecondsAsync + * + * Get real-time origin data for the last 120 seconds + * + * 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://rt.fastly.com + * + * @param string $service_id Alphanumeric string identifying the service. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOriginInspectorLast120SecondsAsync($options) + { + return $this->getOriginInspectorLast120SecondsAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOriginInspectorLast120SecondsAsyncWithHttpInfo + * + * Get real-time origin data for the last 120 seconds + * + * 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://rt.fastly.com + * + * @param string $service_id Alphanumeric string identifying the service. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOriginInspectorLast120SecondsAsyncWithHttpInfo($options) + { + $returnType = '\Fastly\Model\OriginInspector'; + $request = $this->getOriginInspectorLast120SecondsRequest($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 'getOriginInspectorLast120Seconds' + * + * 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://rt.fastly.com + * + * @param string $service_id Alphanumeric string identifying the service. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getOriginInspectorLast120SecondsRequest($options) + { + // unbox the parameters from the associative array + $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null; + + // verify the required parameter 'service_id' is set + if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $service_id when calling getOriginInspectorLast120Seconds' + ); + } + + $resourcePath = '/v1/origins/{service_id}/ts/h'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($service_id !== null) { + $resourcePath = str_replace( + '{' . 'service_id' . '}', + ObjectSerializer::toPathValue($service_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://rt.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 getOriginInspectorLastMaxEntries + * + * Get a limited number of real-time origin data entries + * + * 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://rt.fastly.com + * + * @param string $service_id Alphanumeric string identifying the service. (required) + * @param int $max_entries Maximum number of results to display. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Fastly\Model\OriginInspector + */ + public function getOriginInspectorLastMaxEntries($options) + { + list($response) = $this->getOriginInspectorLastMaxEntriesWithHttpInfo($options); + return $response; + } + + /** + * Operation getOriginInspectorLastMaxEntriesWithHttpInfo + * + * Get a limited number of real-time origin data entries + * + * 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://rt.fastly.com + * + * @param string $service_id Alphanumeric string identifying the service. (required) + * @param int $max_entries Maximum number of results to display. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Fastly\Model\OriginInspector, HTTP status code, HTTP response headers (array of strings) + */ + public function getOriginInspectorLastMaxEntriesWithHttpInfo($options) + { + $request = $this->getOriginInspectorLastMaxEntriesRequest($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\OriginInspector' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\OriginInspector', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Fastly\Model\OriginInspector'; + 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\OriginInspector', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getOriginInspectorLastMaxEntriesAsync + * + * Get a limited number of real-time origin data entries + * + * 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://rt.fastly.com + * + * @param string $service_id Alphanumeric string identifying the service. (required) + * @param int $max_entries Maximum number of results to display. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOriginInspectorLastMaxEntriesAsync($options) + { + return $this->getOriginInspectorLastMaxEntriesAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOriginInspectorLastMaxEntriesAsyncWithHttpInfo + * + * Get a limited number of real-time origin data entries + * + * 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://rt.fastly.com + * + * @param string $service_id Alphanumeric string identifying the service. (required) + * @param int $max_entries Maximum number of results to display. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOriginInspectorLastMaxEntriesAsyncWithHttpInfo($options) + { + $returnType = '\Fastly\Model\OriginInspector'; + $request = $this->getOriginInspectorLastMaxEntriesRequest($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 'getOriginInspectorLastMaxEntries' + * + * 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://rt.fastly.com + * + * @param string $service_id Alphanumeric string identifying the service. (required) + * @param int $max_entries Maximum number of results to display. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getOriginInspectorLastMaxEntriesRequest($options) + { + // unbox the parameters from the associative array + $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null; + $max_entries = array_key_exists('max_entries', $options) ? $options['max_entries'] : null; + + // verify the required parameter 'service_id' is set + if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $service_id when calling getOriginInspectorLastMaxEntries' + ); + } + // verify the required parameter 'max_entries' is set + if ($max_entries === null || (is_array($max_entries) && count($max_entries) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $max_entries when calling getOriginInspectorLastMaxEntries' + ); + } + + $resourcePath = '/v1/origins/{service_id}/ts/h/limit/{max_entries}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($service_id !== null) { + $resourcePath = str_replace( + '{' . 'service_id' . '}', + ObjectSerializer::toPathValue($service_id), + $resourcePath + ); + } + // path params + if ($max_entries !== null) { + $resourcePath = str_replace( + '{' . 'max_entries' . '}', + ObjectSerializer::toPathValue($max_entries), + $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://rt.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 getOriginInspectorLastSecond + * + * Get real-time origin data from specific time. + * + * 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://rt.fastly.com + * + * @param string $service_id Alphanumeric string identifying the service. (required) + * @param int $start_timestamp Timestamp in seconds (Unix epoch time). (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Fastly\Model\OriginInspector + */ + public function getOriginInspectorLastSecond($options) + { + list($response) = $this->getOriginInspectorLastSecondWithHttpInfo($options); + return $response; + } + + /** + * Operation getOriginInspectorLastSecondWithHttpInfo + * + * Get real-time origin data from specific time. + * + * 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://rt.fastly.com + * + * @param string $service_id Alphanumeric string identifying the service. (required) + * @param int $start_timestamp Timestamp in seconds (Unix epoch time). (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Fastly\Model\OriginInspector, HTTP status code, HTTP response headers (array of strings) + */ + public function getOriginInspectorLastSecondWithHttpInfo($options) + { + $request = $this->getOriginInspectorLastSecondRequest($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\OriginInspector' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\OriginInspector', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Fastly\Model\OriginInspector'; + 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\OriginInspector', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getOriginInspectorLastSecondAsync + * + * Get real-time origin data from specific time. + * + * 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://rt.fastly.com + * + * @param string $service_id Alphanumeric string identifying the service. (required) + * @param int $start_timestamp Timestamp in seconds (Unix epoch time). (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOriginInspectorLastSecondAsync($options) + { + return $this->getOriginInspectorLastSecondAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOriginInspectorLastSecondAsyncWithHttpInfo + * + * Get real-time origin data from specific time. + * + * 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://rt.fastly.com + * + * @param string $service_id Alphanumeric string identifying the service. (required) + * @param int $start_timestamp Timestamp in seconds (Unix epoch time). (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOriginInspectorLastSecondAsyncWithHttpInfo($options) + { + $returnType = '\Fastly\Model\OriginInspector'; + $request = $this->getOriginInspectorLastSecondRequest($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 'getOriginInspectorLastSecond' + * + * 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://rt.fastly.com + * + * @param string $service_id Alphanumeric string identifying the service. (required) + * @param int $start_timestamp Timestamp in seconds (Unix epoch time). (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getOriginInspectorLastSecondRequest($options) + { + // unbox the parameters from the associative array + $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null; + $start_timestamp = array_key_exists('start_timestamp', $options) ? $options['start_timestamp'] : null; + + // verify the required parameter 'service_id' is set + if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $service_id when calling getOriginInspectorLastSecond' + ); + } + // verify the required parameter 'start_timestamp' is set + if ($start_timestamp === null || (is_array($start_timestamp) && count($start_timestamp) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $start_timestamp when calling getOriginInspectorLastSecond' + ); + } + + $resourcePath = '/v1/origins/{service_id}/ts/{start_timestamp}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($service_id !== null) { + $resourcePath = str_replace( + '{' . 'service_id' . '}', + ObjectSerializer::toPathValue($service_id), + $resourcePath + ); + } + // path params + if ($start_timestamp !== null) { + $resourcePath = str_replace( + '{' . 'start_timestamp' . '}', + ObjectSerializer::toPathValue($start_timestamp), + $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://rt.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/RequestSettingsApi.php b/lib/Api/RequestSettingsApi.php index 70bd2b83..78d80fc5 100644 --- a/lib/Api/RequestSettingsApi.php +++ b/lib/Api/RequestSettingsApi.php @@ -109,6 +109,348 @@ public function getConfig() return $this->config; } + /** + * Operation createRequestSettings + * + * Create a Request Settings object + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Fastly\Model\RequestSettingsResponse + */ + public function createRequestSettings($options) + { + list($response) = $this->createRequestSettingsWithHttpInfo($options); + return $response; + } + + /** + * Operation createRequestSettingsWithHttpInfo + * + * Create a Request Settings object + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Fastly\Model\RequestSettingsResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function createRequestSettingsWithHttpInfo($options) + { + $request = $this->createRequestSettingsRequest($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\RequestSettingsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\RequestSettingsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Fastly\Model\RequestSettingsResponse'; + 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\RequestSettingsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createRequestSettingsAsync + * + * Create a Request Settings object + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createRequestSettingsAsync($options) + { + return $this->createRequestSettingsAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createRequestSettingsAsyncWithHttpInfo + * + * Create a Request Settings object + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createRequestSettingsAsyncWithHttpInfo($options) + { + $returnType = '\Fastly\Model\RequestSettingsResponse'; + $request = $this->createRequestSettingsRequest($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 'createRequestSettings' + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createRequestSettingsRequest($options) + { + // unbox the parameters from the associative array + $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null; + $version_id = array_key_exists('version_id', $options) ? $options['version_id'] : null; + + // verify the required parameter 'service_id' is set + if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $service_id when calling createRequestSettings' + ); + } + // verify the required parameter 'version_id' is set + if ($version_id === null || (is_array($version_id) && count($version_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $version_id when calling createRequestSettings' + ); + } + + $resourcePath = '/service/{service_id}/version/{version_id}/request_settings'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($service_id !== null) { + $resourcePath = str_replace( + '{' . 'service_id' . '}', + ObjectSerializer::toPathValue($service_id), + $resourcePath + ); + } + // path params + if ($version_id !== null) { + $resourcePath = str_replace( + '{' . 'version_id' . '}', + ObjectSerializer::toPathValue($version_id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/x-www-form-urlencoded'] + ); + } + + // 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( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation deleteRequestSettings * diff --git a/lib/Api/ResponseObjectApi.php b/lib/Api/ResponseObjectApi.php index 12299e10..49cc6fc9 100644 --- a/lib/Api/ResponseObjectApi.php +++ b/lib/Api/ResponseObjectApi.php @@ -109,10 +109,714 @@ public function getConfig() return $this->config; } + /** + * Operation createResponseObject + * + * Create a Response object + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Fastly\Model\ResponseObjectResponse + */ + public function createResponseObject($options) + { + list($response) = $this->createResponseObjectWithHttpInfo($options); + return $response; + } + + /** + * Operation createResponseObjectWithHttpInfo + * + * Create a Response object + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Fastly\Model\ResponseObjectResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function createResponseObjectWithHttpInfo($options) + { + $request = $this->createResponseObjectRequest($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\ResponseObjectResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\ResponseObjectResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Fastly\Model\ResponseObjectResponse'; + 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\ResponseObjectResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createResponseObjectAsync + * + * Create a Response object + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createResponseObjectAsync($options) + { + return $this->createResponseObjectAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createResponseObjectAsyncWithHttpInfo + * + * Create a Response object + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createResponseObjectAsyncWithHttpInfo($options) + { + $returnType = '\Fastly\Model\ResponseObjectResponse'; + $request = $this->createResponseObjectRequest($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 'createResponseObject' + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createResponseObjectRequest($options) + { + // unbox the parameters from the associative array + $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null; + $version_id = array_key_exists('version_id', $options) ? $options['version_id'] : null; + + // verify the required parameter 'service_id' is set + if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $service_id when calling createResponseObject' + ); + } + // verify the required parameter 'version_id' is set + if ($version_id === null || (is_array($version_id) && count($version_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $version_id when calling createResponseObject' + ); + } + + $resourcePath = '/service/{service_id}/version/{version_id}/response_object'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($service_id !== null) { + $resourcePath = str_replace( + '{' . 'service_id' . '}', + ObjectSerializer::toPathValue($service_id), + $resourcePath + ); + } + // path params + if ($version_id !== null) { + $resourcePath = str_replace( + '{' . 'version_id' . '}', + ObjectSerializer::toPathValue($version_id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/x-www-form-urlencoded'] + ); + } + + // 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( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation deleteResponseObject * - * Delete a Response Object + * Delete a Response Object + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param string $response_object_name Name for the request settings. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Fastly\Model\InlineResponse200 + */ + public function deleteResponseObject($options) + { + list($response) = $this->deleteResponseObjectWithHttpInfo($options); + return $response; + } + + /** + * Operation deleteResponseObjectWithHttpInfo + * + * Delete a Response Object + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param string $response_object_name Name for the request settings. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Fastly\Model\InlineResponse200, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteResponseObjectWithHttpInfo($options) + { + $request = $this->deleteResponseObjectRequest($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() + ); + } + + switch($statusCode) { + case 200: + if ('\Fastly\Model\InlineResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\InlineResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Fastly\Model\InlineResponse200'; + 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\InlineResponse200', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteResponseObjectAsync + * + * Delete a Response Object + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param string $response_object_name Name for the request settings. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteResponseObjectAsync($options) + { + return $this->deleteResponseObjectAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteResponseObjectAsyncWithHttpInfo + * + * Delete a Response Object + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param string $response_object_name Name for the request settings. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteResponseObjectAsyncWithHttpInfo($options) + { + $returnType = '\Fastly\Model\InlineResponse200'; + $request = $this->deleteResponseObjectRequest($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 'deleteResponseObject' + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param string $response_object_name Name for the request settings. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteResponseObjectRequest($options) + { + // unbox the parameters from the associative array + $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null; + $version_id = array_key_exists('version_id', $options) ? $options['version_id'] : null; + $response_object_name = array_key_exists('response_object_name', $options) ? $options['response_object_name'] : null; + + // verify the required parameter 'service_id' is set + if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $service_id when calling deleteResponseObject' + ); + } + // verify the required parameter 'version_id' is set + if ($version_id === null || (is_array($version_id) && count($version_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $version_id when calling deleteResponseObject' + ); + } + // verify the required parameter 'response_object_name' is set + if ($response_object_name === null || (is_array($response_object_name) && count($response_object_name) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $response_object_name when calling deleteResponseObject' + ); + } + + $resourcePath = '/service/{service_id}/version/{version_id}/response_object/{response_object_name}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($service_id !== null) { + $resourcePath = str_replace( + '{' . 'service_id' . '}', + ObjectSerializer::toPathValue($service_id), + $resourcePath + ); + } + // path params + if ($version_id !== null) { + $resourcePath = str_replace( + '{' . 'version_id' . '}', + ObjectSerializer::toPathValue($version_id), + $resourcePath + ); + } + // path params + if ($response_object_name !== null) { + $resourcePath = str_replace( + '{' . 'response_object_name' . '}', + ObjectSerializer::toPathValue($response_object_name), + $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( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getResponseObject + * + * Get a Response object * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -125,18 +829,18 @@ public function getConfig() * * @throws \Fastly\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Fastly\Model\InlineResponse200 + * @return \Fastly\Model\ResponseObjectResponse */ - public function deleteResponseObject($options) + public function getResponseObject($options) { - list($response) = $this->deleteResponseObjectWithHttpInfo($options); + list($response) = $this->getResponseObjectWithHttpInfo($options); return $response; } /** - * Operation deleteResponseObjectWithHttpInfo + * Operation getResponseObjectWithHttpInfo * - * Delete a Response Object + * Get a Response object * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -149,11 +853,11 @@ public function deleteResponseObject($options) * * @throws \Fastly\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Fastly\Model\InlineResponse200, HTTP status code, HTTP response headers (array of strings) + * @return array of \Fastly\Model\ResponseObjectResponse, HTTP status code, HTTP response headers (array of strings) */ - public function deleteResponseObjectWithHttpInfo($options) + public function getResponseObjectWithHttpInfo($options) { - $request = $this->deleteResponseObjectRequest($options); + $request = $this->getResponseObjectRequest($options); try { $options = $this->createHttpClientOption(); @@ -175,7 +879,7 @@ public function deleteResponseObjectWithHttpInfo($options) ); } - if ('DELETE' != 'GET' && 'DELETE' != 'HEAD') { + if ('GET' != 'GET' && 'GET' != 'HEAD') { $header = $response->getHeader('Fastly-RateLimit-Remaining'); if (count($header) > 0) { $this->config->setRateLimitRemaining($header[0]); @@ -204,20 +908,20 @@ public function deleteResponseObjectWithHttpInfo($options) switch($statusCode) { case 200: - if ('\Fastly\Model\InlineResponse200' === '\SplFileObject') { + if ('\Fastly\Model\ResponseObjectResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Fastly\Model\InlineResponse200', []), + ObjectSerializer::deserialize($content, '\Fastly\Model\ResponseObjectResponse', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Fastly\Model\InlineResponse200'; + $returnType = '\Fastly\Model\ResponseObjectResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -235,7 +939,7 @@ public function deleteResponseObjectWithHttpInfo($options) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Fastly\Model\InlineResponse200', + '\Fastly\Model\ResponseObjectResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -246,9 +950,9 @@ public function deleteResponseObjectWithHttpInfo($options) } /** - * Operation deleteResponseObjectAsync + * Operation getResponseObjectAsync * - * Delete a Response Object + * Get a Response object * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -262,9 +966,9 @@ public function deleteResponseObjectWithHttpInfo($options) * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteResponseObjectAsync($options) + public function getResponseObjectAsync($options) { - return $this->deleteResponseObjectAsyncWithHttpInfo($options) + return $this->getResponseObjectAsyncWithHttpInfo($options) ->then( function ($response) { return $response[0]; @@ -273,9 +977,9 @@ function ($response) { } /** - * Operation deleteResponseObjectAsyncWithHttpInfo + * Operation getResponseObjectAsyncWithHttpInfo * - * Delete a Response Object + * Get a Response object * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -289,10 +993,10 @@ function ($response) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteResponseObjectAsyncWithHttpInfo($options) + public function getResponseObjectAsyncWithHttpInfo($options) { - $returnType = '\Fastly\Model\InlineResponse200'; - $request = $this->deleteResponseObjectRequest($options); + $returnType = '\Fastly\Model\ResponseObjectResponse'; + $request = $this->getResponseObjectRequest($options); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -328,7 +1032,7 @@ function ($exception) { } /** - * Create request for operation 'deleteResponseObject' + * Create request for operation 'getResponseObject' * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -342,7 +1046,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteResponseObjectRequest($options) + public function getResponseObjectRequest($options) { // unbox the parameters from the associative array $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null; @@ -352,19 +1056,19 @@ public function deleteResponseObjectRequest($options) // verify the required parameter 'service_id' is set if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $service_id when calling deleteResponseObject' + 'Missing the required parameter $service_id when calling getResponseObject' ); } // verify the required parameter 'version_id' is set if ($version_id === null || (is_array($version_id) && count($version_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $version_id when calling deleteResponseObject' + 'Missing the required parameter $version_id when calling getResponseObject' ); } // verify the required parameter 'response_object_name' is set if ($response_object_name === null || (is_array($response_object_name) && count($response_object_name) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $response_object_name when calling deleteResponseObject' + 'Missing the required parameter $response_object_name when calling getResponseObject' ); } @@ -464,7 +1168,7 @@ public function deleteResponseObjectRequest($options) $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( - 'DELETE', + 'GET', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -472,9 +1176,9 @@ public function deleteResponseObjectRequest($options) } /** - * Operation getResponseObject + * Operation listResponseObjects * - * Get a Response object + * List Response objects * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -483,22 +1187,21 @@ public function deleteResponseObjectRequest($options) * * @param string $service_id Alphanumeric string identifying the service. (required) * @param int $version_id Integer identifying a service version. (required) - * @param string $response_object_name Name for the request settings. (required) * * @throws \Fastly\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Fastly\Model\ResponseObjectResponse + * @return \Fastly\Model\ResponseObjectResponse[] */ - public function getResponseObject($options) + public function listResponseObjects($options) { - list($response) = $this->getResponseObjectWithHttpInfo($options); + list($response) = $this->listResponseObjectsWithHttpInfo($options); return $response; } /** - * Operation getResponseObjectWithHttpInfo + * Operation listResponseObjectsWithHttpInfo * - * Get a Response object + * List Response objects * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -507,15 +1210,14 @@ public function getResponseObject($options) * * @param string $service_id Alphanumeric string identifying the service. (required) * @param int $version_id Integer identifying a service version. (required) - * @param string $response_object_name Name for the request settings. (required) * * @throws \Fastly\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Fastly\Model\ResponseObjectResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \Fastly\Model\ResponseObjectResponse[], HTTP status code, HTTP response headers (array of strings) */ - public function getResponseObjectWithHttpInfo($options) + public function listResponseObjectsWithHttpInfo($options) { - $request = $this->getResponseObjectRequest($options); + $request = $this->listResponseObjectsRequest($options); try { $options = $this->createHttpClientOption(); @@ -566,20 +1268,20 @@ public function getResponseObjectWithHttpInfo($options) switch($statusCode) { case 200: - if ('\Fastly\Model\ResponseObjectResponse' === '\SplFileObject') { + if ('\Fastly\Model\ResponseObjectResponse[]' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Fastly\Model\ResponseObjectResponse', []), + ObjectSerializer::deserialize($content, '\Fastly\Model\ResponseObjectResponse[]', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Fastly\Model\ResponseObjectResponse'; + $returnType = '\Fastly\Model\ResponseObjectResponse[]'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -597,7 +1299,7 @@ public function getResponseObjectWithHttpInfo($options) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Fastly\Model\ResponseObjectResponse', + '\Fastly\Model\ResponseObjectResponse[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -608,9 +1310,9 @@ public function getResponseObjectWithHttpInfo($options) } /** - * Operation getResponseObjectAsync + * Operation listResponseObjectsAsync * - * Get a Response object + * List Response objects * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -619,14 +1321,13 @@ public function getResponseObjectWithHttpInfo($options) * * @param string $service_id Alphanumeric string identifying the service. (required) * @param int $version_id Integer identifying a service version. (required) - * @param string $response_object_name Name for the request settings. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getResponseObjectAsync($options) + public function listResponseObjectsAsync($options) { - return $this->getResponseObjectAsyncWithHttpInfo($options) + return $this->listResponseObjectsAsyncWithHttpInfo($options) ->then( function ($response) { return $response[0]; @@ -635,9 +1336,9 @@ function ($response) { } /** - * Operation getResponseObjectAsyncWithHttpInfo + * Operation listResponseObjectsAsyncWithHttpInfo * - * Get a Response object + * List Response objects * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -646,15 +1347,14 @@ function ($response) { * * @param string $service_id Alphanumeric string identifying the service. (required) * @param int $version_id Integer identifying a service version. (required) - * @param string $response_object_name Name for the request settings. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getResponseObjectAsyncWithHttpInfo($options) + public function listResponseObjectsAsyncWithHttpInfo($options) { - $returnType = '\Fastly\Model\ResponseObjectResponse'; - $request = $this->getResponseObjectRequest($options); + $returnType = '\Fastly\Model\ResponseObjectResponse[]'; + $request = $this->listResponseObjectsRequest($options); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -690,7 +1390,7 @@ function ($exception) { } /** - * Create request for operation 'getResponseObject' + * Create request for operation 'listResponseObjects' * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -699,38 +1399,30 @@ function ($exception) { * * @param string $service_id Alphanumeric string identifying the service. (required) * @param int $version_id Integer identifying a service version. (required) - * @param string $response_object_name Name for the request settings. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getResponseObjectRequest($options) + public function listResponseObjectsRequest($options) { // unbox the parameters from the associative array $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null; $version_id = array_key_exists('version_id', $options) ? $options['version_id'] : null; - $response_object_name = array_key_exists('response_object_name', $options) ? $options['response_object_name'] : null; // verify the required parameter 'service_id' is set if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $service_id when calling getResponseObject' + 'Missing the required parameter $service_id when calling listResponseObjects' ); } // verify the required parameter 'version_id' is set if ($version_id === null || (is_array($version_id) && count($version_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $version_id when calling getResponseObject' - ); - } - // verify the required parameter 'response_object_name' is set - if ($response_object_name === null || (is_array($response_object_name) && count($response_object_name) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $response_object_name when calling getResponseObject' + 'Missing the required parameter $version_id when calling listResponseObjects' ); } - $resourcePath = '/service/{service_id}/version/{version_id}/response_object/{response_object_name}'; + $resourcePath = '/service/{service_id}/version/{version_id}/response_object'; $formParams = []; $queryParams = []; $headerParams = []; @@ -755,14 +1447,6 @@ public function getResponseObjectRequest($options) $resourcePath ); } - // path params - if ($response_object_name !== null) { - $resourcePath = str_replace( - '{' . 'response_object_name' . '}', - ObjectSerializer::toPathValue($response_object_name), - $resourcePath - ); - } if ($multipart) { @@ -834,9 +1518,9 @@ public function getResponseObjectRequest($options) } /** - * Operation listResponseObjects + * Operation updateResponseObject * - * List Response objects + * Update a Response object * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -845,21 +1529,22 @@ public function getResponseObjectRequest($options) * * @param string $service_id Alphanumeric string identifying the service. (required) * @param int $version_id Integer identifying a service version. (required) + * @param string $response_object_name Name for the request settings. (required) * * @throws \Fastly\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Fastly\Model\ResponseObjectResponse[] + * @return \Fastly\Model\ResponseObjectResponse */ - public function listResponseObjects($options) + public function updateResponseObject($options) { - list($response) = $this->listResponseObjectsWithHttpInfo($options); + list($response) = $this->updateResponseObjectWithHttpInfo($options); return $response; } /** - * Operation listResponseObjectsWithHttpInfo + * Operation updateResponseObjectWithHttpInfo * - * List Response objects + * Update a Response object * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -868,14 +1553,15 @@ public function listResponseObjects($options) * * @param string $service_id Alphanumeric string identifying the service. (required) * @param int $version_id Integer identifying a service version. (required) + * @param string $response_object_name Name for the request settings. (required) * * @throws \Fastly\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Fastly\Model\ResponseObjectResponse[], HTTP status code, HTTP response headers (array of strings) + * @return array of \Fastly\Model\ResponseObjectResponse, HTTP status code, HTTP response headers (array of strings) */ - public function listResponseObjectsWithHttpInfo($options) + public function updateResponseObjectWithHttpInfo($options) { - $request = $this->listResponseObjectsRequest($options); + $request = $this->updateResponseObjectRequest($options); try { $options = $this->createHttpClientOption(); @@ -897,7 +1583,7 @@ public function listResponseObjectsWithHttpInfo($options) ); } - if ('GET' != 'GET' && 'GET' != 'HEAD') { + if ('PUT' != 'GET' && 'PUT' != 'HEAD') { $header = $response->getHeader('Fastly-RateLimit-Remaining'); if (count($header) > 0) { $this->config->setRateLimitRemaining($header[0]); @@ -926,20 +1612,20 @@ public function listResponseObjectsWithHttpInfo($options) switch($statusCode) { case 200: - if ('\Fastly\Model\ResponseObjectResponse[]' === '\SplFileObject') { + if ('\Fastly\Model\ResponseObjectResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Fastly\Model\ResponseObjectResponse[]', []), + ObjectSerializer::deserialize($content, '\Fastly\Model\ResponseObjectResponse', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Fastly\Model\ResponseObjectResponse[]'; + $returnType = '\Fastly\Model\ResponseObjectResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -957,7 +1643,7 @@ public function listResponseObjectsWithHttpInfo($options) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Fastly\Model\ResponseObjectResponse[]', + '\Fastly\Model\ResponseObjectResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -968,9 +1654,9 @@ public function listResponseObjectsWithHttpInfo($options) } /** - * Operation listResponseObjectsAsync + * Operation updateResponseObjectAsync * - * List Response objects + * Update a Response object * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -979,13 +1665,14 @@ public function listResponseObjectsWithHttpInfo($options) * * @param string $service_id Alphanumeric string identifying the service. (required) * @param int $version_id Integer identifying a service version. (required) + * @param string $response_object_name Name for the request settings. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listResponseObjectsAsync($options) + public function updateResponseObjectAsync($options) { - return $this->listResponseObjectsAsyncWithHttpInfo($options) + return $this->updateResponseObjectAsyncWithHttpInfo($options) ->then( function ($response) { return $response[0]; @@ -994,9 +1681,9 @@ function ($response) { } /** - * Operation listResponseObjectsAsyncWithHttpInfo + * Operation updateResponseObjectAsyncWithHttpInfo * - * List Response objects + * Update a Response object * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -1005,14 +1692,15 @@ function ($response) { * * @param string $service_id Alphanumeric string identifying the service. (required) * @param int $version_id Integer identifying a service version. (required) + * @param string $response_object_name Name for the request settings. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listResponseObjectsAsyncWithHttpInfo($options) + public function updateResponseObjectAsyncWithHttpInfo($options) { - $returnType = '\Fastly\Model\ResponseObjectResponse[]'; - $request = $this->listResponseObjectsRequest($options); + $returnType = '\Fastly\Model\ResponseObjectResponse'; + $request = $this->updateResponseObjectRequest($options); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1048,7 +1736,7 @@ function ($exception) { } /** - * Create request for operation 'listResponseObjects' + * Create request for operation 'updateResponseObject' * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -1057,30 +1745,38 @@ function ($exception) { * * @param string $service_id Alphanumeric string identifying the service. (required) * @param int $version_id Integer identifying a service version. (required) + * @param string $response_object_name Name for the request settings. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function listResponseObjectsRequest($options) + public function updateResponseObjectRequest($options) { // unbox the parameters from the associative array $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null; $version_id = array_key_exists('version_id', $options) ? $options['version_id'] : null; + $response_object_name = array_key_exists('response_object_name', $options) ? $options['response_object_name'] : null; // verify the required parameter 'service_id' is set if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $service_id when calling listResponseObjects' + 'Missing the required parameter $service_id when calling updateResponseObject' ); } // verify the required parameter 'version_id' is set if ($version_id === null || (is_array($version_id) && count($version_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $version_id when calling listResponseObjects' + 'Missing the required parameter $version_id when calling updateResponseObject' + ); + } + // verify the required parameter 'response_object_name' is set + if ($response_object_name === null || (is_array($response_object_name) && count($response_object_name) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $response_object_name when calling updateResponseObject' ); } - $resourcePath = '/service/{service_id}/version/{version_id}/response_object'; + $resourcePath = '/service/{service_id}/version/{version_id}/response_object/{response_object_name}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1105,6 +1801,14 @@ public function listResponseObjectsRequest($options) $resourcePath ); } + // path params + if ($response_object_name !== null) { + $resourcePath = str_replace( + '{' . 'response_object_name' . '}', + ObjectSerializer::toPathValue($response_object_name), + $resourcePath + ); + } if ($multipart) { @@ -1114,7 +1818,7 @@ public function listResponseObjectsRequest($options) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - [] + ['application/x-www-form-urlencoded'] ); } @@ -1168,7 +1872,7 @@ public function listResponseObjectsRequest($options) $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( - 'GET', + 'PUT', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody diff --git a/lib/Api/SecretStoreApi.php b/lib/Api/SecretStoreApi.php new file mode 100644 index 00000000..683cdbc3 --- /dev/null +++ b/lib/Api/SecretStoreApi.php @@ -0,0 +1,1983 @@ +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 clientKey + * + * Create new client key + * + * 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\ClientKey + */ + public function clientKey($options) + { + list($response) = $this->clientKeyWithHttpInfo($options); + return $response; + } + + /** + * Operation clientKeyWithHttpInfo + * + * Create new client key + * + * 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\ClientKey, HTTP status code, HTTP response headers (array of strings) + */ + public function clientKeyWithHttpInfo($options) + { + $request = $this->clientKeyRequest($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\ClientKey' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\ClientKey', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Fastly\Model\ClientKey'; + 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\ClientKey', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation clientKeyAsync + * + * Create new client key + * + * 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 clientKeyAsync($options) + { + return $this->clientKeyAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation clientKeyAsyncWithHttpInfo + * + * Create new client key + * + * 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 clientKeyAsyncWithHttpInfo($options) + { + $returnType = '\Fastly\Model\ClientKey'; + $request = $this->clientKeyRequest($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 'clientKey' + * + * 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 clientKeyRequest($options) + { + // unbox the parameters from the associative array + + + $resourcePath = '/resources/stores/secret/client-key'; + $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( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createSecretStore + * + * Create new secret store + * + * 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\SecretStore $secret_store secret_store (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Fastly\Model\SecretStoreResponse + */ + public function createSecretStore($options) + { + list($response) = $this->createSecretStoreWithHttpInfo($options); + return $response; + } + + /** + * Operation createSecretStoreWithHttpInfo + * + * Create new secret store + * + * 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\SecretStore $secret_store (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Fastly\Model\SecretStoreResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function createSecretStoreWithHttpInfo($options) + { + $request = $this->createSecretStoreRequest($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 201: + if ('\Fastly\Model\SecretStoreResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\SecretStoreResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Fastly\Model\SecretStoreResponse'; + 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 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Fastly\Model\SecretStoreResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createSecretStoreAsync + * + * Create new secret store + * + * 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\SecretStore $secret_store (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createSecretStoreAsync($options) + { + return $this->createSecretStoreAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createSecretStoreAsyncWithHttpInfo + * + * Create new secret store + * + * 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\SecretStore $secret_store (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createSecretStoreAsyncWithHttpInfo($options) + { + $returnType = '\Fastly\Model\SecretStoreResponse'; + $request = $this->createSecretStoreRequest($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 'createSecretStore' + * + * 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\SecretStore $secret_store (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createSecretStoreRequest($options) + { + // unbox the parameters from the associative array + $secret_store = array_key_exists('secret_store', $options) ? $options['secret_store'] : null; + + + $resourcePath = '/resources/stores/secret'; + $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($secret_store)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($secret_store)); + } else { + $httpBody = $secret_store; + } + } 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 deleteSecretStore + * + * Delete secret store + * + * 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 $store_id store_id (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function deleteSecretStore($options) + { + $this->deleteSecretStoreWithHttpInfo($options); + } + + /** + * Operation deleteSecretStoreWithHttpInfo + * + * Delete secret store + * + * 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 $store_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 deleteSecretStoreWithHttpInfo($options) + { + $request = $this->deleteSecretStoreRequest($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 deleteSecretStoreAsync + * + * Delete secret store + * + * 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 $store_id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteSecretStoreAsync($options) + { + return $this->deleteSecretStoreAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteSecretStoreAsyncWithHttpInfo + * + * Delete secret store + * + * 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 $store_id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteSecretStoreAsyncWithHttpInfo($options) + { + $returnType = ''; + $request = $this->deleteSecretStoreRequest($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 'deleteSecretStore' + * + * 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 $store_id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteSecretStoreRequest($options) + { + // unbox the parameters from the associative array + $store_id = array_key_exists('store_id', $options) ? $options['store_id'] : null; + + // verify the required parameter 'store_id' is set + if ($store_id === null || (is_array($store_id) && count($store_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $store_id when calling deleteSecretStore' + ); + } + + $resourcePath = '/resources/stores/secret/{store_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($store_id !== null) { + $resourcePath = str_replace( + '{' . 'store_id' . '}', + ObjectSerializer::toPathValue($store_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 getSecretStore + * + * Create secret store 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 $store_id store_id (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Fastly\Model\SecretStoreResponse + */ + public function getSecretStore($options) + { + list($response) = $this->getSecretStoreWithHttpInfo($options); + return $response; + } + + /** + * Operation getSecretStoreWithHttpInfo + * + * Create secret store 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 $store_id (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Fastly\Model\SecretStoreResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getSecretStoreWithHttpInfo($options) + { + $request = $this->getSecretStoreRequest($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\SecretStoreResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\SecretStoreResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Fastly\Model\SecretStoreResponse'; + 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\SecretStoreResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getSecretStoreAsync + * + * Create secret store 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 $store_id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSecretStoreAsync($options) + { + return $this->getSecretStoreAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getSecretStoreAsyncWithHttpInfo + * + * Create secret store 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 $store_id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSecretStoreAsyncWithHttpInfo($options) + { + $returnType = '\Fastly\Model\SecretStoreResponse'; + $request = $this->getSecretStoreRequest($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 'getSecretStore' + * + * 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 $store_id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getSecretStoreRequest($options) + { + // unbox the parameters from the associative array + $store_id = array_key_exists('store_id', $options) ? $options['store_id'] : null; + + // verify the required parameter 'store_id' is set + if ($store_id === null || (is_array($store_id) && count($store_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $store_id when calling getSecretStore' + ); + } + + $resourcePath = '/resources/stores/secret/{store_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($store_id !== null) { + $resourcePath = str_replace( + '{' . 'store_id' . '}', + ObjectSerializer::toPathValue($store_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 getSecretStores + * + * Get all secret stores + * + * 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 $cursor Cursor value from a previous response to retrieve the next page. To request the first page, this should be empty. (optional) + * @param string $limit Number of results per page. The maximum is 200. (optional, default to '100') + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Fastly\Model\InlineResponse2005 + */ + public function getSecretStores($options) + { + list($response) = $this->getSecretStoresWithHttpInfo($options); + return $response; + } + + /** + * Operation getSecretStoresWithHttpInfo + * + * Get all secret stores + * + * 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 $cursor Cursor value from a previous response to retrieve the next page. To request the first page, this should be empty. (optional) + * @param string $limit Number of results per page. The maximum is 200. (optional, default to '100') + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Fastly\Model\InlineResponse2005, HTTP status code, HTTP response headers (array of strings) + */ + public function getSecretStoresWithHttpInfo($options) + { + $request = $this->getSecretStoresRequest($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\InlineResponse2005' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\InlineResponse2005', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Fastly\Model\InlineResponse2005'; + 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\InlineResponse2005', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getSecretStoresAsync + * + * Get all secret stores + * + * 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 $cursor Cursor value from a previous response to retrieve the next page. To request the first page, this should be empty. (optional) + * @param string $limit Number of results per page. The maximum is 200. (optional, default to '100') + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSecretStoresAsync($options) + { + return $this->getSecretStoresAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getSecretStoresAsyncWithHttpInfo + * + * Get all secret stores + * + * 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 $cursor Cursor value from a previous response to retrieve the next page. To request the first page, this should be empty. (optional) + * @param string $limit Number of results per page. The maximum is 200. (optional, default to '100') + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSecretStoresAsyncWithHttpInfo($options) + { + $returnType = '\Fastly\Model\InlineResponse2005'; + $request = $this->getSecretStoresRequest($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 'getSecretStores' + * + * 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 $cursor Cursor value from a previous response to retrieve the next page. To request the first page, this should be empty. (optional) + * @param string $limit Number of results per page. The maximum is 200. (optional, default to '100') + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getSecretStoresRequest($options) + { + // unbox the parameters from the associative array + $cursor = array_key_exists('cursor', $options) ? $options['cursor'] : null; + $limit = array_key_exists('limit', $options) ? $options['limit'] : '100'; + + + $resourcePath = '/resources/stores/secret'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // 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); + } + } + // 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); + } + } + + + + + 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 signingKey + * + * Get public key + * + * 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\SigningKey + */ + public function signingKey($options) + { + list($response) = $this->signingKeyWithHttpInfo($options); + return $response; + } + + /** + * Operation signingKeyWithHttpInfo + * + * Get public key + * + * 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\SigningKey, HTTP status code, HTTP response headers (array of strings) + */ + public function signingKeyWithHttpInfo($options) + { + $request = $this->signingKeyRequest($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\SigningKey' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\SigningKey', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Fastly\Model\SigningKey'; + 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\SigningKey', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation signingKeyAsync + * + * Get public key + * + * 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 signingKeyAsync($options) + { + return $this->signingKeyAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation signingKeyAsyncWithHttpInfo + * + * Get public key + * + * 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 signingKeyAsyncWithHttpInfo($options) + { + $returnType = '\Fastly\Model\SigningKey'; + $request = $this->signingKeyRequest($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 'signingKey' + * + * 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 signingKeyRequest($options) + { + // unbox the parameters from the associative array + + + $resourcePath = '/resources/stores/secret/signing-key'; + $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 + ); + } + + /** + * 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/SecretStoreItemApi.php b/lib/Api/SecretStoreItemApi.php new file mode 100644 index 00000000..1d899adb --- /dev/null +++ b/lib/Api/SecretStoreItemApi.php @@ -0,0 +1,2127 @@ +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 createSecret + * + * Create a new secret in a store. + * + * 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 $store_id store_id (required) + * @param \Fastly\Model\Secret $secret secret (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Fastly\Model\SecretResponse + */ + public function createSecret($options) + { + list($response) = $this->createSecretWithHttpInfo($options); + return $response; + } + + /** + * Operation createSecretWithHttpInfo + * + * Create a new secret in a store. + * + * 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 $store_id (required) + * @param \Fastly\Model\Secret $secret (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Fastly\Model\SecretResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function createSecretWithHttpInfo($options) + { + $request = $this->createSecretRequest($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\SecretResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\SecretResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Fastly\Model\SecretResponse'; + 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\SecretResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createSecretAsync + * + * Create a new secret in a store. + * + * 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 $store_id (required) + * @param \Fastly\Model\Secret $secret (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createSecretAsync($options) + { + return $this->createSecretAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createSecretAsyncWithHttpInfo + * + * Create a new secret in a store. + * + * 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 $store_id (required) + * @param \Fastly\Model\Secret $secret (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createSecretAsyncWithHttpInfo($options) + { + $returnType = '\Fastly\Model\SecretResponse'; + $request = $this->createSecretRequest($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 'createSecret' + * + * 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 $store_id (required) + * @param \Fastly\Model\Secret $secret (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createSecretRequest($options) + { + // unbox the parameters from the associative array + $store_id = array_key_exists('store_id', $options) ? $options['store_id'] : null; + $secret = array_key_exists('secret', $options) ? $options['secret'] : null; + + // verify the required parameter 'store_id' is set + if ($store_id === null || (is_array($store_id) && count($store_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $store_id when calling createSecret' + ); + } + + $resourcePath = '/resources/stores/secret/{store_id}/secrets'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($store_id !== null) { + $resourcePath = str_replace( + '{' . 'store_id' . '}', + ObjectSerializer::toPathValue($store_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($secret)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($secret)); + } else { + $httpBody = $secret; + } + } 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 deleteSecret + * + * Delete a secret from a store. + * + * 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 $store_id store_id (required) + * @param string $secret_name secret_name (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function deleteSecret($options) + { + $this->deleteSecretWithHttpInfo($options); + } + + /** + * Operation deleteSecretWithHttpInfo + * + * Delete a secret from a store. + * + * 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 $store_id (required) + * @param string $secret_name (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 deleteSecretWithHttpInfo($options) + { + $request = $this->deleteSecretRequest($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 deleteSecretAsync + * + * Delete a secret from a store. + * + * 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 $store_id (required) + * @param string $secret_name (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteSecretAsync($options) + { + return $this->deleteSecretAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteSecretAsyncWithHttpInfo + * + * Delete a secret from a store. + * + * 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 $store_id (required) + * @param string $secret_name (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteSecretAsyncWithHttpInfo($options) + { + $returnType = ''; + $request = $this->deleteSecretRequest($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 'deleteSecret' + * + * 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 $store_id (required) + * @param string $secret_name (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteSecretRequest($options) + { + // unbox the parameters from the associative array + $store_id = array_key_exists('store_id', $options) ? $options['store_id'] : null; + $secret_name = array_key_exists('secret_name', $options) ? $options['secret_name'] : null; + + // verify the required parameter 'store_id' is set + if ($store_id === null || (is_array($store_id) && count($store_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $store_id when calling deleteSecret' + ); + } + // verify the required parameter 'secret_name' is set + if ($secret_name === null || (is_array($secret_name) && count($secret_name) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $secret_name when calling deleteSecret' + ); + } + + $resourcePath = '/resources/stores/secret/{store_id}/secrets/{secret_name}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($store_id !== null) { + $resourcePath = str_replace( + '{' . 'store_id' . '}', + ObjectSerializer::toPathValue($store_id), + $resourcePath + ); + } + // path params + if ($secret_name !== null) { + $resourcePath = str_replace( + '{' . 'secret_name' . '}', + ObjectSerializer::toPathValue($secret_name), + $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 getSecret + * + * Get secret metadata. + * + * 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 $store_id store_id (required) + * @param string $secret_name secret_name (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Fastly\Model\SecretResponse + */ + public function getSecret($options) + { + list($response) = $this->getSecretWithHttpInfo($options); + return $response; + } + + /** + * Operation getSecretWithHttpInfo + * + * Get secret metadata. + * + * 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 $store_id (required) + * @param string $secret_name (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Fastly\Model\SecretResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getSecretWithHttpInfo($options) + { + $request = $this->getSecretRequest($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\SecretResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\SecretResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Fastly\Model\SecretResponse'; + 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\SecretResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getSecretAsync + * + * Get secret metadata. + * + * 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 $store_id (required) + * @param string $secret_name (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSecretAsync($options) + { + return $this->getSecretAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getSecretAsyncWithHttpInfo + * + * Get secret metadata. + * + * 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 $store_id (required) + * @param string $secret_name (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSecretAsyncWithHttpInfo($options) + { + $returnType = '\Fastly\Model\SecretResponse'; + $request = $this->getSecretRequest($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 'getSecret' + * + * 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 $store_id (required) + * @param string $secret_name (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getSecretRequest($options) + { + // unbox the parameters from the associative array + $store_id = array_key_exists('store_id', $options) ? $options['store_id'] : null; + $secret_name = array_key_exists('secret_name', $options) ? $options['secret_name'] : null; + + // verify the required parameter 'store_id' is set + if ($store_id === null || (is_array($store_id) && count($store_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $store_id when calling getSecret' + ); + } + // verify the required parameter 'secret_name' is set + if ($secret_name === null || (is_array($secret_name) && count($secret_name) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $secret_name when calling getSecret' + ); + } + + $resourcePath = '/resources/stores/secret/{store_id}/secrets/{secret_name}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($store_id !== null) { + $resourcePath = str_replace( + '{' . 'store_id' . '}', + ObjectSerializer::toPathValue($store_id), + $resourcePath + ); + } + // path params + if ($secret_name !== null) { + $resourcePath = str_replace( + '{' . 'secret_name' . '}', + ObjectSerializer::toPathValue($secret_name), + $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 getSecrets + * + * List secrets within a store. + * + * 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 $store_id store_id (required) + * @param string $cursor Cursor value from a previous response to retrieve the next page. To request the first page, this should be empty. (optional) + * @param string $limit Number of results per page. The maximum is 200. (optional, default to '100') + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Fastly\Model\InlineResponse2006 + */ + public function getSecrets($options) + { + list($response) = $this->getSecretsWithHttpInfo($options); + return $response; + } + + /** + * Operation getSecretsWithHttpInfo + * + * List secrets within a store. + * + * 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 $store_id (required) + * @param string $cursor Cursor value from a previous response to retrieve the next page. To request the first page, this should be empty. (optional) + * @param string $limit Number of results per page. The maximum is 200. (optional, default to '100') + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Fastly\Model\InlineResponse2006, HTTP status code, HTTP response headers (array of strings) + */ + public function getSecretsWithHttpInfo($options) + { + $request = $this->getSecretsRequest($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\InlineResponse2006' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\InlineResponse2006', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Fastly\Model\InlineResponse2006'; + 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\InlineResponse2006', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getSecretsAsync + * + * List secrets within a store. + * + * 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 $store_id (required) + * @param string $cursor Cursor value from a previous response to retrieve the next page. To request the first page, this should be empty. (optional) + * @param string $limit Number of results per page. The maximum is 200. (optional, default to '100') + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSecretsAsync($options) + { + return $this->getSecretsAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getSecretsAsyncWithHttpInfo + * + * List secrets within a store. + * + * 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 $store_id (required) + * @param string $cursor Cursor value from a previous response to retrieve the next page. To request the first page, this should be empty. (optional) + * @param string $limit Number of results per page. The maximum is 200. (optional, default to '100') + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSecretsAsyncWithHttpInfo($options) + { + $returnType = '\Fastly\Model\InlineResponse2006'; + $request = $this->getSecretsRequest($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 'getSecrets' + * + * 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 $store_id (required) + * @param string $cursor Cursor value from a previous response to retrieve the next page. To request the first page, this should be empty. (optional) + * @param string $limit Number of results per page. The maximum is 200. (optional, default to '100') + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getSecretsRequest($options) + { + // unbox the parameters from the associative array + $store_id = array_key_exists('store_id', $options) ? $options['store_id'] : null; + $cursor = array_key_exists('cursor', $options) ? $options['cursor'] : null; + $limit = array_key_exists('limit', $options) ? $options['limit'] : '100'; + + // verify the required parameter 'store_id' is set + if ($store_id === null || (is_array($store_id) && count($store_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $store_id when calling getSecrets' + ); + } + + $resourcePath = '/resources/stores/secret/{store_id}/secrets'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // 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); + } + } + // 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); + } + } + + + // path params + if ($store_id !== null) { + $resourcePath = str_replace( + '{' . 'store_id' . '}', + ObjectSerializer::toPathValue($store_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 mustRecreateSecret + * + * Recreate a secret in a store. + * + * 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 $store_id store_id (required) + * @param \Fastly\Model\Secret $secret secret (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Fastly\Model\SecretResponse + */ + public function mustRecreateSecret($options) + { + list($response) = $this->mustRecreateSecretWithHttpInfo($options); + return $response; + } + + /** + * Operation mustRecreateSecretWithHttpInfo + * + * Recreate a secret in a store. + * + * 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 $store_id (required) + * @param \Fastly\Model\Secret $secret (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Fastly\Model\SecretResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function mustRecreateSecretWithHttpInfo($options) + { + $request = $this->mustRecreateSecretRequest($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\SecretResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\SecretResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Fastly\Model\SecretResponse'; + 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\SecretResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation mustRecreateSecretAsync + * + * Recreate a secret in a store. + * + * 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 $store_id (required) + * @param \Fastly\Model\Secret $secret (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function mustRecreateSecretAsync($options) + { + return $this->mustRecreateSecretAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation mustRecreateSecretAsyncWithHttpInfo + * + * Recreate a secret in a store. + * + * 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 $store_id (required) + * @param \Fastly\Model\Secret $secret (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function mustRecreateSecretAsyncWithHttpInfo($options) + { + $returnType = '\Fastly\Model\SecretResponse'; + $request = $this->mustRecreateSecretRequest($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 'mustRecreateSecret' + * + * 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 $store_id (required) + * @param \Fastly\Model\Secret $secret (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function mustRecreateSecretRequest($options) + { + // unbox the parameters from the associative array + $store_id = array_key_exists('store_id', $options) ? $options['store_id'] : null; + $secret = array_key_exists('secret', $options) ? $options['secret'] : null; + + // verify the required parameter 'store_id' is set + if ($store_id === null || (is_array($store_id) && count($store_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $store_id when calling mustRecreateSecret' + ); + } + + $resourcePath = '/resources/stores/secret/{store_id}/secrets'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($store_id !== null) { + $resourcePath = str_replace( + '{' . 'store_id' . '}', + ObjectSerializer::toPathValue($store_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($secret)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($secret)); + } else { + $httpBody = $secret; + } + } 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 + ); + } + + /** + * Operation recreateSecret + * + * Create or recreate a secret in a store. + * + * 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 $store_id store_id (required) + * @param \Fastly\Model\Secret $secret secret (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Fastly\Model\SecretResponse + */ + public function recreateSecret($options) + { + list($response) = $this->recreateSecretWithHttpInfo($options); + return $response; + } + + /** + * Operation recreateSecretWithHttpInfo + * + * Create or recreate a secret in a store. + * + * 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 $store_id (required) + * @param \Fastly\Model\Secret $secret (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Fastly\Model\SecretResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function recreateSecretWithHttpInfo($options) + { + $request = $this->recreateSecretRequest($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 ('PUT' != 'GET' && 'PUT' != '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\SecretResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\SecretResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Fastly\Model\SecretResponse'; + 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\SecretResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation recreateSecretAsync + * + * Create or recreate a secret in a store. + * + * 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 $store_id (required) + * @param \Fastly\Model\Secret $secret (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function recreateSecretAsync($options) + { + return $this->recreateSecretAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation recreateSecretAsyncWithHttpInfo + * + * Create or recreate a secret in a store. + * + * 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 $store_id (required) + * @param \Fastly\Model\Secret $secret (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function recreateSecretAsyncWithHttpInfo($options) + { + $returnType = '\Fastly\Model\SecretResponse'; + $request = $this->recreateSecretRequest($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 'recreateSecret' + * + * 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 $store_id (required) + * @param \Fastly\Model\Secret $secret (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function recreateSecretRequest($options) + { + // unbox the parameters from the associative array + $store_id = array_key_exists('store_id', $options) ? $options['store_id'] : null; + $secret = array_key_exists('secret', $options) ? $options['secret'] : null; + + // verify the required parameter 'store_id' is set + if ($store_id === null || (is_array($store_id) && count($store_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $store_id when calling recreateSecret' + ); + } + + $resourcePath = '/resources/stores/secret/{store_id}/secrets'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($store_id !== null) { + $resourcePath = str_replace( + '{' . 'store_id' . '}', + ObjectSerializer::toPathValue($store_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($secret)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($secret)); + } else { + $httpBody = $secret; + } + } 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( + 'PUT', + $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/ServiceAuthorizationsApi.php b/lib/Api/ServiceAuthorizationsApi.php index 7a465203..e70bc9e8 100644 --- a/lib/Api/ServiceAuthorizationsApi.php +++ b/lib/Api/ServiceAuthorizationsApi.php @@ -700,49 +700,704 @@ public function deleteServiceAuthorizationRequest($options) ); } + /** + * Operation deleteServiceAuthorization2 + * + * Delete service authorizations + * + * 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 array $request_body request_body (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Fastly\Model\InlineResponse2007 + */ + public function deleteServiceAuthorization2($options) + { + list($response) = $this->deleteServiceAuthorization2WithHttpInfo($options); + return $response; + } + + /** + * Operation deleteServiceAuthorization2WithHttpInfo + * + * Delete service authorizations + * + * 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 array $request_body (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Fastly\Model\InlineResponse2007, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteServiceAuthorization2WithHttpInfo($options) + { + $request = $this->deleteServiceAuthorization2Request($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() + ); + } + + switch($statusCode) { + case 200: + if ('\Fastly\Model\InlineResponse2007' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\InlineResponse2007', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Fastly\Model\InlineResponse2007'; + 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\InlineResponse2007', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteServiceAuthorization2Async + * + * Delete service authorizations + * + * 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 array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteServiceAuthorization2Async($options) + { + return $this->deleteServiceAuthorization2AsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteServiceAuthorization2AsyncWithHttpInfo + * + * Delete service authorizations + * + * 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 array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteServiceAuthorization2AsyncWithHttpInfo($options) + { + $returnType = '\Fastly\Model\InlineResponse2007'; + $request = $this->deleteServiceAuthorization2Request($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 'deleteServiceAuthorization2' + * + * 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 array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteServiceAuthorization2Request($options) + { + // unbox the parameters from the associative array + $request_body = array_key_exists('request_body', $options) ? $options['request_body'] : null; + + + $resourcePath = '/service-authorizations'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json; ext=bulk'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+json; ext=bulk'], + ['application/vnd.api+json; ext=bulk'] + ); + } + + // for model (json/xml) + if (isset($request_body)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($request_body)); + } else { + $httpBody = $request_body; + } + } 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( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation listServiceAuthorization * - * List service authorizations + * List service authorizations + * + * 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 int $page_number Current page. (optional) + * @param int $page_size Number of records per page. (optional, default to 20) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Fastly\Model\ServiceAuthorizationsResponse + */ + public function listServiceAuthorization($options) + { + list($response) = $this->listServiceAuthorizationWithHttpInfo($options); + return $response; + } + + /** + * Operation listServiceAuthorizationWithHttpInfo + * + * List service authorizations + * + * 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 int $page_number Current page. (optional) + * @param int $page_size Number of records per page. (optional, default to 20) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Fastly\Model\ServiceAuthorizationsResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function listServiceAuthorizationWithHttpInfo($options) + { + $request = $this->listServiceAuthorizationRequest($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\ServiceAuthorizationsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\ServiceAuthorizationsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Fastly\Model\ServiceAuthorizationsResponse'; + 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\ServiceAuthorizationsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listServiceAuthorizationAsync + * + * List service authorizations + * + * 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 int $page_number Current page. (optional) + * @param int $page_size Number of records per page. (optional, default to 20) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listServiceAuthorizationAsync($options) + { + return $this->listServiceAuthorizationAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listServiceAuthorizationAsyncWithHttpInfo + * + * List service authorizations + * + * 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 int $page_number Current page. (optional) + * @param int $page_size Number of records per page. (optional, default to 20) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listServiceAuthorizationAsyncWithHttpInfo($options) + { + $returnType = '\Fastly\Model\ServiceAuthorizationsResponse'; + $request = $this->listServiceAuthorizationRequest($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 'listServiceAuthorization' + * + * 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 int $page_number Current page. (optional) + * @param int $page_size Number of records per page. (optional, default to 20) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listServiceAuthorizationRequest($options) + { + // unbox the parameters from the associative array + $page_number = array_key_exists('page_number', $options) ? $options['page_number'] : null; + $page_size = array_key_exists('page_size', $options) ? $options['page_size'] : 20; + + if ($page_size !== null && $page_size > 100) { + throw new \InvalidArgumentException('invalid value for "$page_size" when calling ServiceAuthorizationsApi.listServiceAuthorization, must be smaller than or equal to 100.'); + } + if ($page_size !== null && $page_size < 1) { + throw new \InvalidArgumentException('invalid value for "$page_size" when calling ServiceAuthorizationsApi.listServiceAuthorization, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/service-authorizations'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($page_number !== null) { + if('form' === 'form' && is_array($page_number)) { + foreach($page_number as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['page[number]'] = ObjectSerializer::toString($page_number); + } + } + // query params + if ($page_size !== null) { + if('form' === 'form' && is_array($page_size)) { + foreach($page_size as $key => $value) { + $queryParams[$key] = ObjectSerializer::toString($value); + } + } + else { + $queryParams['page[size]'] = ObjectSerializer::toString($page_size); + } + } + + + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+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 showServiceAuthorization + * + * Show service authorization * * 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 int $page_number Current page. (optional) - * @param int $page_size Number of records per page. (optional, default to 20) + * @param string $service_authorization_id Alphanumeric string identifying a service authorization. (required) * * @throws \Fastly\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Fastly\Model\ServiceAuthorizationsResponse + * @return \Fastly\Model\ServiceAuthorizationResponse */ - public function listServiceAuthorization($options) + public function showServiceAuthorization($options) { - list($response) = $this->listServiceAuthorizationWithHttpInfo($options); + list($response) = $this->showServiceAuthorizationWithHttpInfo($options); return $response; } /** - * Operation listServiceAuthorizationWithHttpInfo + * Operation showServiceAuthorizationWithHttpInfo * - * List service authorizations + * Show service authorization * * 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 int $page_number Current page. (optional) - * @param int $page_size Number of records per page. (optional, default to 20) + * @param string $service_authorization_id Alphanumeric string identifying a service authorization. (required) * * @throws \Fastly\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Fastly\Model\ServiceAuthorizationsResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \Fastly\Model\ServiceAuthorizationResponse, HTTP status code, HTTP response headers (array of strings) */ - public function listServiceAuthorizationWithHttpInfo($options) + public function showServiceAuthorizationWithHttpInfo($options) { - $request = $this->listServiceAuthorizationRequest($options); + $request = $this->showServiceAuthorizationRequest($options); try { $options = $this->createHttpClientOption(); @@ -793,20 +1448,20 @@ public function listServiceAuthorizationWithHttpInfo($options) switch($statusCode) { case 200: - if ('\Fastly\Model\ServiceAuthorizationsResponse' === '\SplFileObject') { + if ('\Fastly\Model\ServiceAuthorizationResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Fastly\Model\ServiceAuthorizationsResponse', []), + ObjectSerializer::deserialize($content, '\Fastly\Model\ServiceAuthorizationResponse', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Fastly\Model\ServiceAuthorizationsResponse'; + $returnType = '\Fastly\Model\ServiceAuthorizationResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -824,7 +1479,7 @@ public function listServiceAuthorizationWithHttpInfo($options) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Fastly\Model\ServiceAuthorizationsResponse', + '\Fastly\Model\ServiceAuthorizationResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -835,24 +1490,23 @@ public function listServiceAuthorizationWithHttpInfo($options) } /** - * Operation listServiceAuthorizationAsync + * Operation showServiceAuthorizationAsync * - * List service authorizations + * Show service authorization * * 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 int $page_number Current page. (optional) - * @param int $page_size Number of records per page. (optional, default to 20) + * @param string $service_authorization_id Alphanumeric string identifying a service authorization. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listServiceAuthorizationAsync($options) + public function showServiceAuthorizationAsync($options) { - return $this->listServiceAuthorizationAsyncWithHttpInfo($options) + return $this->showServiceAuthorizationAsyncWithHttpInfo($options) ->then( function ($response) { return $response[0]; @@ -861,25 +1515,24 @@ function ($response) { } /** - * Operation listServiceAuthorizationAsyncWithHttpInfo + * Operation showServiceAuthorizationAsyncWithHttpInfo * - * List service authorizations + * Show service authorization * * 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 int $page_number Current page. (optional) - * @param int $page_size Number of records per page. (optional, default to 20) + * @param string $service_authorization_id Alphanumeric string identifying a service authorization. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listServiceAuthorizationAsyncWithHttpInfo($options) + public function showServiceAuthorizationAsyncWithHttpInfo($options) { - $returnType = '\Fastly\Model\ServiceAuthorizationsResponse'; - $request = $this->listServiceAuthorizationRequest($options); + $returnType = '\Fastly\Model\ServiceAuthorizationResponse'; + $request = $this->showServiceAuthorizationRequest($options); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -915,64 +1568,47 @@ function ($exception) { } /** - * Create request for operation 'listServiceAuthorization' + * Create request for operation 'showServiceAuthorization' * * 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 int $page_number Current page. (optional) - * @param int $page_size Number of records per page. (optional, default to 20) + * @param string $service_authorization_id Alphanumeric string identifying a service authorization. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function listServiceAuthorizationRequest($options) + public function showServiceAuthorizationRequest($options) { // unbox the parameters from the associative array - $page_number = array_key_exists('page_number', $options) ? $options['page_number'] : null; - $page_size = array_key_exists('page_size', $options) ? $options['page_size'] : 20; + $service_authorization_id = array_key_exists('service_authorization_id', $options) ? $options['service_authorization_id'] : null; - if ($page_size !== null && $page_size > 100) { - throw new \InvalidArgumentException('invalid value for "$page_size" when calling ServiceAuthorizationsApi.listServiceAuthorization, must be smaller than or equal to 100.'); - } - if ($page_size !== null && $page_size < 1) { - throw new \InvalidArgumentException('invalid value for "$page_size" when calling ServiceAuthorizationsApi.listServiceAuthorization, must be bigger than or equal to 1.'); + // verify the required parameter 'service_authorization_id' is set + if ($service_authorization_id === null || (is_array($service_authorization_id) && count($service_authorization_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $service_authorization_id when calling showServiceAuthorization' + ); } - - $resourcePath = '/service-authorizations'; + $resourcePath = '/service-authorizations/{service_authorization_id}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if ($page_number !== null) { - if('form' === 'form' && is_array($page_number)) { - foreach($page_number as $key => $value) { - $queryParams[$key] = ObjectSerializer::toString($value); - } - } - else { - $queryParams['page[number]'] = ObjectSerializer::toString($page_number); - } - } - // query params - if ($page_size !== null) { - if('form' === 'form' && is_array($page_size)) { - foreach($page_size as $key => $value) { - $queryParams[$key] = ObjectSerializer::toString($value); - } - } - else { - $queryParams['page[size]'] = ObjectSerializer::toString($page_size); - } - } + // path params + if ($service_authorization_id !== null) { + $resourcePath = str_replace( + '{' . 'service_authorization_id' . '}', + ObjectSerializer::toPathValue($service_authorization_id), + $resourcePath + ); + } if ($multipart) { @@ -1044,9 +1680,9 @@ public function listServiceAuthorizationRequest($options) } /** - * Operation showServiceAuthorization + * Operation updateServiceAuthorization * - * Show service authorization + * Update service authorization * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -1054,21 +1690,22 @@ public function listServiceAuthorizationRequest($options) * URL: https://api.fastly.com * * @param string $service_authorization_id Alphanumeric string identifying a service authorization. (required) + * @param \Fastly\Model\ServiceAuthorization $service_authorization service_authorization (optional) * * @throws \Fastly\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Fastly\Model\ServiceAuthorizationResponse */ - public function showServiceAuthorization($options) + public function updateServiceAuthorization($options) { - list($response) = $this->showServiceAuthorizationWithHttpInfo($options); + list($response) = $this->updateServiceAuthorizationWithHttpInfo($options); return $response; } /** - * Operation showServiceAuthorizationWithHttpInfo + * Operation updateServiceAuthorizationWithHttpInfo * - * Show service authorization + * Update service authorization * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -1076,14 +1713,15 @@ public function showServiceAuthorization($options) * URL: https://api.fastly.com * * @param string $service_authorization_id Alphanumeric string identifying a service authorization. (required) + * @param \Fastly\Model\ServiceAuthorization $service_authorization (optional) * * @throws \Fastly\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Fastly\Model\ServiceAuthorizationResponse, HTTP status code, HTTP response headers (array of strings) */ - public function showServiceAuthorizationWithHttpInfo($options) + public function updateServiceAuthorizationWithHttpInfo($options) { - $request = $this->showServiceAuthorizationRequest($options); + $request = $this->updateServiceAuthorizationRequest($options); try { $options = $this->createHttpClientOption(); @@ -1105,7 +1743,7 @@ public function showServiceAuthorizationWithHttpInfo($options) ); } - if ('GET' != 'GET' && 'GET' != 'HEAD') { + if ('PATCH' != 'GET' && 'PATCH' != 'HEAD') { $header = $response->getHeader('Fastly-RateLimit-Remaining'); if (count($header) > 0) { $this->config->setRateLimitRemaining($header[0]); @@ -1176,9 +1814,9 @@ public function showServiceAuthorizationWithHttpInfo($options) } /** - * Operation showServiceAuthorizationAsync + * Operation updateServiceAuthorizationAsync * - * Show service authorization + * Update service authorization * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -1186,13 +1824,14 @@ public function showServiceAuthorizationWithHttpInfo($options) * URL: https://api.fastly.com * * @param string $service_authorization_id Alphanumeric string identifying a service authorization. (required) + * @param \Fastly\Model\ServiceAuthorization $service_authorization (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function showServiceAuthorizationAsync($options) + public function updateServiceAuthorizationAsync($options) { - return $this->showServiceAuthorizationAsyncWithHttpInfo($options) + return $this->updateServiceAuthorizationAsyncWithHttpInfo($options) ->then( function ($response) { return $response[0]; @@ -1201,9 +1840,9 @@ function ($response) { } /** - * Operation showServiceAuthorizationAsyncWithHttpInfo + * Operation updateServiceAuthorizationAsyncWithHttpInfo * - * Show service authorization + * Update service authorization * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -1211,14 +1850,15 @@ function ($response) { * URL: https://api.fastly.com * * @param string $service_authorization_id Alphanumeric string identifying a service authorization. (required) + * @param \Fastly\Model\ServiceAuthorization $service_authorization (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function showServiceAuthorizationAsyncWithHttpInfo($options) + public function updateServiceAuthorizationAsyncWithHttpInfo($options) { $returnType = '\Fastly\Model\ServiceAuthorizationResponse'; - $request = $this->showServiceAuthorizationRequest($options); + $request = $this->updateServiceAuthorizationRequest($options); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1254,7 +1894,7 @@ function ($exception) { } /** - * Create request for operation 'showServiceAuthorization' + * Create request for operation 'updateServiceAuthorization' * * Note: the input parameter is an associative array with the keys listed as the parameter name below * @@ -1262,19 +1902,21 @@ function ($exception) { * URL: https://api.fastly.com * * @param string $service_authorization_id Alphanumeric string identifying a service authorization. (required) + * @param \Fastly\Model\ServiceAuthorization $service_authorization (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function showServiceAuthorizationRequest($options) + public function updateServiceAuthorizationRequest($options) { // unbox the parameters from the associative array $service_authorization_id = array_key_exists('service_authorization_id', $options) ? $options['service_authorization_id'] : null; + $service_authorization = array_key_exists('service_authorization', $options) ? $options['service_authorization'] : null; // verify the required parameter 'service_authorization_id' is set if ($service_authorization_id === null || (is_array($service_authorization_id) && count($service_authorization_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $service_authorization_id when calling showServiceAuthorization' + 'Missing the required parameter $service_authorization_id when calling updateServiceAuthorization' ); } @@ -1304,12 +1946,18 @@ public function showServiceAuthorizationRequest($options) } else { $headers = $this->headerSelector->selectHeaders( ['application/vnd.api+json'], - [] + ['application/json'] ); } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($service_authorization)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($service_authorization)); + } else { + $httpBody = $service_authorization; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -1358,7 +2006,7 @@ public function showServiceAuthorizationRequest($options) $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( - 'GET', + 'PATCH', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -1366,48 +2014,46 @@ public function showServiceAuthorizationRequest($options) } /** - * Operation updateServiceAuthorization + * Operation updateServiceAuthorization2 * - * Update service authorization + * Update service authorizations * * 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 $service_authorization_id Alphanumeric string identifying a service authorization. (required) - * @param \Fastly\Model\ServiceAuthorization $service_authorization service_authorization (optional) + * @param array $request_body request_body (optional) * * @throws \Fastly\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Fastly\Model\ServiceAuthorizationResponse + * @return \Fastly\Model\ServiceAuthorizationsResponse */ - public function updateServiceAuthorization($options) + public function updateServiceAuthorization2($options) { - list($response) = $this->updateServiceAuthorizationWithHttpInfo($options); + list($response) = $this->updateServiceAuthorization2WithHttpInfo($options); return $response; } /** - * Operation updateServiceAuthorizationWithHttpInfo + * Operation updateServiceAuthorization2WithHttpInfo * - * Update service authorization + * Update service authorizations * * 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 $service_authorization_id Alphanumeric string identifying a service authorization. (required) - * @param \Fastly\Model\ServiceAuthorization $service_authorization (optional) + * @param array $request_body (optional) * * @throws \Fastly\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Fastly\Model\ServiceAuthorizationResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \Fastly\Model\ServiceAuthorizationsResponse, HTTP status code, HTTP response headers (array of strings) */ - public function updateServiceAuthorizationWithHttpInfo($options) + public function updateServiceAuthorization2WithHttpInfo($options) { - $request = $this->updateServiceAuthorizationRequest($options); + $request = $this->updateServiceAuthorization2Request($options); try { $options = $this->createHttpClientOption(); @@ -1458,20 +2104,20 @@ public function updateServiceAuthorizationWithHttpInfo($options) switch($statusCode) { case 200: - if ('\Fastly\Model\ServiceAuthorizationResponse' === '\SplFileObject') { + if ('\Fastly\Model\ServiceAuthorizationsResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, '\Fastly\Model\ServiceAuthorizationResponse', []), + ObjectSerializer::deserialize($content, '\Fastly\Model\ServiceAuthorizationsResponse', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Fastly\Model\ServiceAuthorizationResponse'; + $returnType = '\Fastly\Model\ServiceAuthorizationsResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -1489,7 +2135,7 @@ public function updateServiceAuthorizationWithHttpInfo($options) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Fastly\Model\ServiceAuthorizationResponse', + '\Fastly\Model\ServiceAuthorizationsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1500,24 +2146,23 @@ public function updateServiceAuthorizationWithHttpInfo($options) } /** - * Operation updateServiceAuthorizationAsync + * Operation updateServiceAuthorization2Async * - * Update service authorization + * Update service authorizations * * 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 $service_authorization_id Alphanumeric string identifying a service authorization. (required) - * @param \Fastly\Model\ServiceAuthorization $service_authorization (optional) + * @param array $request_body (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateServiceAuthorizationAsync($options) + public function updateServiceAuthorization2Async($options) { - return $this->updateServiceAuthorizationAsyncWithHttpInfo($options) + return $this->updateServiceAuthorization2AsyncWithHttpInfo($options) ->then( function ($response) { return $response[0]; @@ -1526,25 +2171,24 @@ function ($response) { } /** - * Operation updateServiceAuthorizationAsyncWithHttpInfo + * Operation updateServiceAuthorization2AsyncWithHttpInfo * - * Update service authorization + * Update service authorizations * * 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 $service_authorization_id Alphanumeric string identifying a service authorization. (required) - * @param \Fastly\Model\ServiceAuthorization $service_authorization (optional) + * @param array $request_body (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateServiceAuthorizationAsyncWithHttpInfo($options) + public function updateServiceAuthorization2AsyncWithHttpInfo($options) { - $returnType = '\Fastly\Model\ServiceAuthorizationResponse'; - $request = $this->updateServiceAuthorizationRequest($options); + $returnType = '\Fastly\Model\ServiceAuthorizationsResponse'; + $request = $this->updateServiceAuthorization2Request($options); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1580,33 +2224,25 @@ function ($exception) { } /** - * Create request for operation 'updateServiceAuthorization' + * Create request for operation 'updateServiceAuthorization2' * * 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 $service_authorization_id Alphanumeric string identifying a service authorization. (required) - * @param \Fastly\Model\ServiceAuthorization $service_authorization (optional) + * @param array $request_body (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateServiceAuthorizationRequest($options) + public function updateServiceAuthorization2Request($options) { // unbox the parameters from the associative array - $service_authorization_id = array_key_exists('service_authorization_id', $options) ? $options['service_authorization_id'] : null; - $service_authorization = array_key_exists('service_authorization', $options) ? $options['service_authorization'] : null; + $request_body = array_key_exists('request_body', $options) ? $options['request_body'] : null; - // verify the required parameter 'service_authorization_id' is set - if ($service_authorization_id === null || (is_array($service_authorization_id) && count($service_authorization_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $service_authorization_id when calling updateServiceAuthorization' - ); - } - $resourcePath = '/service-authorizations/{service_authorization_id}'; + $resourcePath = '/service-authorizations'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1615,33 +2251,25 @@ public function updateServiceAuthorizationRequest($options) - // path params - if ($service_authorization_id !== null) { - $resourcePath = str_replace( - '{' . 'service_authorization_id' . '}', - ObjectSerializer::toPathValue($service_authorization_id), - $resourcePath - ); - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/vnd.api+json'] + ['application/vnd.api+json; ext=bulk'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/vnd.api+json'], - ['application/json'] + ['application/vnd.api+json; ext=bulk'], + ['application/vnd.api+json; ext=bulk'] ); } // for model (json/xml) - if (isset($service_authorization)) { + if (isset($request_body)) { if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($service_authorization)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($request_body)); } else { - $httpBody = $service_authorization; + $httpBody = $request_body; } } elseif (count($formParams) > 0) { if ($multipart) { diff --git a/lib/Api/SnippetApi.php b/lib/Api/SnippetApi.php index e8740162..caf7ff65 100644 --- a/lib/Api/SnippetApi.php +++ b/lib/Api/SnippetApi.php @@ -1909,6 +1909,368 @@ public function listSnippetsRequest($options) ); } + /** + * Operation updateSnippet + * + * Update a versioned snippet + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param string $snippet_name The name for the snippet. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Fastly\Model\SnippetResponse + */ + public function updateSnippet($options) + { + list($response) = $this->updateSnippetWithHttpInfo($options); + return $response; + } + + /** + * Operation updateSnippetWithHttpInfo + * + * Update a versioned snippet + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param string $snippet_name The name for the snippet. (required) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Fastly\Model\SnippetResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updateSnippetWithHttpInfo($options) + { + $request = $this->updateSnippetRequest($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 ('PUT' != 'GET' && 'PUT' != '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\SnippetResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\SnippetResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Fastly\Model\SnippetResponse'; + 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\SnippetResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateSnippetAsync + * + * Update a versioned snippet + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param string $snippet_name The name for the snippet. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateSnippetAsync($options) + { + return $this->updateSnippetAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateSnippetAsyncWithHttpInfo + * + * Update a versioned snippet + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param string $snippet_name The name for the snippet. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateSnippetAsyncWithHttpInfo($options) + { + $returnType = '\Fastly\Model\SnippetResponse'; + $request = $this->updateSnippetRequest($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 'updateSnippet' + * + * 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 $service_id Alphanumeric string identifying the service. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param string $snippet_name The name for the snippet. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateSnippetRequest($options) + { + // unbox the parameters from the associative array + $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null; + $version_id = array_key_exists('version_id', $options) ? $options['version_id'] : null; + $snippet_name = array_key_exists('snippet_name', $options) ? $options['snippet_name'] : null; + + // verify the required parameter 'service_id' is set + if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $service_id when calling updateSnippet' + ); + } + // verify the required parameter 'version_id' is set + if ($version_id === null || (is_array($version_id) && count($version_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $version_id when calling updateSnippet' + ); + } + // verify the required parameter 'snippet_name' is set + if ($snippet_name === null || (is_array($snippet_name) && count($snippet_name) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $snippet_name when calling updateSnippet' + ); + } + + $resourcePath = '/service/{service_id}/version/{version_id}/snippet/{snippet_name}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($service_id !== null) { + $resourcePath = str_replace( + '{' . 'service_id' . '}', + ObjectSerializer::toPathValue($service_id), + $resourcePath + ); + } + // path params + if ($version_id !== null) { + $resourcePath = str_replace( + '{' . 'version_id' . '}', + ObjectSerializer::toPathValue($version_id), + $resourcePath + ); + } + // path params + if ($snippet_name !== null) { + $resourcePath = str_replace( + '{' . 'snippet_name' . '}', + ObjectSerializer::toPathValue($snippet_name), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/x-www-form-urlencoded'] + ); + } + + // 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( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation updateSnippetDynamic * diff --git a/lib/Api/SudoApi.php b/lib/Api/SudoApi.php new file mode 100644 index 00000000..21968519 --- /dev/null +++ b/lib/Api/SudoApi.php @@ -0,0 +1,464 @@ +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 requestSudoAccess + * + * Request Sudo access + * + * 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\SudoRequest $sudo_request sudo_request (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Fastly\Model\SudoResponse|\Fastly\Model\SudoGenericTokenError + */ + public function requestSudoAccess($options) + { + list($response) = $this->requestSudoAccessWithHttpInfo($options); + return $response; + } + + /** + * Operation requestSudoAccessWithHttpInfo + * + * Request Sudo access + * + * 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\SudoRequest $sudo_request (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Fastly\Model\SudoResponse|\Fastly\Model\SudoGenericTokenError, HTTP status code, HTTP response headers (array of strings) + */ + public function requestSudoAccessWithHttpInfo($options) + { + $request = $this->requestSudoAccessRequest($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\SudoResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\SudoResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\Fastly\Model\SudoGenericTokenError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\SudoGenericTokenError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Fastly\Model\SudoResponse'; + 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\SudoResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Fastly\Model\SudoGenericTokenError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation requestSudoAccessAsync + * + * Request Sudo access + * + * 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\SudoRequest $sudo_request (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function requestSudoAccessAsync($options) + { + return $this->requestSudoAccessAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation requestSudoAccessAsyncWithHttpInfo + * + * Request Sudo access + * + * 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\SudoRequest $sudo_request (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function requestSudoAccessAsyncWithHttpInfo($options) + { + $returnType = '\Fastly\Model\SudoResponse'; + $request = $this->requestSudoAccessRequest($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 'requestSudoAccess' + * + * 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\SudoRequest $sudo_request (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function requestSudoAccessRequest($options) + { + // unbox the parameters from the associative array + $sudo_request = array_key_exists('sudo_request', $options) ? $options['sudo_request'] : null; + + + $resourcePath = '/sudo'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/vnd.api+json', 'application/problem+json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/vnd.api+json', 'application/problem+json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($sudo_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($sudo_request)); + } else { + $httpBody = $sudo_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 + ); + } + + /** + * 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/TokensApi.php b/lib/Api/TokensApi.php index 66935b44..f6d18679 100644 --- a/lib/Api/TokensApi.php +++ b/lib/Api/TokensApi.php @@ -109,6 +109,601 @@ public function getConfig() return $this->config; } + /** + * Operation bulkRevokeTokens + * + * Revoke multiple tokens + * + * 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 array $request_body request_body (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function bulkRevokeTokens($options) + { + $this->bulkRevokeTokensWithHttpInfo($options); + } + + /** + * Operation bulkRevokeTokensWithHttpInfo + * + * Revoke multiple tokens + * + * 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 array $request_body (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function bulkRevokeTokensWithHttpInfo($options) + { + $request = $this->bulkRevokeTokensRequest($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 bulkRevokeTokensAsync + * + * Revoke multiple tokens + * + * 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 array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function bulkRevokeTokensAsync($options) + { + return $this->bulkRevokeTokensAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation bulkRevokeTokensAsyncWithHttpInfo + * + * Revoke multiple tokens + * + * 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 array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function bulkRevokeTokensAsyncWithHttpInfo($options) + { + $returnType = ''; + $request = $this->bulkRevokeTokensRequest($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 'bulkRevokeTokens' + * + * 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 array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function bulkRevokeTokensRequest($options) + { + // unbox the parameters from the associative array + $request_body = array_key_exists('request_body', $options) ? $options['request_body'] : null; + + + $resourcePath = '/tokens'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + [] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + [], + ['application/vnd.api+json; ext=bulk'] + ); + } + + // for model (json/xml) + if (isset($request_body)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($request_body)); + } else { + $httpBody = $request_body; + } + } 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( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createToken + * + * Create a token + * + * 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\TokenCreatedResponse|\Fastly\Model\InlineResponse400 + */ + public function createToken($options) + { + list($response) = $this->createTokenWithHttpInfo($options); + return $response; + } + + /** + * Operation createTokenWithHttpInfo + * + * Create a token + * + * 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\TokenCreatedResponse|\Fastly\Model\InlineResponse400, HTTP status code, HTTP response headers (array of strings) + */ + public function createTokenWithHttpInfo($options) + { + $request = $this->createTokenRequest($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\TokenCreatedResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\TokenCreatedResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Fastly\Model\InlineResponse400' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Fastly\Model\InlineResponse400', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Fastly\Model\TokenCreatedResponse'; + 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\TokenCreatedResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Fastly\Model\InlineResponse400', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createTokenAsync + * + * Create a token + * + * 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 createTokenAsync($options) + { + return $this->createTokenAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createTokenAsyncWithHttpInfo + * + * Create a token + * + * 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 createTokenAsyncWithHttpInfo($options) + { + $returnType = '\Fastly\Model\TokenCreatedResponse'; + $request = $this->createTokenRequest($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 'createToken' + * + * 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 createTokenRequest($options) + { + // unbox the parameters from the associative array + + + $resourcePath = '/tokens'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/x-www-form-urlencoded'] + ); + } + + // 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; + } + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $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 getToken * diff --git a/lib/Api/WafActiveRulesApi.php b/lib/Api/WafActiveRulesApi.php index a708cdcc..b4741ad7 100644 --- a/lib/Api/WafActiveRulesApi.php +++ b/lib/Api/WafActiveRulesApi.php @@ -109,6 +109,320 @@ public function getConfig() return $this->config; } + /** + * Operation bulkDeleteWafActiveRules + * + * Delete multiple active rules from a WAF + * + * 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 $firewall_id Alphanumeric string identifying a WAF Firewall. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param array $request_body request_body (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + * @deprecated + */ + public function bulkDeleteWafActiveRules($options) + { + $this->bulkDeleteWafActiveRulesWithHttpInfo($options); + } + + /** + * Operation bulkDeleteWafActiveRulesWithHttpInfo + * + * Delete multiple active rules from a WAF + * + * 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 $firewall_id Alphanumeric string identifying a WAF Firewall. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param array $request_body (optional) + * + * @throws \Fastly\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function bulkDeleteWafActiveRulesWithHttpInfo($options) + { + $request = $this->bulkDeleteWafActiveRulesRequest($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 bulkDeleteWafActiveRulesAsync + * + * Delete multiple active rules from a WAF + * + * 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 $firewall_id Alphanumeric string identifying a WAF Firewall. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function bulkDeleteWafActiveRulesAsync($options) + { + return $this->bulkDeleteWafActiveRulesAsyncWithHttpInfo($options) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation bulkDeleteWafActiveRulesAsyncWithHttpInfo + * + * Delete multiple active rules from a WAF + * + * 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 $firewall_id Alphanumeric string identifying a WAF Firewall. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function bulkDeleteWafActiveRulesAsyncWithHttpInfo($options) + { + $returnType = ''; + $request = $this->bulkDeleteWafActiveRulesRequest($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 'bulkDeleteWafActiveRules' + * + * 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 $firewall_id Alphanumeric string identifying a WAF Firewall. (required) + * @param int $version_id Integer identifying a service version. (required) + * @param array $request_body (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + * @deprecated + */ + public function bulkDeleteWafActiveRulesRequest($options) + { + // unbox the parameters from the associative array + $firewall_id = array_key_exists('firewall_id', $options) ? $options['firewall_id'] : null; + $version_id = array_key_exists('version_id', $options) ? $options['version_id'] : null; + $request_body = array_key_exists('request_body', $options) ? $options['request_body'] : null; + + // verify the required parameter 'firewall_id' is set + if ($firewall_id === null || (is_array($firewall_id) && count($firewall_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $firewall_id when calling bulkDeleteWafActiveRules' + ); + } + // verify the required parameter 'version_id' is set + if ($version_id === null || (is_array($version_id) && count($version_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $version_id when calling bulkDeleteWafActiveRules' + ); + } + + $resourcePath = '/waf/firewalls/{firewall_id}/versions/{version_id}/active-rules'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($firewall_id !== null) { + $resourcePath = str_replace( + '{' . 'firewall_id' . '}', + ObjectSerializer::toPathValue($firewall_id), + $resourcePath + ); + } + // path params + if ($version_id !== null) { + $resourcePath = str_replace( + '{' . 'version_id' . '}', + ObjectSerializer::toPathValue($version_id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + [] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + [], + ['application/vnd.api+json; ext=bulk'] + ); + } + + // for model (json/xml) + if (isset($request_body)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($request_body)); + } else { + $httpBody = $request_body; + } + } 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( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation bulkUpdateWafActiveRules * diff --git a/lib/Configuration.php b/lib/Configuration.php index 5d4df209..80eaccc0 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -89,7 +89,7 @@ class Configuration * * @var string */ - protected $userAgent = 'fastly-php/2.3.1'; + protected $userAgent = 'fastly-php/3.0.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: 2.3.1' . PHP_EOL; + $report .= ' SDK Package Version: 3.0.0' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/lib/Model/AclEntry.php b/lib/Model/AclEntry.php index 86e78222..2e550927 100644 --- a/lib/Model/AclEntry.php +++ b/lib/Model/AclEntry.php @@ -171,8 +171,8 @@ public function getModelName() return self::$fastlyModelName; } - const NEGATED_0 = 0; - const NEGATED_1 = 1; + const NEGATED_disable = 0; + const NEGATED_enable = 1; /** * Gets allowable values of the enum @@ -182,8 +182,8 @@ public function getModelName() public function getNegatedAllowableValues() { return [ - self::NEGATED_0, - self::NEGATED_1, + self::NEGATED_disable, + self::NEGATED_enable, ]; } @@ -202,7 +202,7 @@ public function getNegatedAllowableValues() */ public function __construct(array $data = null) { - $this->container['negated'] = $data['negated'] ?? self::NEGATED_0; + $this->container['negated'] = $data['negated'] ?? self::NEGATED_disable; $this->container['comment'] = $data['comment'] ?? null; $this->container['ip'] = $data['ip'] ?? null; $this->container['subnet'] = $data['subnet'] ?? null; diff --git a/lib/Model/AclEntryResponse.php b/lib/Model/AclEntryResponse.php index f6cacb14..2f7666b4 100644 --- a/lib/Model/AclEntryResponse.php +++ b/lib/Model/AclEntryResponse.php @@ -201,8 +201,8 @@ public function getModelName() return self::$fastlyModelName; } - const NEGATED_0 = 0; - const NEGATED_1 = 1; + const NEGATED_disable = 0; + const NEGATED_enable = 1; /** * Gets allowable values of the enum @@ -212,8 +212,8 @@ public function getModelName() public function getNegatedAllowableValues() { return [ - self::NEGATED_0, - self::NEGATED_1, + self::NEGATED_disable, + self::NEGATED_enable, ]; } @@ -232,7 +232,7 @@ public function getNegatedAllowableValues() */ public function __construct(array $data = null) { - $this->container['negated'] = $data['negated'] ?? self::NEGATED_0; + $this->container['negated'] = $data['negated'] ?? self::NEGATED_disable; $this->container['comment'] = $data['comment'] ?? null; $this->container['ip'] = $data['ip'] ?? null; $this->container['subnet'] = $data['subnet'] ?? null; diff --git a/lib/Model/BulkUpdateAclEntry.php b/lib/Model/BulkUpdateAclEntry.php index 992833ee..9f1a9072 100644 --- a/lib/Model/BulkUpdateAclEntry.php +++ b/lib/Model/BulkUpdateAclEntry.php @@ -181,8 +181,8 @@ public function getModelName() return self::$fastlyModelName; } - const NEGATED_0 = 0; - const NEGATED_1 = 1; + const NEGATED_disable = 0; + const NEGATED_enable = 1; const OP_CREATE = 'create'; const OP_UPDATE = 'update'; const OP_DELETE = 'delete'; @@ -195,8 +195,8 @@ public function getModelName() public function getNegatedAllowableValues() { return [ - self::NEGATED_0, - self::NEGATED_1, + self::NEGATED_disable, + self::NEGATED_enable, ]; } @@ -229,7 +229,7 @@ public function getOpAllowableValues() */ public function __construct(array $data = null) { - $this->container['negated'] = $data['negated'] ?? self::NEGATED_0; + $this->container['negated'] = $data['negated'] ?? self::NEGATED_disable; $this->container['comment'] = $data['comment'] ?? null; $this->container['ip'] = $data['ip'] ?? null; $this->container['subnet'] = $data['subnet'] ?? null; diff --git a/lib/Model/ClientKey.php b/lib/Model/ClientKey.php new file mode 100644 index 00000000..ea17e900 --- /dev/null +++ b/lib/Model/ClientKey.php @@ -0,0 +1,375 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ClientKey implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'client_key'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'client_key' => 'string', + 'signature' => 'string', + 'expires_at' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'client_key' => null, + 'signature' => null, + 'expires_at' => 'date-time' + ]; + + /** + * 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 = [ + 'client_key' => 'client_key', + 'signature' => 'signature', + 'expires_at' => 'expires_at' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'client_key' => 'setClientKey', + 'signature' => 'setSignature', + 'expires_at' => 'setExpiresAt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'client_key' => 'getClientKey', + 'signature' => 'getSignature', + 'expires_at' => 'getExpiresAt' + ]; + + /** + * 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['client_key'] = $data['client_key'] ?? null; + $this->container['signature'] = $data['signature'] ?? null; + $this->container['expires_at'] = $data['expires_at'] ?? 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 client_key + * + * @return string|null + */ + public function getClientKey() + { + return $this->container['client_key']; + } + + /** + * Sets client_key + * + * @param string|null $client_key A Base64-encoded X25519 public key that can be used with a [libsodium-compatible sealed box](https://libsodium.gitbook.io/doc/public-key_cryptography/sealed_boxes) to encrypt secrets before upload. + * + * @return self + */ + public function setClientKey($client_key) + { + $this->container['client_key'] = $client_key; + + return $this; + } + + /** + * Gets signature + * + * @return string|null + */ + public function getSignature() + { + return $this->container['signature']; + } + + /** + * Sets signature + * + * @param string|null $signature A Base64-encoded signature of the client key. The signature is generated using the signing key and must be verified before using the client key. + * + * @return self + */ + public function setSignature($signature) + { + $this->container['signature'] = $signature; + + return $this; + } + + /** + * Gets expires_at + * + * @return \DateTime|null + */ + public function getExpiresAt() + { + return $this->container['expires_at']; + } + + /** + * Sets expires_at + * + * @param \DateTime|null $expires_at Date and time in ISO 8601 format. + * + * @return self + */ + public function setExpiresAt($expires_at) + { + $this->container['expires_at'] = $expires_at; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/Content.php b/lib/Model/Content.php index 952ce372..07569f78 100644 --- a/lib/Model/Content.php +++ b/lib/Model/Content.php @@ -54,8 +54,8 @@ class Content implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $fastlyTypes = [ 'hash' => 'string', - 'request' => 'object', - 'response' => 'object', + 'request' => 'array', + 'response' => 'array', 'response_time' => 'float', 'server' => 'string', 'pop' => 'string' @@ -256,7 +256,7 @@ public function setHash($hash) /** * Gets request * - * @return object|null + * @return array|null */ public function getRequest() { @@ -266,7 +266,7 @@ public function getRequest() /** * Sets request * - * @param object|null $request request + * @param array|null $request request * * @return self */ @@ -280,7 +280,7 @@ public function setRequest($request) /** * Gets response * - * @return object|null + * @return array|null */ public function getResponse() { @@ -290,7 +290,7 @@ public function getResponse() /** * Sets response * - * @param object|null $response response + * @param array|null $response response * * @return self */ diff --git a/lib/Model/Domain.php b/lib/Model/Domain.php index 4b37a1fc..0ea4ac26 100644 --- a/lib/Model/Domain.php +++ b/lib/Model/Domain.php @@ -30,6 +30,7 @@ * Domain Class Doc Comment * * @category Class + * @description Domain details * @package Fastly * @author oss@fastly.com * @implements \ArrayAccess diff --git a/lib/Model/DomainInspector.php b/lib/Model/DomainInspector.php new file mode 100644 index 00000000..98872b83 --- /dev/null +++ b/lib/Model/DomainInspector.php @@ -0,0 +1,374 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DomainInspector implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'domain_inspector'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'timestamp' => '\Fastly\Model\SubsequentRequestTimestamp', + 'aggregate_delay' => 'int', + 'data' => '\Fastly\Model\DomainInspectorRealtimeEntry[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'timestamp' => null, + 'aggregate_delay' => null, + '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 = [ + 'timestamp' => 'Timestamp', + 'aggregate_delay' => 'AggregateDelay', + 'data' => 'Data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'timestamp' => 'setTimestamp', + 'aggregate_delay' => 'setAggregateDelay', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'timestamp' => 'getTimestamp', + 'aggregate_delay' => 'getAggregateDelay', + '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['timestamp'] = $data['timestamp'] ?? null; + $this->container['aggregate_delay'] = $data['aggregate_delay'] ?? 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 timestamp + * + * @return \Fastly\Model\SubsequentRequestTimestamp|null + */ + public function getTimestamp() + { + return $this->container['timestamp']; + } + + /** + * Sets timestamp + * + * @param \Fastly\Model\SubsequentRequestTimestamp|null $timestamp timestamp + * + * @return self + */ + public function setTimestamp($timestamp) + { + $this->container['timestamp'] = $timestamp; + + return $this; + } + + /** + * Gets aggregate_delay + * + * @return int|null + */ + public function getAggregateDelay() + { + return $this->container['aggregate_delay']; + } + + /** + * Sets aggregate_delay + * + * @param int|null $aggregate_delay Offset of entry timestamps from the current time due to processing time. + * + * @return self + */ + public function setAggregateDelay($aggregate_delay) + { + $this->container['aggregate_delay'] = $aggregate_delay; + + return $this; + } + + /** + * Gets data + * + * @return \Fastly\Model\DomainInspectorRealtimeEntry[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Fastly\Model\DomainInspectorRealtimeEntry[]|null $data A list of report [entries](#entry-data-model), each representing one second of time. + * + * @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) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/DomainInspectorEntry.php b/lib/Model/DomainInspectorEntry.php new file mode 100644 index 00000000..b482dd95 --- /dev/null +++ b/lib/Model/DomainInspectorEntry.php @@ -0,0 +1,344 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DomainInspectorEntry implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'domain_inspector_entry'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'dimensions' => '\Fastly\Model\DomainInspectorEntryDimensions', + 'values' => '\Fastly\Model\Values[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'dimensions' => null, + 'values' => 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 = [ + 'dimensions' => 'dimensions', + 'values' => 'values' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'dimensions' => 'setDimensions', + 'values' => 'setValues' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'dimensions' => 'getDimensions', + 'values' => 'getValues' + ]; + + /** + * 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['dimensions'] = $data['dimensions'] ?? null; + $this->container['values'] = $data['values'] ?? 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 dimensions + * + * @return \Fastly\Model\DomainInspectorEntryDimensions|null + */ + public function getDimensions() + { + return $this->container['dimensions']; + } + + /** + * Sets dimensions + * + * @param \Fastly\Model\DomainInspectorEntryDimensions|null $dimensions dimensions + * + * @return self + */ + public function setDimensions($dimensions) + { + $this->container['dimensions'] = $dimensions; + + return $this; + } + + /** + * Gets values + * + * @return \Fastly\Model\Values[]|null + */ + public function getValues() + { + return $this->container['values']; + } + + /** + * Sets values + * + * @param \Fastly\Model\Values[]|null $values An array of values representing the metric values at each point in time. Note that this dataset is sparse: only the keys with non-zero values will be included in the record. + * + * @return self + */ + public function setValues($values) + { + $this->container['values'] = $values; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/DomainInspectorEntryDimensions.php b/lib/Model/DomainInspectorEntryDimensions.php new file mode 100644 index 00000000..dfa5fb1a --- /dev/null +++ b/lib/Model/DomainInspectorEntryDimensions.php @@ -0,0 +1,375 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DomainInspectorEntryDimensions implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'domain_inspector_entry_dimensions'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'region' => 'string', + 'datacenter' => 'string', + 'domain' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'region' => null, + 'datacenter' => null, + 'domain' => 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 = [ + 'region' => 'region', + 'datacenter' => 'datacenter', + 'domain' => 'domain' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'region' => 'setRegion', + 'datacenter' => 'setDatacenter', + 'domain' => 'setDomain' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'region' => 'getRegion', + 'datacenter' => 'getDatacenter', + 'domain' => 'getDomain' + ]; + + /** + * 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['region'] = $data['region'] ?? null; + $this->container['datacenter'] = $data['datacenter'] ?? null; + $this->container['domain'] = $data['domain'] ?? 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 region + * + * @return string|null + */ + public function getRegion() + { + return $this->container['region']; + } + + /** + * Sets region + * + * @param string|null $region The geographic region from which the edge responses in this data entry were delivered. If unspecified, results are aggregated across regions. + * + * @return self + */ + public function setRegion($region) + { + $this->container['region'] = $region; + + return $this; + } + + /** + * Gets datacenter + * + * @return string|null + */ + public function getDatacenter() + { + return $this->container['datacenter']; + } + + /** + * Sets datacenter + * + * @param string|null $datacenter The POP from which the edge responses in this data entry were delivered. If unspecified, results are aggregated across POPs. + * + * @return self + */ + public function setDatacenter($datacenter) + { + $this->container['datacenter'] = $datacenter; + + return $this; + } + + /** + * Gets domain + * + * @return string|null + */ + public function getDomain() + { + return $this->container['domain']; + } + + /** + * Sets domain + * + * @param string|null $domain The domain from which the edge responses in this data entry were delivered. If unspecified, results are aggregated across domains. + * + * @return self + */ + public function setDomain($domain) + { + $this->container['domain'] = $domain; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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 new file mode 100644 index 00000000..aba40ebf --- /dev/null +++ b/lib/Model/DomainInspectorMeasurements.php @@ -0,0 +1,2145 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DomainInspectorMeasurements implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'domain_inspector_measurements'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'edge_requests' => 'int', + 'edge_resp_header_bytes' => 'int', + 'edge_resp_body_bytes' => 'int', + 'status_1xx' => 'int', + 'status_2xx' => 'int', + 'status_3xx' => 'int', + 'status_4xx' => 'int', + 'status_5xx' => 'int', + 'status_200' => 'int', + 'status_204' => 'int', + 'status_206' => 'int', + 'status_301' => 'int', + 'status_302' => 'int', + 'status_304' => 'int', + 'status_400' => 'int', + 'status_401' => 'int', + 'status_403' => 'int', + 'status_404' => 'int', + 'status_416' => 'int', + 'status_429' => 'int', + 'status_500' => 'int', + 'status_501' => 'int', + 'status_502' => 'int', + 'status_503' => 'int', + 'status_504' => 'int', + 'status_505' => 'int', + 'requests' => 'int', + 'resp_header_bytes' => 'int', + 'resp_body_bytes' => 'int', + 'bereq_header_bytes' => 'int', + 'bereq_body_bytes' => 'int', + 'edge_hit_requests' => 'int', + 'edge_miss_requests' => 'int', + 'origin_fetches' => 'int', + 'origin_fetch_resp_header_bytes' => 'int', + 'origin_fetch_resp_body_bytes' => 'int', + 'bandwidth' => 'int', + 'edge_hit_ratio' => 'float', + 'origin_offload' => 'float', + 'origin_status_200' => 'int', + 'origin_status_204' => 'int', + 'origin_status_206' => 'int', + 'origin_status_301' => 'int', + 'origin_status_302' => 'int', + 'origin_status_304' => 'int', + 'origin_status_400' => 'int', + 'origin_status_401' => 'int', + 'origin_status_403' => 'int', + 'origin_status_404' => 'int', + 'origin_status_416' => 'int', + 'origin_status_429' => 'int', + 'origin_status_500' => 'int', + 'origin_status_501' => 'int', + 'origin_status_502' => 'int', + 'origin_status_503' => 'int', + 'origin_status_504' => 'int', + 'origin_status_505' => 'int', + 'origin_status_1xx' => 'int', + 'origin_status_2xx' => 'int', + 'origin_status_3xx' => 'int', + 'origin_status_4xx' => 'int', + 'origin_status_5xx' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'edge_requests' => null, + 'edge_resp_header_bytes' => null, + 'edge_resp_body_bytes' => null, + 'status_1xx' => null, + 'status_2xx' => null, + 'status_3xx' => null, + 'status_4xx' => null, + 'status_5xx' => null, + 'status_200' => null, + 'status_204' => null, + 'status_206' => null, + 'status_301' => null, + 'status_302' => null, + 'status_304' => null, + 'status_400' => null, + 'status_401' => null, + 'status_403' => null, + 'status_404' => null, + 'status_416' => null, + 'status_429' => null, + 'status_500' => null, + 'status_501' => null, + 'status_502' => null, + 'status_503' => null, + 'status_504' => null, + 'status_505' => null, + 'requests' => null, + 'resp_header_bytes' => null, + 'resp_body_bytes' => null, + 'bereq_header_bytes' => null, + 'bereq_body_bytes' => null, + 'edge_hit_requests' => null, + 'edge_miss_requests' => null, + 'origin_fetches' => null, + 'origin_fetch_resp_header_bytes' => null, + 'origin_fetch_resp_body_bytes' => null, + 'bandwidth' => null, + 'edge_hit_ratio' => null, + 'origin_offload' => null, + 'origin_status_200' => null, + 'origin_status_204' => null, + 'origin_status_206' => null, + 'origin_status_301' => null, + 'origin_status_302' => null, + 'origin_status_304' => null, + 'origin_status_400' => null, + 'origin_status_401' => null, + 'origin_status_403' => null, + 'origin_status_404' => null, + 'origin_status_416' => null, + 'origin_status_429' => null, + 'origin_status_500' => null, + 'origin_status_501' => null, + 'origin_status_502' => null, + 'origin_status_503' => null, + 'origin_status_504' => null, + 'origin_status_505' => null, + 'origin_status_1xx' => null, + 'origin_status_2xx' => null, + 'origin_status_3xx' => null, + 'origin_status_4xx' => null, + 'origin_status_5xx' => 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 = [ + 'edge_requests' => 'edge_requests', + 'edge_resp_header_bytes' => 'edge_resp_header_bytes', + 'edge_resp_body_bytes' => 'edge_resp_body_bytes', + 'status_1xx' => 'status_1xx', + 'status_2xx' => 'status_2xx', + 'status_3xx' => 'status_3xx', + 'status_4xx' => 'status_4xx', + 'status_5xx' => 'status_5xx', + 'status_200' => 'status_200', + 'status_204' => 'status_204', + 'status_206' => 'status_206', + 'status_301' => 'status_301', + 'status_302' => 'status_302', + 'status_304' => 'status_304', + 'status_400' => 'status_400', + 'status_401' => 'status_401', + 'status_403' => 'status_403', + 'status_404' => 'status_404', + 'status_416' => 'status_416', + 'status_429' => 'status_429', + 'status_500' => 'status_500', + 'status_501' => 'status_501', + 'status_502' => 'status_502', + 'status_503' => 'status_503', + 'status_504' => 'status_504', + 'status_505' => 'status_505', + 'requests' => 'requests', + 'resp_header_bytes' => 'resp_header_bytes', + 'resp_body_bytes' => 'resp_body_bytes', + 'bereq_header_bytes' => 'bereq_header_bytes', + 'bereq_body_bytes' => 'bereq_body_bytes', + 'edge_hit_requests' => 'edge_hit_requests', + 'edge_miss_requests' => 'edge_miss_requests', + 'origin_fetches' => 'origin_fetches', + 'origin_fetch_resp_header_bytes' => 'origin_fetch_resp_header_bytes', + 'origin_fetch_resp_body_bytes' => 'origin_fetch_resp_body_bytes', + 'bandwidth' => 'bandwidth', + 'edge_hit_ratio' => 'edge_hit_ratio', + 'origin_offload' => 'origin_offload', + 'origin_status_200' => 'origin_status_200', + 'origin_status_204' => 'origin_status_204', + 'origin_status_206' => 'origin_status_206', + 'origin_status_301' => 'origin_status_301', + 'origin_status_302' => 'origin_status_302', + 'origin_status_304' => 'origin_status_304', + 'origin_status_400' => 'origin_status_400', + 'origin_status_401' => 'origin_status_401', + 'origin_status_403' => 'origin_status_403', + 'origin_status_404' => 'origin_status_404', + 'origin_status_416' => 'origin_status_416', + 'origin_status_429' => 'origin_status_429', + 'origin_status_500' => 'origin_status_500', + 'origin_status_501' => 'origin_status_501', + 'origin_status_502' => 'origin_status_502', + 'origin_status_503' => 'origin_status_503', + 'origin_status_504' => 'origin_status_504', + 'origin_status_505' => 'origin_status_505', + 'origin_status_1xx' => 'origin_status_1xx', + 'origin_status_2xx' => 'origin_status_2xx', + 'origin_status_3xx' => 'origin_status_3xx', + 'origin_status_4xx' => 'origin_status_4xx', + 'origin_status_5xx' => 'origin_status_5xx' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'edge_requests' => 'setEdgeRequests', + 'edge_resp_header_bytes' => 'setEdgeRespHeaderBytes', + 'edge_resp_body_bytes' => 'setEdgeRespBodyBytes', + 'status_1xx' => 'setStatus1xx', + 'status_2xx' => 'setStatus2xx', + 'status_3xx' => 'setStatus3xx', + 'status_4xx' => 'setStatus4xx', + 'status_5xx' => 'setStatus5xx', + 'status_200' => 'setStatus200', + 'status_204' => 'setStatus204', + 'status_206' => 'setStatus206', + 'status_301' => 'setStatus301', + 'status_302' => 'setStatus302', + 'status_304' => 'setStatus304', + 'status_400' => 'setStatus400', + 'status_401' => 'setStatus401', + 'status_403' => 'setStatus403', + 'status_404' => 'setStatus404', + 'status_416' => 'setStatus416', + 'status_429' => 'setStatus429', + 'status_500' => 'setStatus500', + 'status_501' => 'setStatus501', + 'status_502' => 'setStatus502', + 'status_503' => 'setStatus503', + 'status_504' => 'setStatus504', + 'status_505' => 'setStatus505', + 'requests' => 'setRequests', + 'resp_header_bytes' => 'setRespHeaderBytes', + 'resp_body_bytes' => 'setRespBodyBytes', + 'bereq_header_bytes' => 'setBereqHeaderBytes', + 'bereq_body_bytes' => 'setBereqBodyBytes', + 'edge_hit_requests' => 'setEdgeHitRequests', + 'edge_miss_requests' => 'setEdgeMissRequests', + 'origin_fetches' => 'setOriginFetches', + 'origin_fetch_resp_header_bytes' => 'setOriginFetchRespHeaderBytes', + 'origin_fetch_resp_body_bytes' => 'setOriginFetchRespBodyBytes', + 'bandwidth' => 'setBandwidth', + 'edge_hit_ratio' => 'setEdgeHitRatio', + 'origin_offload' => 'setOriginOffload', + 'origin_status_200' => 'setOriginStatus200', + 'origin_status_204' => 'setOriginStatus204', + 'origin_status_206' => 'setOriginStatus206', + 'origin_status_301' => 'setOriginStatus301', + 'origin_status_302' => 'setOriginStatus302', + 'origin_status_304' => 'setOriginStatus304', + 'origin_status_400' => 'setOriginStatus400', + 'origin_status_401' => 'setOriginStatus401', + 'origin_status_403' => 'setOriginStatus403', + 'origin_status_404' => 'setOriginStatus404', + 'origin_status_416' => 'setOriginStatus416', + 'origin_status_429' => 'setOriginStatus429', + 'origin_status_500' => 'setOriginStatus500', + 'origin_status_501' => 'setOriginStatus501', + 'origin_status_502' => 'setOriginStatus502', + 'origin_status_503' => 'setOriginStatus503', + 'origin_status_504' => 'setOriginStatus504', + 'origin_status_505' => 'setOriginStatus505', + 'origin_status_1xx' => 'setOriginStatus1xx', + 'origin_status_2xx' => 'setOriginStatus2xx', + 'origin_status_3xx' => 'setOriginStatus3xx', + 'origin_status_4xx' => 'setOriginStatus4xx', + 'origin_status_5xx' => 'setOriginStatus5xx' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'edge_requests' => 'getEdgeRequests', + 'edge_resp_header_bytes' => 'getEdgeRespHeaderBytes', + 'edge_resp_body_bytes' => 'getEdgeRespBodyBytes', + 'status_1xx' => 'getStatus1xx', + 'status_2xx' => 'getStatus2xx', + 'status_3xx' => 'getStatus3xx', + 'status_4xx' => 'getStatus4xx', + 'status_5xx' => 'getStatus5xx', + 'status_200' => 'getStatus200', + 'status_204' => 'getStatus204', + 'status_206' => 'getStatus206', + 'status_301' => 'getStatus301', + 'status_302' => 'getStatus302', + 'status_304' => 'getStatus304', + 'status_400' => 'getStatus400', + 'status_401' => 'getStatus401', + 'status_403' => 'getStatus403', + 'status_404' => 'getStatus404', + 'status_416' => 'getStatus416', + 'status_429' => 'getStatus429', + 'status_500' => 'getStatus500', + 'status_501' => 'getStatus501', + 'status_502' => 'getStatus502', + 'status_503' => 'getStatus503', + 'status_504' => 'getStatus504', + 'status_505' => 'getStatus505', + 'requests' => 'getRequests', + 'resp_header_bytes' => 'getRespHeaderBytes', + 'resp_body_bytes' => 'getRespBodyBytes', + 'bereq_header_bytes' => 'getBereqHeaderBytes', + 'bereq_body_bytes' => 'getBereqBodyBytes', + 'edge_hit_requests' => 'getEdgeHitRequests', + 'edge_miss_requests' => 'getEdgeMissRequests', + 'origin_fetches' => 'getOriginFetches', + 'origin_fetch_resp_header_bytes' => 'getOriginFetchRespHeaderBytes', + 'origin_fetch_resp_body_bytes' => 'getOriginFetchRespBodyBytes', + 'bandwidth' => 'getBandwidth', + 'edge_hit_ratio' => 'getEdgeHitRatio', + 'origin_offload' => 'getOriginOffload', + 'origin_status_200' => 'getOriginStatus200', + 'origin_status_204' => 'getOriginStatus204', + 'origin_status_206' => 'getOriginStatus206', + 'origin_status_301' => 'getOriginStatus301', + 'origin_status_302' => 'getOriginStatus302', + 'origin_status_304' => 'getOriginStatus304', + 'origin_status_400' => 'getOriginStatus400', + 'origin_status_401' => 'getOriginStatus401', + 'origin_status_403' => 'getOriginStatus403', + 'origin_status_404' => 'getOriginStatus404', + 'origin_status_416' => 'getOriginStatus416', + 'origin_status_429' => 'getOriginStatus429', + 'origin_status_500' => 'getOriginStatus500', + 'origin_status_501' => 'getOriginStatus501', + 'origin_status_502' => 'getOriginStatus502', + 'origin_status_503' => 'getOriginStatus503', + 'origin_status_504' => 'getOriginStatus504', + 'origin_status_505' => 'getOriginStatus505', + 'origin_status_1xx' => 'getOriginStatus1xx', + 'origin_status_2xx' => 'getOriginStatus2xx', + 'origin_status_3xx' => 'getOriginStatus3xx', + 'origin_status_4xx' => 'getOriginStatus4xx', + 'origin_status_5xx' => 'getOriginStatus5xx' + ]; + + /** + * 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['edge_requests'] = $data['edge_requests'] ?? null; + $this->container['edge_resp_header_bytes'] = $data['edge_resp_header_bytes'] ?? null; + $this->container['edge_resp_body_bytes'] = $data['edge_resp_body_bytes'] ?? null; + $this->container['status_1xx'] = $data['status_1xx'] ?? null; + $this->container['status_2xx'] = $data['status_2xx'] ?? null; + $this->container['status_3xx'] = $data['status_3xx'] ?? null; + $this->container['status_4xx'] = $data['status_4xx'] ?? null; + $this->container['status_5xx'] = $data['status_5xx'] ?? null; + $this->container['status_200'] = $data['status_200'] ?? null; + $this->container['status_204'] = $data['status_204'] ?? null; + $this->container['status_206'] = $data['status_206'] ?? null; + $this->container['status_301'] = $data['status_301'] ?? null; + $this->container['status_302'] = $data['status_302'] ?? null; + $this->container['status_304'] = $data['status_304'] ?? null; + $this->container['status_400'] = $data['status_400'] ?? null; + $this->container['status_401'] = $data['status_401'] ?? null; + $this->container['status_403'] = $data['status_403'] ?? null; + $this->container['status_404'] = $data['status_404'] ?? null; + $this->container['status_416'] = $data['status_416'] ?? null; + $this->container['status_429'] = $data['status_429'] ?? null; + $this->container['status_500'] = $data['status_500'] ?? null; + $this->container['status_501'] = $data['status_501'] ?? null; + $this->container['status_502'] = $data['status_502'] ?? null; + $this->container['status_503'] = $data['status_503'] ?? null; + $this->container['status_504'] = $data['status_504'] ?? null; + $this->container['status_505'] = $data['status_505'] ?? null; + $this->container['requests'] = $data['requests'] ?? null; + $this->container['resp_header_bytes'] = $data['resp_header_bytes'] ?? null; + $this->container['resp_body_bytes'] = $data['resp_body_bytes'] ?? null; + $this->container['bereq_header_bytes'] = $data['bereq_header_bytes'] ?? null; + $this->container['bereq_body_bytes'] = $data['bereq_body_bytes'] ?? null; + $this->container['edge_hit_requests'] = $data['edge_hit_requests'] ?? null; + $this->container['edge_miss_requests'] = $data['edge_miss_requests'] ?? null; + $this->container['origin_fetches'] = $data['origin_fetches'] ?? null; + $this->container['origin_fetch_resp_header_bytes'] = $data['origin_fetch_resp_header_bytes'] ?? null; + $this->container['origin_fetch_resp_body_bytes'] = $data['origin_fetch_resp_body_bytes'] ?? null; + $this->container['bandwidth'] = $data['bandwidth'] ?? null; + $this->container['edge_hit_ratio'] = $data['edge_hit_ratio'] ?? null; + $this->container['origin_offload'] = $data['origin_offload'] ?? null; + $this->container['origin_status_200'] = $data['origin_status_200'] ?? null; + $this->container['origin_status_204'] = $data['origin_status_204'] ?? null; + $this->container['origin_status_206'] = $data['origin_status_206'] ?? null; + $this->container['origin_status_301'] = $data['origin_status_301'] ?? null; + $this->container['origin_status_302'] = $data['origin_status_302'] ?? null; + $this->container['origin_status_304'] = $data['origin_status_304'] ?? null; + $this->container['origin_status_400'] = $data['origin_status_400'] ?? null; + $this->container['origin_status_401'] = $data['origin_status_401'] ?? null; + $this->container['origin_status_403'] = $data['origin_status_403'] ?? null; + $this->container['origin_status_404'] = $data['origin_status_404'] ?? null; + $this->container['origin_status_416'] = $data['origin_status_416'] ?? null; + $this->container['origin_status_429'] = $data['origin_status_429'] ?? null; + $this->container['origin_status_500'] = $data['origin_status_500'] ?? null; + $this->container['origin_status_501'] = $data['origin_status_501'] ?? null; + $this->container['origin_status_502'] = $data['origin_status_502'] ?? null; + $this->container['origin_status_503'] = $data['origin_status_503'] ?? null; + $this->container['origin_status_504'] = $data['origin_status_504'] ?? null; + $this->container['origin_status_505'] = $data['origin_status_505'] ?? null; + $this->container['origin_status_1xx'] = $data['origin_status_1xx'] ?? null; + $this->container['origin_status_2xx'] = $data['origin_status_2xx'] ?? null; + $this->container['origin_status_3xx'] = $data['origin_status_3xx'] ?? null; + $this->container['origin_status_4xx'] = $data['origin_status_4xx'] ?? null; + $this->container['origin_status_5xx'] = $data['origin_status_5xx'] ?? 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 edge_requests + * + * @return int|null + */ + public function getEdgeRequests() + { + return $this->container['edge_requests']; + } + + /** + * Sets edge_requests + * + * @param int|null $edge_requests Number of requests sent by end users to Fastly. + * + * @return self + */ + public function setEdgeRequests($edge_requests) + { + $this->container['edge_requests'] = $edge_requests; + + return $this; + } + + /** + * Gets edge_resp_header_bytes + * + * @return int|null + */ + public function getEdgeRespHeaderBytes() + { + return $this->container['edge_resp_header_bytes']; + } + + /** + * Sets edge_resp_header_bytes + * + * @param int|null $edge_resp_header_bytes Total header bytes delivered from Fastly to the end user. + * + * @return self + */ + public function setEdgeRespHeaderBytes($edge_resp_header_bytes) + { + $this->container['edge_resp_header_bytes'] = $edge_resp_header_bytes; + + return $this; + } + + /** + * Gets edge_resp_body_bytes + * + * @return int|null + */ + public function getEdgeRespBodyBytes() + { + return $this->container['edge_resp_body_bytes']; + } + + /** + * Sets edge_resp_body_bytes + * + * @param int|null $edge_resp_body_bytes Total body bytes delivered from Fastly to the end user. + * + * @return self + */ + public function setEdgeRespBodyBytes($edge_resp_body_bytes) + { + $this->container['edge_resp_body_bytes'] = $edge_resp_body_bytes; + + return $this; + } + + /** + * Gets status_1xx + * + * @return int|null + */ + public function getStatus1xx() + { + return $this->container['status_1xx']; + } + + /** + * Sets status_1xx + * + * @param int|null $status_1xx Number of 1xx \"Informational\" category status codes delivered. + * + * @return self + */ + public function setStatus1xx($status_1xx) + { + $this->container['status_1xx'] = $status_1xx; + + return $this; + } + + /** + * Gets status_2xx + * + * @return int|null + */ + public function getStatus2xx() + { + return $this->container['status_2xx']; + } + + /** + * Sets status_2xx + * + * @param int|null $status_2xx Number of 2xx \"Success\" status codes delivered. + * + * @return self + */ + public function setStatus2xx($status_2xx) + { + $this->container['status_2xx'] = $status_2xx; + + return $this; + } + + /** + * Gets status_3xx + * + * @return int|null + */ + public function getStatus3xx() + { + return $this->container['status_3xx']; + } + + /** + * Sets status_3xx + * + * @param int|null $status_3xx Number of 3xx \"Redirection\" codes delivered. + * + * @return self + */ + public function setStatus3xx($status_3xx) + { + $this->container['status_3xx'] = $status_3xx; + + return $this; + } + + /** + * Gets status_4xx + * + * @return int|null + */ + public function getStatus4xx() + { + return $this->container['status_4xx']; + } + + /** + * Sets status_4xx + * + * @param int|null $status_4xx Number of 4xx \"Client Error\" codes delivered. + * + * @return self + */ + public function setStatus4xx($status_4xx) + { + $this->container['status_4xx'] = $status_4xx; + + return $this; + } + + /** + * Gets status_5xx + * + * @return int|null + */ + public function getStatus5xx() + { + return $this->container['status_5xx']; + } + + /** + * Sets status_5xx + * + * @param int|null $status_5xx Number of 5xx \"Server Error\" codes delivered. + * + * @return self + */ + public function setStatus5xx($status_5xx) + { + $this->container['status_5xx'] = $status_5xx; + + return $this; + } + + /** + * Gets status_200 + * + * @return int|null + */ + public function getStatus200() + { + return $this->container['status_200']; + } + + /** + * Sets status_200 + * + * @param int|null $status_200 Number of responses delivered with status code 200 (Success). + * + * @return self + */ + public function setStatus200($status_200) + { + $this->container['status_200'] = $status_200; + + return $this; + } + + /** + * Gets status_204 + * + * @return int|null + */ + public function getStatus204() + { + return $this->container['status_204']; + } + + /** + * Sets status_204 + * + * @param int|null $status_204 Number of responses delivered with status code 204 (No Content). + * + * @return self + */ + public function setStatus204($status_204) + { + $this->container['status_204'] = $status_204; + + return $this; + } + + /** + * Gets status_206 + * + * @return int|null + */ + public function getStatus206() + { + return $this->container['status_206']; + } + + /** + * Sets status_206 + * + * @param int|null $status_206 Number of responses delivered with status code 206 (Partial Content). + * + * @return self + */ + public function setStatus206($status_206) + { + $this->container['status_206'] = $status_206; + + return $this; + } + + /** + * Gets status_301 + * + * @return int|null + */ + public function getStatus301() + { + return $this->container['status_301']; + } + + /** + * Sets status_301 + * + * @param int|null $status_301 Number of responses delivered with status code 301 (Moved Permanently). + * + * @return self + */ + public function setStatus301($status_301) + { + $this->container['status_301'] = $status_301; + + return $this; + } + + /** + * Gets status_302 + * + * @return int|null + */ + public function getStatus302() + { + return $this->container['status_302']; + } + + /** + * Sets status_302 + * + * @param int|null $status_302 Number of responses delivered with status code 302 (Found). + * + * @return self + */ + public function setStatus302($status_302) + { + $this->container['status_302'] = $status_302; + + return $this; + } + + /** + * Gets status_304 + * + * @return int|null + */ + public function getStatus304() + { + return $this->container['status_304']; + } + + /** + * Sets status_304 + * + * @param int|null $status_304 Number of responses delivered with status code 304 (Not Modified). + * + * @return self + */ + public function setStatus304($status_304) + { + $this->container['status_304'] = $status_304; + + return $this; + } + + /** + * Gets status_400 + * + * @return int|null + */ + public function getStatus400() + { + return $this->container['status_400']; + } + + /** + * Sets status_400 + * + * @param int|null $status_400 Number of responses delivered with status code 400 (Bad Request). + * + * @return self + */ + public function setStatus400($status_400) + { + $this->container['status_400'] = $status_400; + + return $this; + } + + /** + * Gets status_401 + * + * @return int|null + */ + public function getStatus401() + { + return $this->container['status_401']; + } + + /** + * Sets status_401 + * + * @param int|null $status_401 Number of responses delivered with status code 401 (Unauthorized). + * + * @return self + */ + public function setStatus401($status_401) + { + $this->container['status_401'] = $status_401; + + return $this; + } + + /** + * Gets status_403 + * + * @return int|null + */ + public function getStatus403() + { + return $this->container['status_403']; + } + + /** + * Sets status_403 + * + * @param int|null $status_403 Number of responses delivered with status code 403 (Forbidden). + * + * @return self + */ + public function setStatus403($status_403) + { + $this->container['status_403'] = $status_403; + + return $this; + } + + /** + * Gets status_404 + * + * @return int|null + */ + public function getStatus404() + { + return $this->container['status_404']; + } + + /** + * Sets status_404 + * + * @param int|null $status_404 Number of responses delivered with status code 404 (Not Found). + * + * @return self + */ + public function setStatus404($status_404) + { + $this->container['status_404'] = $status_404; + + return $this; + } + + /** + * Gets status_416 + * + * @return int|null + */ + public function getStatus416() + { + return $this->container['status_416']; + } + + /** + * Sets status_416 + * + * @param int|null $status_416 Number of responses delivered with status code 416 (Range Not Satisfiable). + * + * @return self + */ + public function setStatus416($status_416) + { + $this->container['status_416'] = $status_416; + + return $this; + } + + /** + * Gets status_429 + * + * @return int|null + */ + public function getStatus429() + { + return $this->container['status_429']; + } + + /** + * Sets status_429 + * + * @param int|null $status_429 Number of responses delivered with status code 429 (Too Many Requests). + * + * @return self + */ + public function setStatus429($status_429) + { + $this->container['status_429'] = $status_429; + + return $this; + } + + /** + * Gets status_500 + * + * @return int|null + */ + public function getStatus500() + { + return $this->container['status_500']; + } + + /** + * Sets status_500 + * + * @param int|null $status_500 Number of responses delivered with status code 500 (Internal Server Error). + * + * @return self + */ + public function setStatus500($status_500) + { + $this->container['status_500'] = $status_500; + + return $this; + } + + /** + * Gets status_501 + * + * @return int|null + */ + public function getStatus501() + { + return $this->container['status_501']; + } + + /** + * Sets status_501 + * + * @param int|null $status_501 Number of responses delivered with status code 501 (Not Implemented). + * + * @return self + */ + public function setStatus501($status_501) + { + $this->container['status_501'] = $status_501; + + return $this; + } + + /** + * Gets status_502 + * + * @return int|null + */ + public function getStatus502() + { + return $this->container['status_502']; + } + + /** + * Sets status_502 + * + * @param int|null $status_502 Number of responses delivered with status code 502 (Bad Gateway). + * + * @return self + */ + public function setStatus502($status_502) + { + $this->container['status_502'] = $status_502; + + return $this; + } + + /** + * Gets status_503 + * + * @return int|null + */ + public function getStatus503() + { + return $this->container['status_503']; + } + + /** + * Sets status_503 + * + * @param int|null $status_503 Number of responses delivered with status code 503 (Service Unavailable). + * + * @return self + */ + public function setStatus503($status_503) + { + $this->container['status_503'] = $status_503; + + return $this; + } + + /** + * Gets status_504 + * + * @return int|null + */ + public function getStatus504() + { + return $this->container['status_504']; + } + + /** + * Sets status_504 + * + * @param int|null $status_504 Number of responses delivered with status code 504 (Gateway Timeout). + * + * @return self + */ + public function setStatus504($status_504) + { + $this->container['status_504'] = $status_504; + + return $this; + } + + /** + * Gets status_505 + * + * @return int|null + */ + public function getStatus505() + { + return $this->container['status_505']; + } + + /** + * Sets status_505 + * + * @param int|null $status_505 Number of responses delivered with status code 505 (HTTP Version Not Supported). + * + * @return self + */ + public function setStatus505($status_505) + { + $this->container['status_505'] = $status_505; + + return $this; + } + + /** + * Gets requests + * + * @return int|null + */ + public function getRequests() + { + return $this->container['requests']; + } + + /** + * Sets requests + * + * @param int|null $requests Number of requests processed. + * + * @return self + */ + public function setRequests($requests) + { + $this->container['requests'] = $requests; + + return $this; + } + + /** + * Gets resp_header_bytes + * + * @return int|null + */ + public function getRespHeaderBytes() + { + return $this->container['resp_header_bytes']; + } + + /** + * Sets resp_header_bytes + * + * @param int|null $resp_header_bytes Total header bytes delivered. + * + * @return self + */ + public function setRespHeaderBytes($resp_header_bytes) + { + $this->container['resp_header_bytes'] = $resp_header_bytes; + + return $this; + } + + /** + * Gets resp_body_bytes + * + * @return int|null + */ + public function getRespBodyBytes() + { + return $this->container['resp_body_bytes']; + } + + /** + * Sets resp_body_bytes + * + * @param int|null $resp_body_bytes Total body bytes delivered. + * + * @return self + */ + public function setRespBodyBytes($resp_body_bytes) + { + $this->container['resp_body_bytes'] = $resp_body_bytes; + + return $this; + } + + /** + * Gets bereq_header_bytes + * + * @return int|null + */ + public function getBereqHeaderBytes() + { + return $this->container['bereq_header_bytes']; + } + + /** + * Sets bereq_header_bytes + * + * @param int|null $bereq_header_bytes Total header bytes sent to origin. + * + * @return self + */ + public function setBereqHeaderBytes($bereq_header_bytes) + { + $this->container['bereq_header_bytes'] = $bereq_header_bytes; + + return $this; + } + + /** + * Gets bereq_body_bytes + * + * @return int|null + */ + public function getBereqBodyBytes() + { + return $this->container['bereq_body_bytes']; + } + + /** + * Sets bereq_body_bytes + * + * @param int|null $bereq_body_bytes Total body bytes sent to origin. + * + * @return self + */ + public function setBereqBodyBytes($bereq_body_bytes) + { + $this->container['bereq_body_bytes'] = $bereq_body_bytes; + + return $this; + } + + /** + * Gets edge_hit_requests + * + * @return int|null + */ + public function getEdgeHitRequests() + { + return $this->container['edge_hit_requests']; + } + + /** + * Sets edge_hit_requests + * + * @param int|null $edge_hit_requests Number of requests sent by end users to Fastly that resulted in a hit at the edge. + * + * @return self + */ + public function setEdgeHitRequests($edge_hit_requests) + { + $this->container['edge_hit_requests'] = $edge_hit_requests; + + return $this; + } + + /** + * Gets edge_miss_requests + * + * @return int|null + */ + public function getEdgeMissRequests() + { + return $this->container['edge_miss_requests']; + } + + /** + * Sets edge_miss_requests + * + * @param int|null $edge_miss_requests Number of requests sent by end users to Fastly that resulted in a miss at the edge. + * + * @return self + */ + public function setEdgeMissRequests($edge_miss_requests) + { + $this->container['edge_miss_requests'] = $edge_miss_requests; + + return $this; + } + + /** + * Gets origin_fetches + * + * @return int|null + */ + public function getOriginFetches() + { + return $this->container['origin_fetches']; + } + + /** + * Sets origin_fetches + * + * @param int|null $origin_fetches Number of requests sent to origin. + * + * @return self + */ + public function setOriginFetches($origin_fetches) + { + $this->container['origin_fetches'] = $origin_fetches; + + return $this; + } + + /** + * Gets origin_fetch_resp_header_bytes + * + * @return int|null + */ + public function getOriginFetchRespHeaderBytes() + { + return $this->container['origin_fetch_resp_header_bytes']; + } + + /** + * Sets origin_fetch_resp_header_bytes + * + * @param int|null $origin_fetch_resp_header_bytes Total header bytes received from origin. + * + * @return self + */ + public function setOriginFetchRespHeaderBytes($origin_fetch_resp_header_bytes) + { + $this->container['origin_fetch_resp_header_bytes'] = $origin_fetch_resp_header_bytes; + + return $this; + } + + /** + * Gets origin_fetch_resp_body_bytes + * + * @return int|null + */ + public function getOriginFetchRespBodyBytes() + { + return $this->container['origin_fetch_resp_body_bytes']; + } + + /** + * Sets origin_fetch_resp_body_bytes + * + * @param int|null $origin_fetch_resp_body_bytes Total body bytes received from origin. + * + * @return self + */ + public function setOriginFetchRespBodyBytes($origin_fetch_resp_body_bytes) + { + $this->container['origin_fetch_resp_body_bytes'] = $origin_fetch_resp_body_bytes; + + return $this; + } + + /** + * Gets bandwidth + * + * @return int|null + */ + public function getBandwidth() + { + return $this->container['bandwidth']; + } + + /** + * Sets bandwidth + * + * @param int|null $bandwidth Total bytes delivered (`resp_header_bytes` + `resp_body_bytes` + `bereq_header_bytes` + `bereq_body_bytes`). + * + * @return self + */ + public function setBandwidth($bandwidth) + { + $this->container['bandwidth'] = $bandwidth; + + return $this; + } + + /** + * Gets edge_hit_ratio + * + * @return float|null + */ + public function getEdgeHitRatio() + { + return $this->container['edge_hit_ratio']; + } + + /** + * Sets edge_hit_ratio + * + * @param float|null $edge_hit_ratio Ratio of cache hits to cache misses at the edge, between 0 and 1 (`edge_hit_requests` / (`edge_hit_requests` + `edge_miss_requests`)). + * + * @return self + */ + public function setEdgeHitRatio($edge_hit_ratio) + { + $this->container['edge_hit_ratio'] = $edge_hit_ratio; + + return $this; + } + + /** + * Gets origin_offload + * + * @return float|null + */ + public function getOriginOffload() + { + return $this->container['origin_offload']; + } + + /** + * 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`). + * + * @return self + */ + public function setOriginOffload($origin_offload) + { + $this->container['origin_offload'] = $origin_offload; + + return $this; + } + + /** + * Gets origin_status_200 + * + * @return int|null + */ + public function getOriginStatus200() + { + return $this->container['origin_status_200']; + } + + /** + * Sets origin_status_200 + * + * @param int|null $origin_status_200 Number of responses received from origin with status code 200 (Success). + * + * @return self + */ + public function setOriginStatus200($origin_status_200) + { + $this->container['origin_status_200'] = $origin_status_200; + + return $this; + } + + /** + * Gets origin_status_204 + * + * @return int|null + */ + public function getOriginStatus204() + { + return $this->container['origin_status_204']; + } + + /** + * Sets origin_status_204 + * + * @param int|null $origin_status_204 Number of responses received from origin with status code 204 (No Content). + * + * @return self + */ + public function setOriginStatus204($origin_status_204) + { + $this->container['origin_status_204'] = $origin_status_204; + + return $this; + } + + /** + * Gets origin_status_206 + * + * @return int|null + */ + public function getOriginStatus206() + { + return $this->container['origin_status_206']; + } + + /** + * Sets origin_status_206 + * + * @param int|null $origin_status_206 Number of responses received from origin with status code 206 (Partial Content). + * + * @return self + */ + public function setOriginStatus206($origin_status_206) + { + $this->container['origin_status_206'] = $origin_status_206; + + return $this; + } + + /** + * Gets origin_status_301 + * + * @return int|null + */ + public function getOriginStatus301() + { + return $this->container['origin_status_301']; + } + + /** + * Sets origin_status_301 + * + * @param int|null $origin_status_301 Number of responses received from origin with status code 301 (Moved Permanently). + * + * @return self + */ + public function setOriginStatus301($origin_status_301) + { + $this->container['origin_status_301'] = $origin_status_301; + + return $this; + } + + /** + * Gets origin_status_302 + * + * @return int|null + */ + public function getOriginStatus302() + { + return $this->container['origin_status_302']; + } + + /** + * Sets origin_status_302 + * + * @param int|null $origin_status_302 Number of responses received from origin with status code 302 (Found). + * + * @return self + */ + public function setOriginStatus302($origin_status_302) + { + $this->container['origin_status_302'] = $origin_status_302; + + return $this; + } + + /** + * Gets origin_status_304 + * + * @return int|null + */ + public function getOriginStatus304() + { + return $this->container['origin_status_304']; + } + + /** + * Sets origin_status_304 + * + * @param int|null $origin_status_304 Number of responses received from origin with status code 304 (Not Modified). + * + * @return self + */ + public function setOriginStatus304($origin_status_304) + { + $this->container['origin_status_304'] = $origin_status_304; + + return $this; + } + + /** + * Gets origin_status_400 + * + * @return int|null + */ + public function getOriginStatus400() + { + return $this->container['origin_status_400']; + } + + /** + * Sets origin_status_400 + * + * @param int|null $origin_status_400 Number of responses received from origin with status code 400 (Bad Request). + * + * @return self + */ + public function setOriginStatus400($origin_status_400) + { + $this->container['origin_status_400'] = $origin_status_400; + + return $this; + } + + /** + * Gets origin_status_401 + * + * @return int|null + */ + public function getOriginStatus401() + { + return $this->container['origin_status_401']; + } + + /** + * Sets origin_status_401 + * + * @param int|null $origin_status_401 Number of responses received from origin with status code 401 (Unauthorized). + * + * @return self + */ + public function setOriginStatus401($origin_status_401) + { + $this->container['origin_status_401'] = $origin_status_401; + + return $this; + } + + /** + * Gets origin_status_403 + * + * @return int|null + */ + public function getOriginStatus403() + { + return $this->container['origin_status_403']; + } + + /** + * Sets origin_status_403 + * + * @param int|null $origin_status_403 Number of responses received from origin with status code 403 (Forbidden). + * + * @return self + */ + public function setOriginStatus403($origin_status_403) + { + $this->container['origin_status_403'] = $origin_status_403; + + return $this; + } + + /** + * Gets origin_status_404 + * + * @return int|null + */ + public function getOriginStatus404() + { + return $this->container['origin_status_404']; + } + + /** + * Sets origin_status_404 + * + * @param int|null $origin_status_404 Number of responses received from origin with status code 404 (Not Found). + * + * @return self + */ + public function setOriginStatus404($origin_status_404) + { + $this->container['origin_status_404'] = $origin_status_404; + + return $this; + } + + /** + * Gets origin_status_416 + * + * @return int|null + */ + public function getOriginStatus416() + { + return $this->container['origin_status_416']; + } + + /** + * Sets origin_status_416 + * + * @param int|null $origin_status_416 Number of responses received from origin with status code 416 (Range Not Satisfiable). + * + * @return self + */ + public function setOriginStatus416($origin_status_416) + { + $this->container['origin_status_416'] = $origin_status_416; + + return $this; + } + + /** + * Gets origin_status_429 + * + * @return int|null + */ + public function getOriginStatus429() + { + return $this->container['origin_status_429']; + } + + /** + * Sets origin_status_429 + * + * @param int|null $origin_status_429 Number of responses received from origin with status code 429 (Too Many Requests). + * + * @return self + */ + public function setOriginStatus429($origin_status_429) + { + $this->container['origin_status_429'] = $origin_status_429; + + return $this; + } + + /** + * Gets origin_status_500 + * + * @return int|null + */ + public function getOriginStatus500() + { + return $this->container['origin_status_500']; + } + + /** + * Sets origin_status_500 + * + * @param int|null $origin_status_500 Number of responses received from origin with status code 500 (Internal Server Error). + * + * @return self + */ + public function setOriginStatus500($origin_status_500) + { + $this->container['origin_status_500'] = $origin_status_500; + + return $this; + } + + /** + * Gets origin_status_501 + * + * @return int|null + */ + public function getOriginStatus501() + { + return $this->container['origin_status_501']; + } + + /** + * Sets origin_status_501 + * + * @param int|null $origin_status_501 Number of responses received from origin with status code 501 (Not Implemented). + * + * @return self + */ + public function setOriginStatus501($origin_status_501) + { + $this->container['origin_status_501'] = $origin_status_501; + + return $this; + } + + /** + * Gets origin_status_502 + * + * @return int|null + */ + public function getOriginStatus502() + { + return $this->container['origin_status_502']; + } + + /** + * Sets origin_status_502 + * + * @param int|null $origin_status_502 Number of responses received from origin with status code 502 (Bad Gateway). + * + * @return self + */ + public function setOriginStatus502($origin_status_502) + { + $this->container['origin_status_502'] = $origin_status_502; + + return $this; + } + + /** + * Gets origin_status_503 + * + * @return int|null + */ + public function getOriginStatus503() + { + return $this->container['origin_status_503']; + } + + /** + * Sets origin_status_503 + * + * @param int|null $origin_status_503 Number of responses received from origin with status code 503 (Service Unavailable). + * + * @return self + */ + public function setOriginStatus503($origin_status_503) + { + $this->container['origin_status_503'] = $origin_status_503; + + return $this; + } + + /** + * Gets origin_status_504 + * + * @return int|null + */ + public function getOriginStatus504() + { + return $this->container['origin_status_504']; + } + + /** + * Sets origin_status_504 + * + * @param int|null $origin_status_504 Number of responses received from origin with status code 504 (Gateway Timeout). + * + * @return self + */ + public function setOriginStatus504($origin_status_504) + { + $this->container['origin_status_504'] = $origin_status_504; + + return $this; + } + + /** + * Gets origin_status_505 + * + * @return int|null + */ + public function getOriginStatus505() + { + return $this->container['origin_status_505']; + } + + /** + * Sets origin_status_505 + * + * @param int|null $origin_status_505 Number of responses received from origin with status code 505 (HTTP Version Not Supported). + * + * @return self + */ + public function setOriginStatus505($origin_status_505) + { + $this->container['origin_status_505'] = $origin_status_505; + + return $this; + } + + /** + * Gets origin_status_1xx + * + * @return int|null + */ + public function getOriginStatus1xx() + { + return $this->container['origin_status_1xx']; + } + + /** + * Sets origin_status_1xx + * + * @param int|null $origin_status_1xx Number of \"Informational\" category status codes received from origin. + * + * @return self + */ + public function setOriginStatus1xx($origin_status_1xx) + { + $this->container['origin_status_1xx'] = $origin_status_1xx; + + return $this; + } + + /** + * Gets origin_status_2xx + * + * @return int|null + */ + public function getOriginStatus2xx() + { + return $this->container['origin_status_2xx']; + } + + /** + * Sets origin_status_2xx + * + * @param int|null $origin_status_2xx Number of \"Success\" status codes received from origin. + * + * @return self + */ + public function setOriginStatus2xx($origin_status_2xx) + { + $this->container['origin_status_2xx'] = $origin_status_2xx; + + return $this; + } + + /** + * Gets origin_status_3xx + * + * @return int|null + */ + public function getOriginStatus3xx() + { + return $this->container['origin_status_3xx']; + } + + /** + * Sets origin_status_3xx + * + * @param int|null $origin_status_3xx Number of \"Redirection\" codes received from origin. + * + * @return self + */ + public function setOriginStatus3xx($origin_status_3xx) + { + $this->container['origin_status_3xx'] = $origin_status_3xx; + + return $this; + } + + /** + * Gets origin_status_4xx + * + * @return int|null + */ + public function getOriginStatus4xx() + { + return $this->container['origin_status_4xx']; + } + + /** + * Sets origin_status_4xx + * + * @param int|null $origin_status_4xx Number of \"Client Error\" codes received from origin. + * + * @return self + */ + public function setOriginStatus4xx($origin_status_4xx) + { + $this->container['origin_status_4xx'] = $origin_status_4xx; + + return $this; + } + + /** + * Gets origin_status_5xx + * + * @return int|null + */ + public function getOriginStatus5xx() + { + return $this->container['origin_status_5xx']; + } + + /** + * Sets origin_status_5xx + * + * @param int|null $origin_status_5xx Number of \"Server Error\" codes received from origin. + * + * @return self + */ + public function setOriginStatus5xx($origin_status_5xx) + { + $this->container['origin_status_5xx'] = $origin_status_5xx; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/DomainInspectorRealtimeEntry.php b/lib/Model/DomainInspectorRealtimeEntry.php new file mode 100644 index 00000000..b5f102af --- /dev/null +++ b/lib/Model/DomainInspectorRealtimeEntry.php @@ -0,0 +1,375 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DomainInspectorRealtimeEntry implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'domain_inspector_realtime_entry'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'recorded' => '\Fastly\Model\RecordedTimestamp', + 'aggregated' => 'array', + 'datacenter' => 'array>' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'recorded' => null, + 'aggregated' => null, + 'datacenter' => 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 = [ + 'recorded' => 'recorded', + 'aggregated' => 'aggregated', + 'datacenter' => 'datacenter' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'recorded' => 'setRecorded', + 'aggregated' => 'setAggregated', + 'datacenter' => 'setDatacenter' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'recorded' => 'getRecorded', + 'aggregated' => 'getAggregated', + 'datacenter' => 'getDatacenter' + ]; + + /** + * 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['recorded'] = $data['recorded'] ?? null; + $this->container['aggregated'] = $data['aggregated'] ?? null; + $this->container['datacenter'] = $data['datacenter'] ?? 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 recorded + * + * @return \Fastly\Model\RecordedTimestamp|null + */ + public function getRecorded() + { + return $this->container['recorded']; + } + + /** + * Sets recorded + * + * @param \Fastly\Model\RecordedTimestamp|null $recorded recorded + * + * @return self + */ + public function setRecorded($recorded) + { + $this->container['recorded'] = $recorded; + + return $this; + } + + /** + * Gets aggregated + * + * @return array|null + */ + public function getAggregated() + { + return $this->container['aggregated']; + } + + /** + * Sets aggregated + * + * @param array|null $aggregated Groups [measurements](#measurements-data-model) by backend name and then by IP address. + * + * @return self + */ + public function setAggregated($aggregated) + { + $this->container['aggregated'] = $aggregated; + + return $this; + } + + /** + * Gets datacenter + * + * @return array>|null + */ + public function getDatacenter() + { + return $this->container['datacenter']; + } + + /** + * Sets datacenter + * + * @param array>|null $datacenter Groups [measurements](#measurements-data-model) by POP, then backend name, and then IP address. See the [POPs API](/reference/api/utils/pops/) for details about POP identifiers. + * + * @return self + */ + public function setDatacenter($datacenter) + { + $this->container['datacenter'] = $datacenter; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/EventAttributes.php b/lib/Model/EventAttributes.php index 7c31758c..c32fc282 100644 --- a/lib/Model/EventAttributes.php +++ b/lib/Model/EventAttributes.php @@ -59,7 +59,7 @@ class EventAttributes implements ModelInterface, ArrayAccess, \JsonSerializable 'description' => 'string', 'event_type' => 'string', 'ip' => 'string', - 'metadata' => 'object', + 'metadata' => 'array', 'service_id' => 'string', 'user_id' => 'string', 'token_id' => 'string' @@ -684,7 +684,7 @@ public function setIp($ip) /** * Gets metadata * - * @return object|null + * @return array|null */ public function getMetadata() { @@ -694,7 +694,7 @@ public function getMetadata() /** * Sets metadata * - * @param object|null $metadata Hash of key value pairs of additional information. + * @param array|null $metadata Hash of key value pairs of additional information. * * @return self */ diff --git a/lib/Model/EventsResponseAllOf.php b/lib/Model/EventData.php similarity index 96% rename from lib/Model/EventsResponseAllOf.php rename to lib/Model/EventData.php index b78de988..b46b29b6 100644 --- a/lib/Model/EventsResponseAllOf.php +++ b/lib/Model/EventData.php @@ -1,6 +1,6 @@ + * @template TKey int|null + * @template TValue mixed|null + */ +class HistoricalDomains implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'historical_domains'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'status' => 'string', + 'meta' => '\Fastly\Model\HistoricalDomainsMeta', + 'msg' => 'string', + 'data' => '\Fastly\Model\HistoricalDomainsData[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'status' => null, + 'meta' => null, + 'msg' => null, + '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 = [ + 'status' => 'status', + 'meta' => 'meta', + 'msg' => 'msg', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'meta' => 'setMeta', + 'msg' => 'setMsg', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'meta' => 'getMeta', + 'msg' => 'getMsg', + '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['status'] = $data['status'] ?? null; + $this->container['meta'] = $data['meta'] ?? null; + $this->container['msg'] = $data['msg'] ?? 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 status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status Whether or not we were able to successfully execute the query. + * + * @return self + */ + public function setStatus($status) + { + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets meta + * + * @return \Fastly\Model\HistoricalDomainsMeta|null + */ + public function getMeta() + { + return $this->container['meta']; + } + + /** + * Sets meta + * + * @param \Fastly\Model\HistoricalDomainsMeta|null $meta meta + * + * @return self + */ + public function setMeta($meta) + { + $this->container['meta'] = $meta; + + return $this; + } + + /** + * Gets msg + * + * @return string|null + */ + public function getMsg() + { + return $this->container['msg']; + } + + /** + * Sets msg + * + * @param string|null $msg If the query was not successful, this will provide a string that explains why. + * + * @return self + */ + public function setMsg($msg) + { + $this->container['msg'] = $msg; + + return $this; + } + + /** + * Gets data + * + * @return \Fastly\Model\HistoricalDomainsData[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Fastly\Model\HistoricalDomainsData[]|null $data A list of [entries](#entry-data-model), each representing one unique combination of dimensions, such as domain, region, or POP. + * + * @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) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/HistoricalDomainsData.php b/lib/Model/HistoricalDomainsData.php new file mode 100644 index 00000000..74bf6eaa --- /dev/null +++ b/lib/Model/HistoricalDomainsData.php @@ -0,0 +1,344 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class HistoricalDomainsData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'historical_domains_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'dimensions' => '\Fastly\Model\DomainInspectorEntryDimensions', + 'values' => '\Fastly\Model\Values[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'dimensions' => null, + 'values' => 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 = [ + 'dimensions' => 'dimensions', + 'values' => 'values' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'dimensions' => 'setDimensions', + 'values' => 'setValues' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'dimensions' => 'getDimensions', + 'values' => 'getValues' + ]; + + /** + * 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['dimensions'] = $data['dimensions'] ?? null; + $this->container['values'] = $data['values'] ?? 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 dimensions + * + * @return \Fastly\Model\DomainInspectorEntryDimensions|null + */ + public function getDimensions() + { + return $this->container['dimensions']; + } + + /** + * Sets dimensions + * + * @param \Fastly\Model\DomainInspectorEntryDimensions|null $dimensions dimensions + * + * @return self + */ + public function setDimensions($dimensions) + { + $this->container['dimensions'] = $dimensions; + + return $this; + } + + /** + * Gets values + * + * @return \Fastly\Model\Values[]|null + */ + public function getValues() + { + return $this->container['values']; + } + + /** + * Sets values + * + * @param \Fastly\Model\Values[]|null $values An array of values representing the metric values at each point in time. Note that this dataset is sparse: only the keys with non-zero values will be included in the record. + * + * @return self + */ + public function setValues($values) + { + $this->container['values'] = $values; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/HistoricalDomainsMeta.php b/lib/Model/HistoricalDomainsMeta.php new file mode 100644 index 00000000..c98a6d86 --- /dev/null +++ b/lib/Model/HistoricalDomainsMeta.php @@ -0,0 +1,555 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class HistoricalDomainsMeta implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'historical_domains_meta'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'start' => 'string', + 'end' => 'string', + 'downsample' => 'string', + 'metrics' => 'string', + 'limit' => 'float', + 'next_cursor' => 'string', + 'sort' => 'string', + 'group_by' => 'string', + 'filters' => '\Fastly\Model\HistoricalDomainsMetaFilters' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'start' => null, + 'end' => null, + 'downsample' => null, + 'metrics' => null, + 'limit' => null, + 'next_cursor' => null, + 'sort' => null, + 'group_by' => null, + 'filters' => 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 = [ + 'start' => 'start', + 'end' => 'end', + 'downsample' => 'downsample', + 'metrics' => 'metrics', + 'limit' => 'limit', + 'next_cursor' => 'next_cursor', + 'sort' => 'sort', + 'group_by' => 'group_by', + 'filters' => 'filters' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'start' => 'setStart', + 'end' => 'setEnd', + 'downsample' => 'setDownsample', + 'metrics' => 'setMetrics', + 'limit' => 'setLimit', + 'next_cursor' => 'setNextCursor', + 'sort' => 'setSort', + 'group_by' => 'setGroupBy', + 'filters' => 'setFilters' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'start' => 'getStart', + 'end' => 'getEnd', + 'downsample' => 'getDownsample', + 'metrics' => 'getMetrics', + 'limit' => 'getLimit', + 'next_cursor' => 'getNextCursor', + 'sort' => 'getSort', + 'group_by' => 'getGroupBy', + 'filters' => 'getFilters' + ]; + + /** + * 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['start'] = $data['start'] ?? null; + $this->container['end'] = $data['end'] ?? null; + $this->container['downsample'] = $data['downsample'] ?? null; + $this->container['metrics'] = $data['metrics'] ?? null; + $this->container['limit'] = $data['limit'] ?? null; + $this->container['next_cursor'] = $data['next_cursor'] ?? null; + $this->container['sort'] = $data['sort'] ?? null; + $this->container['group_by'] = $data['group_by'] ?? null; + $this->container['filters'] = $data['filters'] ?? 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 start + * + * @return string|null + */ + public function getStart() + { + return $this->container['start']; + } + + /** + * Sets start + * + * @param string|null $start Start time that was used to perform the query as an ISO-8601-formatted date and time. + * + * @return self + */ + public function setStart($start) + { + $this->container['start'] = $start; + + return $this; + } + + /** + * Gets end + * + * @return string|null + */ + public function getEnd() + { + return $this->container['end']; + } + + /** + * Sets end + * + * @param string|null $end End time that was used to perform the query as an ISO-8601-formatted date and time. + * + * @return self + */ + public function setEnd($end) + { + $this->container['end'] = $end; + + return $this; + } + + /** + * Gets downsample + * + * @return string|null + */ + public function getDownsample() + { + return $this->container['downsample']; + } + + /** + * Sets downsample + * + * @param string|null $downsample Downsample that was used to perform the query. One of `minute`, `hour`, or `day`. + * + * @return self + */ + public function setDownsample($downsample) + { + $this->container['downsample'] = $downsample; + + return $this; + } + + /** + * Gets metrics + * + * @return string|null + */ + public function getMetrics() + { + return $this->container['metrics']; + } + + /** + * Sets metrics + * + * @param string|null $metrics A comma-separated list of the metrics that were requested. + * + * @return self + */ + public function setMetrics($metrics) + { + $this->container['metrics'] = $metrics; + + return $this; + } + + /** + * Gets limit + * + * @return float|null + */ + public function getLimit() + { + return $this->container['limit']; + } + + /** + * Sets limit + * + * @param float|null $limit The maximum number of results shown per page. + * + * @return self + */ + public function setLimit($limit) + { + $this->container['limit'] = $limit; + + return $this; + } + + /** + * Gets next_cursor + * + * @return string|null + */ + public function getNextCursor() + { + return $this->container['next_cursor']; + } + + /** + * Sets next_cursor + * + * @param string|null $next_cursor A string that can be used to request the next page of results, if any. + * + * @return self + */ + public function setNextCursor($next_cursor) + { + $this->container['next_cursor'] = $next_cursor; + + return $this; + } + + /** + * Gets sort + * + * @return string|null + */ + public function getSort() + { + return $this->container['sort']; + } + + /** + * Sets sort + * + * @param string|null $sort A comma-separated list of keys the results are sorted by. + * + * @return self + */ + public function setSort($sort) + { + $this->container['sort'] = $sort; + + return $this; + } + + /** + * Gets group_by + * + * @return string|null + */ + public function getGroupBy() + { + return $this->container['group_by']; + } + + /** + * Sets group_by + * + * @param string|null $group_by A comma-separated list of dimensions being summed over in the query. + * + * @return self + */ + public function setGroupBy($group_by) + { + $this->container['group_by'] = $group_by; + + return $this; + } + + /** + * Gets filters + * + * @return \Fastly\Model\HistoricalDomainsMetaFilters|null + */ + public function getFilters() + { + return $this->container['filters']; + } + + /** + * Sets filters + * + * @param \Fastly\Model\HistoricalDomainsMetaFilters|null $filters filters + * + * @return self + */ + public function setFilters($filters) + { + $this->container['filters'] = $filters; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/HistoricalDomainsMetaFilters.php b/lib/Model/HistoricalDomainsMetaFilters.php new file mode 100644 index 00000000..8b1ed3c9 --- /dev/null +++ b/lib/Model/HistoricalDomainsMetaFilters.php @@ -0,0 +1,375 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class HistoricalDomainsMetaFilters implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'historical_domains_meta_filters'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'region' => 'string', + 'datacenter' => 'string', + 'domain' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'region' => null, + 'datacenter' => null, + 'domain' => 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 = [ + 'region' => 'region', + 'datacenter' => 'datacenter', + 'domain' => 'domain' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'region' => 'setRegion', + 'datacenter' => 'setDatacenter', + 'domain' => 'setDomain' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'region' => 'getRegion', + 'datacenter' => 'getDatacenter', + 'domain' => 'getDomain' + ]; + + /** + * 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['region'] = $data['region'] ?? null; + $this->container['datacenter'] = $data['datacenter'] ?? null; + $this->container['domain'] = $data['domain'] ?? 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 region + * + * @return string|null + */ + public function getRegion() + { + return $this->container['region']; + } + + /** + * Sets region + * + * @param string|null $region region + * + * @return self + */ + public function setRegion($region) + { + $this->container['region'] = $region; + + return $this; + } + + /** + * Gets datacenter + * + * @return string|null + */ + public function getDatacenter() + { + return $this->container['datacenter']; + } + + /** + * Sets datacenter + * + * @param string|null $datacenter datacenter + * + * @return self + */ + public function setDatacenter($datacenter) + { + $this->container['datacenter'] = $datacenter; + + return $this; + } + + /** + * Gets domain + * + * @return string|null + */ + public function getDomain() + { + return $this->container['domain']; + } + + /** + * Sets domain + * + * @param string|null $domain domain + * + * @return self + */ + public function setDomain($domain) + { + $this->container['domain'] = $domain; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/HistoricalDomainsResponse.php b/lib/Model/HistoricalDomainsResponse.php new file mode 100644 index 00000000..57b3f309 --- /dev/null +++ b/lib/Model/HistoricalDomainsResponse.php @@ -0,0 +1,404 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class HistoricalDomainsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'historical_domains_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'status' => 'string', + 'meta' => '\Fastly\Model\HistoricalDomainsMeta', + 'msg' => 'string', + 'data' => '\Fastly\Model\DomainInspectorEntry[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'status' => null, + 'meta' => null, + 'msg' => null, + '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 = [ + 'status' => 'status', + 'meta' => 'meta', + 'msg' => 'msg', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'meta' => 'setMeta', + 'msg' => 'setMsg', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'meta' => 'getMeta', + 'msg' => 'getMsg', + '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['status'] = $data['status'] ?? null; + $this->container['meta'] = $data['meta'] ?? null; + $this->container['msg'] = $data['msg'] ?? 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 status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status Whether or not we were able to successfully execute the query. + * + * @return self + */ + public function setStatus($status) + { + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets meta + * + * @return \Fastly\Model\HistoricalDomainsMeta|null + */ + public function getMeta() + { + return $this->container['meta']; + } + + /** + * Sets meta + * + * @param \Fastly\Model\HistoricalDomainsMeta|null $meta meta + * + * @return self + */ + public function setMeta($meta) + { + $this->container['meta'] = $meta; + + return $this; + } + + /** + * Gets msg + * + * @return string|null + */ + public function getMsg() + { + return $this->container['msg']; + } + + /** + * Sets msg + * + * @param string|null $msg If the query was not successful, this will provide a string that explains why. + * + * @return self + */ + public function setMsg($msg) + { + $this->container['msg'] = $msg; + + return $this; + } + + /** + * Gets data + * + * @return \Fastly\Model\DomainInspectorEntry[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Fastly\Model\DomainInspectorEntry[]|null $data A list of timeseries. Each individual timeseries represents a unique combination of dimensions, such as domain, region or POP. + * + * @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) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/HistoricalDomainsResponseAllOf.php b/lib/Model/HistoricalDomainsResponseAllOf.php new file mode 100644 index 00000000..cf8ae074 --- /dev/null +++ b/lib/Model/HistoricalDomainsResponseAllOf.php @@ -0,0 +1,314 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class HistoricalDomainsResponseAllOf implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'historical_domains_response_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'data' => '\Fastly\Model\DomainInspectorEntry[]' + ]; + + /** + * 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\DomainInspectorEntry[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Fastly\Model\DomainInspectorEntry[]|null $data A list of timeseries. Each individual timeseries represents a unique combination of dimensions, such as domain, region or POP. + * + * @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) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/HistoricalFieldResultsAttributesAllOf.php b/lib/Model/HistoricalFieldResultsAttributesAdditional.php similarity index 96% rename from lib/Model/HistoricalFieldResultsAttributesAllOf.php rename to lib/Model/HistoricalFieldResultsAttributesAdditional.php index 8099f008..3b8ab9bd 100644 --- a/lib/Model/HistoricalFieldResultsAttributesAllOf.php +++ b/lib/Model/HistoricalFieldResultsAttributesAdditional.php @@ -1,6 +1,6 @@ + * @template TKey int|null + * @template TValue mixed|null + */ +class HistoricalOriginsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'historical_origins_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'status' => 'string', + 'meta' => '\Fastly\Model\OriginInspectorHistoricalMeta', + 'msg' => 'string', + 'data' => '\Fastly\Model\OriginInspectorEntry[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'status' => null, + 'meta' => null, + 'msg' => null, + '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 = [ + 'status' => 'status', + 'meta' => 'meta', + 'msg' => 'msg', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'meta' => 'setMeta', + 'msg' => 'setMsg', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'meta' => 'getMeta', + 'msg' => 'getMsg', + '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['status'] = $data['status'] ?? null; + $this->container['meta'] = $data['meta'] ?? null; + $this->container['msg'] = $data['msg'] ?? 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 status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status Whether or not we were able to successfully execute the query. + * + * @return self + */ + public function setStatus($status) + { + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets meta + * + * @return \Fastly\Model\OriginInspectorHistoricalMeta|null + */ + public function getMeta() + { + return $this->container['meta']; + } + + /** + * Sets meta + * + * @param \Fastly\Model\OriginInspectorHistoricalMeta|null $meta meta + * + * @return self + */ + public function setMeta($meta) + { + $this->container['meta'] = $meta; + + return $this; + } + + /** + * Gets msg + * + * @return string|null + */ + public function getMsg() + { + return $this->container['msg']; + } + + /** + * Sets msg + * + * @param string|null $msg If the query was not successful, this will provide a string that explains why. + * + * @return self + */ + public function setMsg($msg) + { + $this->container['msg'] = $msg; + + return $this; + } + + /** + * Gets data + * + * @return \Fastly\Model\OriginInspectorEntry[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Fastly\Model\OriginInspectorEntry[]|null $data A list of timeseries. Each individual timeseries represents a unique combination of dimensions, such as origin host, region or POP. + * + * @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) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/HistoricalOriginsResponseAllOf.php b/lib/Model/HistoricalOriginsResponseAllOf.php new file mode 100644 index 00000000..0e859a32 --- /dev/null +++ b/lib/Model/HistoricalOriginsResponseAllOf.php @@ -0,0 +1,314 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class HistoricalOriginsResponseAllOf implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'historical_origins_response_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'data' => '\Fastly\Model\OriginInspectorEntry[]' + ]; + + /** + * 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\OriginInspectorEntry[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Fastly\Model\OriginInspectorEntry[]|null $data A list of timeseries. Each individual timeseries represents a unique combination of dimensions, such as origin host, region or POP. + * + * @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) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/InlineResponse2005.php b/lib/Model/InlineResponse2005.php new file mode 100644 index 00000000..1e2cb2a9 --- /dev/null +++ b/lib/Model/InlineResponse2005.php @@ -0,0 +1,344 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class InlineResponse2005 implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'inline_response_200_5'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'data' => '\Fastly\Model\SecretStoreResponse[]', + 'meta' => '\Fastly\Model\PaginationCursorMeta' + ]; + + /** + * 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\SecretStoreResponse[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Fastly\Model\SecretStoreResponse[]|null $data data + * + * @return self + */ + public function setData($data) + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets meta + * + * @return \Fastly\Model\PaginationCursorMeta|null + */ + public function getMeta() + { + return $this->container['meta']; + } + + /** + * Sets meta + * + * @param \Fastly\Model\PaginationCursorMeta|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) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/InlineResponse2006.php b/lib/Model/InlineResponse2006.php new file mode 100644 index 00000000..3f014e2c --- /dev/null +++ b/lib/Model/InlineResponse2006.php @@ -0,0 +1,344 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class InlineResponse2006 implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'inline_response_200_6'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'data' => '\Fastly\Model\SecretResponse[]', + 'meta' => '\Fastly\Model\PaginationCursorMeta' + ]; + + /** + * 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\SecretResponse[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Fastly\Model\SecretResponse[]|null $data data + * + * @return self + */ + public function setData($data) + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets meta + * + * @return \Fastly\Model\PaginationCursorMeta|null + */ + public function getMeta() + { + return $this->container['meta']; + } + + /** + * Sets meta + * + * @param \Fastly\Model\PaginationCursorMeta|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) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/InlineResponse2007.php b/lib/Model/InlineResponse2007.php new file mode 100644 index 00000000..36ee12eb --- /dev/null +++ b/lib/Model/InlineResponse2007.php @@ -0,0 +1,314 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class InlineResponse2007 implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'inline_response_200_7'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'data' => '\Fastly\Model\ServiceAuthorizationResponseData[]' + ]; + + /** + * 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\ServiceAuthorizationResponseData[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Fastly\Model\ServiceAuthorizationResponseData[]|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) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/InlineResponse400.php b/lib/Model/InlineResponse400.php new file mode 100644 index 00000000..6666ab2a --- /dev/null +++ b/lib/Model/InlineResponse400.php @@ -0,0 +1,354 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class InlineResponse400 implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'inline_response_400'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'code' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'code' => 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 = [ + 'code' => 'code' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'code' => 'setCode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'code' => 'getCode' + ]; + + /** + * 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 CODE_invalid_grant = 'invalid_grant'; + const CODE_invalid_request = 'invalid_request'; + const CODE_invalid_scope = 'invalid_scope'; + const CODE_account_locked = 'account_locked'; + const CODE_mfa_verify = '2fa.verify'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getCodeAllowableValues() + { + return [ + self::CODE_invalid_grant, + self::CODE_invalid_request, + self::CODE_invalid_scope, + self::CODE_account_locked, + self::CODE_mfa_verify, + ]; + } + + /** + * 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['code'] = $data['code'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getCodeAllowableValues(); + if (!is_null($this->container['code']) && !in_array($this->container['code'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'code', must be one of '%s'", + $this->container['code'], + 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 code + * + * @return string|null + */ + public function getCode() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string|null $code code + * + * @return self + */ + public function setCode($code) + { + $allowedValues = $this->getCodeAllowableValues(); + if (!is_null($code) && !in_array($code, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'code', must be one of '%s'", + $code, + implode("', '", $allowedValues) + ) + ); + } + $this->container['code'] = $code; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/LegacyWafConfigurationSet.php b/lib/Model/LegacyWafConfigurationSet.php new file mode 100644 index 00000000..49f968d0 --- /dev/null +++ b/lib/Model/LegacyWafConfigurationSet.php @@ -0,0 +1,344 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class LegacyWafConfigurationSet implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'legacy_waf_configuration_set'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'active' => 'bool', + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'active' => 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 = [ + 'active' => 'active', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'active' => 'setActive', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'active' => 'getActive', + '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['active'] = $data['active'] ?? 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 active + * + * @return bool|null + */ + public function getActive() + { + return $this->container['active']; + } + + /** + * Sets active + * + * @param bool|null $active The active configuration set is the default configuration set when creating a new WAF. When Fastly adds configuration sets, the new versions become the default (active). + * + * @return self + */ + public function setActive($active) + { + $this->container['active'] = $active; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the configuration set. + * + * @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) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/LegacyWafFirewall.php b/lib/Model/LegacyWafFirewall.php new file mode 100644 index 00000000..5b7a90a1 --- /dev/null +++ b/lib/Model/LegacyWafFirewall.php @@ -0,0 +1,554 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class LegacyWafFirewall implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'legacy_waf_firewall'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'last_push' => 'string', + 'prefetch_condition' => 'string', + 'response' => 'string', + 'version' => '\Fastly\Model\ReadOnlyVersion', + 'service_id' => '\Fastly\Model\ReadOnlyServiceId', + 'disabled' => 'bool', + 'rule_statuses_log_count' => 'int', + 'rule_statuses_block_count' => 'int', + 'rule_statuses_disabled_count' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'last_push' => null, + 'prefetch_condition' => null, + 'response' => null, + 'version' => null, + 'service_id' => null, + 'disabled' => null, + 'rule_statuses_log_count' => null, + 'rule_statuses_block_count' => null, + 'rule_statuses_disabled_count' => 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 = [ + 'last_push' => 'last_push', + 'prefetch_condition' => 'prefetch_condition', + 'response' => 'response', + 'version' => 'version', + 'service_id' => 'service_id', + 'disabled' => 'disabled', + 'rule_statuses_log_count' => 'rule_statuses_log_count', + 'rule_statuses_block_count' => 'rule_statuses_block_count', + 'rule_statuses_disabled_count' => 'rule_statuses_disabled_count' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'last_push' => 'setLastPush', + 'prefetch_condition' => 'setPrefetchCondition', + 'response' => 'setResponse', + 'version' => 'setVersion', + 'service_id' => 'setServiceId', + 'disabled' => 'setDisabled', + 'rule_statuses_log_count' => 'setRuleStatusesLogCount', + 'rule_statuses_block_count' => 'setRuleStatusesBlockCount', + 'rule_statuses_disabled_count' => 'setRuleStatusesDisabledCount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'last_push' => 'getLastPush', + 'prefetch_condition' => 'getPrefetchCondition', + 'response' => 'getResponse', + 'version' => 'getVersion', + 'service_id' => 'getServiceId', + 'disabled' => 'getDisabled', + 'rule_statuses_log_count' => 'getRuleStatusesLogCount', + 'rule_statuses_block_count' => 'getRuleStatusesBlockCount', + 'rule_statuses_disabled_count' => 'getRuleStatusesDisabledCount' + ]; + + /** + * 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['last_push'] = $data['last_push'] ?? null; + $this->container['prefetch_condition'] = $data['prefetch_condition'] ?? null; + $this->container['response'] = $data['response'] ?? null; + $this->container['version'] = $data['version'] ?? null; + $this->container['service_id'] = $data['service_id'] ?? null; + $this->container['disabled'] = $data['disabled'] ?? false; + $this->container['rule_statuses_log_count'] = $data['rule_statuses_log_count'] ?? null; + $this->container['rule_statuses_block_count'] = $data['rule_statuses_block_count'] ?? null; + $this->container['rule_statuses_disabled_count'] = $data['rule_statuses_disabled_count'] ?? 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 last_push + * + * @return string|null + */ + public function getLastPush() + { + return $this->container['last_push']; + } + + /** + * Sets last_push + * + * @param string|null $last_push Date and time that VCL was last pushed to cache nodes. + * + * @return self + */ + public function setLastPush($last_push) + { + $this->container['last_push'] = $last_push; + + return $this; + } + + /** + * Gets prefetch_condition + * + * @return string|null + */ + public function getPrefetchCondition() + { + return $this->container['prefetch_condition']; + } + + /** + * Sets prefetch_condition + * + * @param string|null $prefetch_condition Name of the corresponding condition object. + * + * @return self + */ + public function setPrefetchCondition($prefetch_condition) + { + $this->container['prefetch_condition'] = $prefetch_condition; + + return $this; + } + + /** + * Gets response + * + * @return string|null + */ + public function getResponse() + { + return $this->container['response']; + } + + /** + * Sets response + * + * @param string|null $response Name of the corresponding response object. + * + * @return self + */ + public function setResponse($response) + { + $this->container['response'] = $response; + + return $this; + } + + /** + * Gets version + * + * @return \Fastly\Model\ReadOnlyVersion|null + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param \Fastly\Model\ReadOnlyVersion|null $version version + * + * @return self + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + return $this; + } + + /** + * Gets service_id + * + * @return \Fastly\Model\ReadOnlyServiceId|null + */ + public function getServiceId() + { + return $this->container['service_id']; + } + + /** + * Sets service_id + * + * @param \Fastly\Model\ReadOnlyServiceId|null $service_id service_id + * + * @return self + */ + public function setServiceId($service_id) + { + $this->container['service_id'] = $service_id; + + return $this; + } + + /** + * Gets disabled + * + * @return bool|null + */ + public function getDisabled() + { + return $this->container['disabled']; + } + + /** + * Sets disabled + * + * @param bool|null $disabled The status of the firewall. + * + * @return self + */ + public function setDisabled($disabled) + { + $this->container['disabled'] = $disabled; + + return $this; + } + + /** + * Gets rule_statuses_log_count + * + * @return int|null + */ + public function getRuleStatusesLogCount() + { + return $this->container['rule_statuses_log_count']; + } + + /** + * Sets rule_statuses_log_count + * + * @param int|null $rule_statuses_log_count The number of rule statuses set to log. + * + * @return self + */ + public function setRuleStatusesLogCount($rule_statuses_log_count) + { + $this->container['rule_statuses_log_count'] = $rule_statuses_log_count; + + return $this; + } + + /** + * Gets rule_statuses_block_count + * + * @return int|null + */ + public function getRuleStatusesBlockCount() + { + return $this->container['rule_statuses_block_count']; + } + + /** + * Sets rule_statuses_block_count + * + * @param int|null $rule_statuses_block_count The number of rule statuses set to block. + * + * @return self + */ + public function setRuleStatusesBlockCount($rule_statuses_block_count) + { + $this->container['rule_statuses_block_count'] = $rule_statuses_block_count; + + return $this; + } + + /** + * Gets rule_statuses_disabled_count + * + * @return int|null + */ + public function getRuleStatusesDisabledCount() + { + return $this->container['rule_statuses_disabled_count']; + } + + /** + * Sets rule_statuses_disabled_count + * + * @param int|null $rule_statuses_disabled_count The number of rule statuses set to disabled. + * + * @return self + */ + public function setRuleStatusesDisabledCount($rule_statuses_disabled_count) + { + $this->container['rule_statuses_disabled_count'] = $rule_statuses_disabled_count; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/LegacyWafOwasp.php b/lib/Model/LegacyWafOwasp.php new file mode 100644 index 00000000..9d6642e7 --- /dev/null +++ b/lib/Model/LegacyWafOwasp.php @@ -0,0 +1,1154 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class LegacyWafOwasp implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'legacy_waf_owasp'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'allowed_http_versions' => 'string', + 'allowed_methods' => 'string', + 'allowed_request_content_type' => 'string', + 'arg_length' => 'int', + 'arg_name_length' => 'int', + 'combined_file_sizes' => 'int', + 'created_at' => 'string', + 'critical_anomaly_score' => 'int', + 'crs_validate_utf8_encoding' => 'bool', + 'error_anomaly_score' => 'int', + 'high_risk_country_codes' => 'string', + 'http_violation_score_threshold' => 'int', + 'inbound_anomaly_score_threshold' => 'int', + 'lfi_score_threshold' => 'int', + 'max_file_size' => 'int', + 'max_num_args' => 'int', + 'notice_anomaly_score' => 'int', + 'paranoia_level' => 'int', + 'php_injection_score_threshold' => 'int', + 'rce_score_threshold' => 'int', + 'restricted_extensions' => 'string', + 'restricted_headers' => 'string', + 'rfi_score_threshold' => 'int', + 'session_fixation_score_threshold' => 'int', + 'sql_injection_score_threshold' => 'int', + 'total_arg_length' => 'int', + 'updated_at' => 'string', + 'warning_anomaly_score' => 'int', + 'xss_score_threshold' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'allowed_http_versions' => null, + 'allowed_methods' => null, + 'allowed_request_content_type' => null, + 'arg_length' => null, + 'arg_name_length' => null, + 'combined_file_sizes' => null, + 'created_at' => null, + 'critical_anomaly_score' => null, + 'crs_validate_utf8_encoding' => null, + 'error_anomaly_score' => null, + 'high_risk_country_codes' => null, + 'http_violation_score_threshold' => null, + 'inbound_anomaly_score_threshold' => null, + 'lfi_score_threshold' => null, + 'max_file_size' => null, + 'max_num_args' => null, + 'notice_anomaly_score' => null, + 'paranoia_level' => null, + 'php_injection_score_threshold' => null, + 'rce_score_threshold' => null, + 'restricted_extensions' => null, + 'restricted_headers' => null, + 'rfi_score_threshold' => null, + 'session_fixation_score_threshold' => null, + 'sql_injection_score_threshold' => null, + 'total_arg_length' => null, + 'updated_at' => null, + 'warning_anomaly_score' => null, + 'xss_score_threshold' => 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 = [ + 'allowed_http_versions' => 'allowed_http_versions', + 'allowed_methods' => 'allowed_methods', + 'allowed_request_content_type' => 'allowed_request_content_type', + 'arg_length' => 'arg_length', + 'arg_name_length' => 'arg_name_length', + 'combined_file_sizes' => 'combined_file_sizes', + 'created_at' => 'created_at', + 'critical_anomaly_score' => 'critical_anomaly_score', + 'crs_validate_utf8_encoding' => 'crs_validate_utf8_encoding', + 'error_anomaly_score' => 'error_anomaly_score', + 'high_risk_country_codes' => 'high_risk_country_codes', + 'http_violation_score_threshold' => 'http_violation_score_threshold', + 'inbound_anomaly_score_threshold' => 'inbound_anomaly_score_threshold', + 'lfi_score_threshold' => 'lfi_score_threshold', + 'max_file_size' => 'max_file_size', + 'max_num_args' => 'max_num_args', + 'notice_anomaly_score' => 'notice_anomaly_score', + 'paranoia_level' => 'paranoia_level', + 'php_injection_score_threshold' => 'php_injection_score_threshold', + 'rce_score_threshold' => 'rce_score_threshold', + 'restricted_extensions' => 'restricted_extensions', + 'restricted_headers' => 'restricted_headers', + 'rfi_score_threshold' => 'rfi_score_threshold', + 'session_fixation_score_threshold' => 'session_fixation_score_threshold', + 'sql_injection_score_threshold' => 'sql_injection_score_threshold', + 'total_arg_length' => 'total_arg_length', + 'updated_at' => 'updated_at', + 'warning_anomaly_score' => 'warning_anomaly_score', + 'xss_score_threshold' => 'xss_score_threshold' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'allowed_http_versions' => 'setAllowedHttpVersions', + 'allowed_methods' => 'setAllowedMethods', + 'allowed_request_content_type' => 'setAllowedRequestContentType', + 'arg_length' => 'setArgLength', + 'arg_name_length' => 'setArgNameLength', + 'combined_file_sizes' => 'setCombinedFileSizes', + 'created_at' => 'setCreatedAt', + 'critical_anomaly_score' => 'setCriticalAnomalyScore', + 'crs_validate_utf8_encoding' => 'setCrsValidateUtf8Encoding', + 'error_anomaly_score' => 'setErrorAnomalyScore', + 'high_risk_country_codes' => 'setHighRiskCountryCodes', + 'http_violation_score_threshold' => 'setHttpViolationScoreThreshold', + 'inbound_anomaly_score_threshold' => 'setInboundAnomalyScoreThreshold', + 'lfi_score_threshold' => 'setLfiScoreThreshold', + 'max_file_size' => 'setMaxFileSize', + 'max_num_args' => 'setMaxNumArgs', + 'notice_anomaly_score' => 'setNoticeAnomalyScore', + 'paranoia_level' => 'setParanoiaLevel', + 'php_injection_score_threshold' => 'setPhpInjectionScoreThreshold', + 'rce_score_threshold' => 'setRceScoreThreshold', + 'restricted_extensions' => 'setRestrictedExtensions', + 'restricted_headers' => 'setRestrictedHeaders', + 'rfi_score_threshold' => 'setRfiScoreThreshold', + 'session_fixation_score_threshold' => 'setSessionFixationScoreThreshold', + 'sql_injection_score_threshold' => 'setSqlInjectionScoreThreshold', + 'total_arg_length' => 'setTotalArgLength', + 'updated_at' => 'setUpdatedAt', + 'warning_anomaly_score' => 'setWarningAnomalyScore', + 'xss_score_threshold' => 'setXssScoreThreshold' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'allowed_http_versions' => 'getAllowedHttpVersions', + 'allowed_methods' => 'getAllowedMethods', + 'allowed_request_content_type' => 'getAllowedRequestContentType', + 'arg_length' => 'getArgLength', + 'arg_name_length' => 'getArgNameLength', + 'combined_file_sizes' => 'getCombinedFileSizes', + 'created_at' => 'getCreatedAt', + 'critical_anomaly_score' => 'getCriticalAnomalyScore', + 'crs_validate_utf8_encoding' => 'getCrsValidateUtf8Encoding', + 'error_anomaly_score' => 'getErrorAnomalyScore', + 'high_risk_country_codes' => 'getHighRiskCountryCodes', + 'http_violation_score_threshold' => 'getHttpViolationScoreThreshold', + 'inbound_anomaly_score_threshold' => 'getInboundAnomalyScoreThreshold', + 'lfi_score_threshold' => 'getLfiScoreThreshold', + 'max_file_size' => 'getMaxFileSize', + 'max_num_args' => 'getMaxNumArgs', + 'notice_anomaly_score' => 'getNoticeAnomalyScore', + 'paranoia_level' => 'getParanoiaLevel', + 'php_injection_score_threshold' => 'getPhpInjectionScoreThreshold', + 'rce_score_threshold' => 'getRceScoreThreshold', + 'restricted_extensions' => 'getRestrictedExtensions', + 'restricted_headers' => 'getRestrictedHeaders', + 'rfi_score_threshold' => 'getRfiScoreThreshold', + 'session_fixation_score_threshold' => 'getSessionFixationScoreThreshold', + 'sql_injection_score_threshold' => 'getSqlInjectionScoreThreshold', + 'total_arg_length' => 'getTotalArgLength', + 'updated_at' => 'getUpdatedAt', + 'warning_anomaly_score' => 'getWarningAnomalyScore', + 'xss_score_threshold' => 'getXssScoreThreshold' + ]; + + /** + * 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['allowed_http_versions'] = $data['allowed_http_versions'] ?? 'HTTP/1.0 HTTP/1.1 HTTP/2'; + $this->container['allowed_methods'] = $data['allowed_methods'] ?? 'GET HEAD POST OPTIONS PUT PATCH DELETE'; + $this->container['allowed_request_content_type'] = $data['allowed_request_content_type'] ?? 'application/x-www-form-urlencoded|multipart/form-data|text/xml|application/xml|application/x-amf|application/json|text/plain'; + $this->container['arg_length'] = $data['arg_length'] ?? 400; + $this->container['arg_name_length'] = $data['arg_name_length'] ?? 100; + $this->container['combined_file_sizes'] = $data['combined_file_sizes'] ?? 10000000; + $this->container['created_at'] = $data['created_at'] ?? null; + $this->container['critical_anomaly_score'] = $data['critical_anomaly_score'] ?? 6; + $this->container['crs_validate_utf8_encoding'] = $data['crs_validate_utf8_encoding'] ?? null; + $this->container['error_anomaly_score'] = $data['error_anomaly_score'] ?? 5; + $this->container['high_risk_country_codes'] = $data['high_risk_country_codes'] ?? null; + $this->container['http_violation_score_threshold'] = $data['http_violation_score_threshold'] ?? null; + $this->container['inbound_anomaly_score_threshold'] = $data['inbound_anomaly_score_threshold'] ?? null; + $this->container['lfi_score_threshold'] = $data['lfi_score_threshold'] ?? null; + $this->container['max_file_size'] = $data['max_file_size'] ?? 10000000; + $this->container['max_num_args'] = $data['max_num_args'] ?? 255; + $this->container['notice_anomaly_score'] = $data['notice_anomaly_score'] ?? 4; + $this->container['paranoia_level'] = $data['paranoia_level'] ?? 1; + $this->container['php_injection_score_threshold'] = $data['php_injection_score_threshold'] ?? null; + $this->container['rce_score_threshold'] = $data['rce_score_threshold'] ?? null; + $this->container['restricted_extensions'] = $data['restricted_extensions'] ?? '.asa/ .asax/ .ascx/ .axd/ .backup/ .bak/ .bat/ .cdx/ .cer/ .cfg/ .cmd/ .com/ .config/ .conf/ .cs/ .csproj/ .csr/ .dat/ .db/ .dbf/ .dll/ .dos/ .htr/ .htw/ .ida/ .idc/ .idq/ .inc/ .ini/ .key/ .licx/ .lnk/ .log/ .mdb/ .old/ .pass/ .pdb/ .pol/ .printer/ .pwd/ .resources/ .resx/ .sql/ .sys/ .vb/ .vbs/ .vbproj/ .vsdisco/ .webinfo/ .xsd/ .xsx'; + $this->container['restricted_headers'] = $data['restricted_headers'] ?? '/proxy/ /lock-token/ /content-range/ /translate/ /if/'; + $this->container['rfi_score_threshold'] = $data['rfi_score_threshold'] ?? null; + $this->container['session_fixation_score_threshold'] = $data['session_fixation_score_threshold'] ?? null; + $this->container['sql_injection_score_threshold'] = $data['sql_injection_score_threshold'] ?? null; + $this->container['total_arg_length'] = $data['total_arg_length'] ?? 6400; + $this->container['updated_at'] = $data['updated_at'] ?? null; + $this->container['warning_anomaly_score'] = $data['warning_anomaly_score'] ?? null; + $this->container['xss_score_threshold'] = $data['xss_score_threshold'] ?? 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 allowed_http_versions + * + * @return string|null + */ + public function getAllowedHttpVersions() + { + return $this->container['allowed_http_versions']; + } + + /** + * Sets allowed_http_versions + * + * @param string|null $allowed_http_versions Allowed HTTP versions. + * + * @return self + */ + public function setAllowedHttpVersions($allowed_http_versions) + { + $this->container['allowed_http_versions'] = $allowed_http_versions; + + return $this; + } + + /** + * Gets allowed_methods + * + * @return string|null + */ + public function getAllowedMethods() + { + return $this->container['allowed_methods']; + } + + /** + * Sets allowed_methods + * + * @param string|null $allowed_methods A space-separated list of HTTP method names. + * + * @return self + */ + public function setAllowedMethods($allowed_methods) + { + $this->container['allowed_methods'] = $allowed_methods; + + return $this; + } + + /** + * Gets allowed_request_content_type + * + * @return string|null + */ + public function getAllowedRequestContentType() + { + return $this->container['allowed_request_content_type']; + } + + /** + * Sets allowed_request_content_type + * + * @param string|null $allowed_request_content_type Allowed request content types. + * + * @return self + */ + public function setAllowedRequestContentType($allowed_request_content_type) + { + $this->container['allowed_request_content_type'] = $allowed_request_content_type; + + return $this; + } + + /** + * Gets arg_length + * + * @return int|null + */ + public function getArgLength() + { + return $this->container['arg_length']; + } + + /** + * Sets arg_length + * + * @param int|null $arg_length The maximum allowed length of an argument. + * + * @return self + */ + public function setArgLength($arg_length) + { + $this->container['arg_length'] = $arg_length; + + return $this; + } + + /** + * Gets arg_name_length + * + * @return int|null + */ + public function getArgNameLength() + { + return $this->container['arg_name_length']; + } + + /** + * Sets arg_name_length + * + * @param int|null $arg_name_length The maximum allowed argument name length. + * + * @return self + */ + public function setArgNameLength($arg_name_length) + { + $this->container['arg_name_length'] = $arg_name_length; + + return $this; + } + + /** + * Gets combined_file_sizes + * + * @return int|null + */ + public function getCombinedFileSizes() + { + return $this->container['combined_file_sizes']; + } + + /** + * Sets combined_file_sizes + * + * @param int|null $combined_file_sizes The maximum allowed size of all files (in bytes). + * + * @return self + */ + public function setCombinedFileSizes($combined_file_sizes) + { + $this->container['combined_file_sizes'] = $combined_file_sizes; + + return $this; + } + + /** + * Gets created_at + * + * @return string|null + */ + public function getCreatedAt() + { + return $this->container['created_at']; + } + + /** + * Sets created_at + * + * @param string|null $created_at Date and time that the settings object was created. + * + * @return self + */ + public function setCreatedAt($created_at) + { + $this->container['created_at'] = $created_at; + + return $this; + } + + /** + * Gets critical_anomaly_score + * + * @return int|null + */ + public function getCriticalAnomalyScore() + { + return $this->container['critical_anomaly_score']; + } + + /** + * Sets critical_anomaly_score + * + * @param int|null $critical_anomaly_score Score value to add for critical anomalies. + * + * @return self + */ + public function setCriticalAnomalyScore($critical_anomaly_score) + { + $this->container['critical_anomaly_score'] = $critical_anomaly_score; + + return $this; + } + + /** + * Gets crs_validate_utf8_encoding + * + * @return bool|null + */ + public function getCrsValidateUtf8Encoding() + { + return $this->container['crs_validate_utf8_encoding']; + } + + /** + * Sets crs_validate_utf8_encoding + * + * @param bool|null $crs_validate_utf8_encoding CRS validate UTF8 encoding. + * + * @return self + */ + public function setCrsValidateUtf8Encoding($crs_validate_utf8_encoding) + { + $this->container['crs_validate_utf8_encoding'] = $crs_validate_utf8_encoding; + + return $this; + } + + /** + * Gets error_anomaly_score + * + * @return int|null + */ + public function getErrorAnomalyScore() + { + return $this->container['error_anomaly_score']; + } + + /** + * Sets error_anomaly_score + * + * @param int|null $error_anomaly_score Score value to add for error anomalies. + * + * @return self + */ + public function setErrorAnomalyScore($error_anomaly_score) + { + $this->container['error_anomaly_score'] = $error_anomaly_score; + + return $this; + } + + /** + * Gets high_risk_country_codes + * + * @return string|null + */ + public function getHighRiskCountryCodes() + { + return $this->container['high_risk_country_codes']; + } + + /** + * Sets high_risk_country_codes + * + * @param string|null $high_risk_country_codes A space-separated list of country codes in ISO 3166-1 (two-letter) format. + * + * @return self + */ + public function setHighRiskCountryCodes($high_risk_country_codes) + { + $this->container['high_risk_country_codes'] = $high_risk_country_codes; + + return $this; + } + + /** + * Gets http_violation_score_threshold + * + * @return int|null + */ + public function getHttpViolationScoreThreshold() + { + return $this->container['http_violation_score_threshold']; + } + + /** + * Sets http_violation_score_threshold + * + * @param int|null $http_violation_score_threshold HTTP violation threshold. + * + * @return self + */ + public function setHttpViolationScoreThreshold($http_violation_score_threshold) + { + $this->container['http_violation_score_threshold'] = $http_violation_score_threshold; + + return $this; + } + + /** + * Gets inbound_anomaly_score_threshold + * + * @return int|null + */ + public function getInboundAnomalyScoreThreshold() + { + return $this->container['inbound_anomaly_score_threshold']; + } + + /** + * Sets inbound_anomaly_score_threshold + * + * @param int|null $inbound_anomaly_score_threshold Inbound anomaly threshold. + * + * @return self + */ + public function setInboundAnomalyScoreThreshold($inbound_anomaly_score_threshold) + { + $this->container['inbound_anomaly_score_threshold'] = $inbound_anomaly_score_threshold; + + return $this; + } + + /** + * Gets lfi_score_threshold + * + * @return int|null + */ + public function getLfiScoreThreshold() + { + return $this->container['lfi_score_threshold']; + } + + /** + * Sets lfi_score_threshold + * + * @param int|null $lfi_score_threshold Local file inclusion attack threshold. + * + * @return self + */ + public function setLfiScoreThreshold($lfi_score_threshold) + { + $this->container['lfi_score_threshold'] = $lfi_score_threshold; + + return $this; + } + + /** + * Gets max_file_size + * + * @return int|null + */ + public function getMaxFileSize() + { + return $this->container['max_file_size']; + } + + /** + * Sets max_file_size + * + * @param int|null $max_file_size The maximum allowed file size (in bytes). + * + * @return self + */ + public function setMaxFileSize($max_file_size) + { + $this->container['max_file_size'] = $max_file_size; + + return $this; + } + + /** + * Gets max_num_args + * + * @return int|null + */ + public function getMaxNumArgs() + { + return $this->container['max_num_args']; + } + + /** + * Sets max_num_args + * + * @param int|null $max_num_args The maximum number of arguments allowed. + * + * @return self + */ + public function setMaxNumArgs($max_num_args) + { + $this->container['max_num_args'] = $max_num_args; + + return $this; + } + + /** + * Gets notice_anomaly_score + * + * @return int|null + */ + public function getNoticeAnomalyScore() + { + return $this->container['notice_anomaly_score']; + } + + /** + * Sets notice_anomaly_score + * + * @param int|null $notice_anomaly_score Score value to add for notice anomalies. + * + * @return self + */ + public function setNoticeAnomalyScore($notice_anomaly_score) + { + $this->container['notice_anomaly_score'] = $notice_anomaly_score; + + return $this; + } + + /** + * Gets paranoia_level + * + * @return int|null + */ + public function getParanoiaLevel() + { + return $this->container['paranoia_level']; + } + + /** + * Sets paranoia_level + * + * @param int|null $paranoia_level The configured paranoia level. + * + * @return self + */ + public function setParanoiaLevel($paranoia_level) + { + $this->container['paranoia_level'] = $paranoia_level; + + return $this; + } + + /** + * Gets php_injection_score_threshold + * + * @return int|null + */ + public function getPhpInjectionScoreThreshold() + { + return $this->container['php_injection_score_threshold']; + } + + /** + * Sets php_injection_score_threshold + * + * @param int|null $php_injection_score_threshold PHP injection threshold. + * + * @return self + */ + public function setPhpInjectionScoreThreshold($php_injection_score_threshold) + { + $this->container['php_injection_score_threshold'] = $php_injection_score_threshold; + + return $this; + } + + /** + * Gets rce_score_threshold + * + * @return int|null + */ + public function getRceScoreThreshold() + { + return $this->container['rce_score_threshold']; + } + + /** + * Sets rce_score_threshold + * + * @param int|null $rce_score_threshold Remote code execution threshold. + * + * @return self + */ + public function setRceScoreThreshold($rce_score_threshold) + { + $this->container['rce_score_threshold'] = $rce_score_threshold; + + return $this; + } + + /** + * Gets restricted_extensions + * + * @return string|null + */ + public function getRestrictedExtensions() + { + return $this->container['restricted_extensions']; + } + + /** + * Sets restricted_extensions + * + * @param string|null $restricted_extensions A space-separated list of disallowed file extensions. + * + * @return self + */ + public function setRestrictedExtensions($restricted_extensions) + { + $this->container['restricted_extensions'] = $restricted_extensions; + + return $this; + } + + /** + * Gets restricted_headers + * + * @return string|null + */ + public function getRestrictedHeaders() + { + return $this->container['restricted_headers']; + } + + /** + * Sets restricted_headers + * + * @param string|null $restricted_headers A space-separated list of disallowed header names. + * + * @return self + */ + public function setRestrictedHeaders($restricted_headers) + { + $this->container['restricted_headers'] = $restricted_headers; + + return $this; + } + + /** + * Gets rfi_score_threshold + * + * @return int|null + */ + public function getRfiScoreThreshold() + { + return $this->container['rfi_score_threshold']; + } + + /** + * Sets rfi_score_threshold + * + * @param int|null $rfi_score_threshold Remote file inclusion attack threshold. + * + * @return self + */ + public function setRfiScoreThreshold($rfi_score_threshold) + { + $this->container['rfi_score_threshold'] = $rfi_score_threshold; + + return $this; + } + + /** + * Gets session_fixation_score_threshold + * + * @return int|null + */ + public function getSessionFixationScoreThreshold() + { + return $this->container['session_fixation_score_threshold']; + } + + /** + * Sets session_fixation_score_threshold + * + * @param int|null $session_fixation_score_threshold Session fixation attack threshold. + * + * @return self + */ + public function setSessionFixationScoreThreshold($session_fixation_score_threshold) + { + $this->container['session_fixation_score_threshold'] = $session_fixation_score_threshold; + + return $this; + } + + /** + * Gets sql_injection_score_threshold + * + * @return int|null + */ + public function getSqlInjectionScoreThreshold() + { + return $this->container['sql_injection_score_threshold']; + } + + /** + * Sets sql_injection_score_threshold + * + * @param int|null $sql_injection_score_threshold SQL injection attack threshold. + * + * @return self + */ + public function setSqlInjectionScoreThreshold($sql_injection_score_threshold) + { + $this->container['sql_injection_score_threshold'] = $sql_injection_score_threshold; + + return $this; + } + + /** + * Gets total_arg_length + * + * @return int|null + */ + public function getTotalArgLength() + { + return $this->container['total_arg_length']; + } + + /** + * Sets total_arg_length + * + * @param int|null $total_arg_length The maximum size of argument names and values. + * + * @return self + */ + public function setTotalArgLength($total_arg_length) + { + $this->container['total_arg_length'] = $total_arg_length; + + return $this; + } + + /** + * Gets updated_at + * + * @return string|null + */ + public function getUpdatedAt() + { + return $this->container['updated_at']; + } + + /** + * Sets updated_at + * + * @param string|null $updated_at Date and time that the settings object was last updated. + * + * @return self + */ + public function setUpdatedAt($updated_at) + { + $this->container['updated_at'] = $updated_at; + + return $this; + } + + /** + * Gets warning_anomaly_score + * + * @return int|null + */ + public function getWarningAnomalyScore() + { + return $this->container['warning_anomaly_score']; + } + + /** + * Sets warning_anomaly_score + * + * @param int|null $warning_anomaly_score Score value to add for warning anomalies. + * + * @return self + */ + public function setWarningAnomalyScore($warning_anomaly_score) + { + $this->container['warning_anomaly_score'] = $warning_anomaly_score; + + return $this; + } + + /** + * Gets xss_score_threshold + * + * @return int|null + */ + public function getXssScoreThreshold() + { + return $this->container['xss_score_threshold']; + } + + /** + * Sets xss_score_threshold + * + * @param int|null $xss_score_threshold XSS attack threshold. + * + * @return self + */ + public function setXssScoreThreshold($xss_score_threshold) + { + $this->container['xss_score_threshold'] = $xss_score_threshold; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/LegacyWafRule.php b/lib/Model/LegacyWafRule.php new file mode 100644 index 00000000..07ae38bd --- /dev/null +++ b/lib/Model/LegacyWafRule.php @@ -0,0 +1,434 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class LegacyWafRule implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'legacy_waf_rule'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'message' => 'string', + 'rule_id' => 'string', + 'severity' => 'int', + 'source' => 'string', + 'vcl' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'message' => null, + 'rule_id' => null, + 'severity' => null, + 'source' => null, + 'vcl' => 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 = [ + 'message' => 'message', + 'rule_id' => 'rule_id', + 'severity' => 'severity', + 'source' => 'source', + 'vcl' => 'vcl' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'message' => 'setMessage', + 'rule_id' => 'setRuleId', + 'severity' => 'setSeverity', + 'source' => 'setSource', + 'vcl' => 'setVcl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'message' => 'getMessage', + 'rule_id' => 'getRuleId', + 'severity' => 'getSeverity', + 'source' => 'getSource', + 'vcl' => 'getVcl' + ]; + + /** + * 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['message'] = $data['message'] ?? null; + $this->container['rule_id'] = $data['rule_id'] ?? null; + $this->container['severity'] = $data['severity'] ?? null; + $this->container['source'] = $data['source'] ?? null; + $this->container['vcl'] = $data['vcl'] ?? 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 message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message Message metadata for the rule. + * + * @return self + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets rule_id + * + * @return string|null + */ + public function getRuleId() + { + return $this->container['rule_id']; + } + + /** + * Sets rule_id + * + * @param string|null $rule_id Corresponding ModSecurity rule ID. + * + * @return self + */ + public function setRuleId($rule_id) + { + $this->container['rule_id'] = $rule_id; + + return $this; + } + + /** + * Gets severity + * + * @return int|null + */ + public function getSeverity() + { + return $this->container['severity']; + } + + /** + * Sets severity + * + * @param int|null $severity Severity metadata for the rule. + * + * @return self + */ + public function setSeverity($severity) + { + $this->container['severity'] = $severity; + + return $this; + } + + /** + * Gets source + * + * @return string|null + */ + public function getSource() + { + return $this->container['source']; + } + + /** + * Sets source + * + * @param string|null $source The ModSecurity rule logic. + * + * @return self + */ + public function setSource($source) + { + $this->container['source'] = $source; + + return $this; + } + + /** + * Gets vcl + * + * @return string|null + */ + public function getVcl() + { + return $this->container['vcl']; + } + + /** + * Sets vcl + * + * @param string|null $vcl The VCL representation of the rule logic. + * + * @return self + */ + public function setVcl($vcl) + { + $this->container['vcl'] = $vcl; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/LegacyWafRuleStatus.php b/lib/Model/LegacyWafRuleStatus.php new file mode 100644 index 00000000..c0d792fe --- /dev/null +++ b/lib/Model/LegacyWafRuleStatus.php @@ -0,0 +1,374 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class LegacyWafRuleStatus implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'legacy_waf_rule_status'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'status' => 'string', + 'modsec_rule_id' => 'string', + 'unique_rule_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'status' => null, + 'modsec_rule_id' => null, + 'unique_rule_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 = [ + 'status' => 'status', + 'modsec_rule_id' => 'modsec_rule_id', + 'unique_rule_id' => 'unique_rule_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'modsec_rule_id' => 'setModsecRuleId', + 'unique_rule_id' => 'setUniqueRuleId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'modsec_rule_id' => 'getModsecRuleId', + 'unique_rule_id' => 'getUniqueRuleId' + ]; + + /** + * 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['status'] = $data['status'] ?? null; + $this->container['modsec_rule_id'] = $data['modsec_rule_id'] ?? null; + $this->container['unique_rule_id'] = $data['unique_rule_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 status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status Describes the behavior for the particular rule within this firewall. Permitted values: `log`, `block`, and `disabled`. + * + * @return self + */ + public function setStatus($status) + { + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets modsec_rule_id + * + * @return string|null + */ + public function getModsecRuleId() + { + return $this->container['modsec_rule_id']; + } + + /** + * Sets modsec_rule_id + * + * @param string|null $modsec_rule_id The ModSecurity rule ID. + * + * @return self + */ + public function setModsecRuleId($modsec_rule_id) + { + $this->container['modsec_rule_id'] = $modsec_rule_id; + + return $this; + } + + /** + * Gets unique_rule_id + * + * @return string|null + */ + public function getUniqueRuleId() + { + return $this->container['unique_rule_id']; + } + + /** + * Sets unique_rule_id + * + * @param string|null $unique_rule_id The Rule ID. + * + * @return self + */ + public function setUniqueRuleId($unique_rule_id) + { + $this->container['unique_rule_id'] = $unique_rule_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/LegacyWafRuleset.php b/lib/Model/LegacyWafRuleset.php new file mode 100644 index 00000000..bed4fd5c --- /dev/null +++ b/lib/Model/LegacyWafRuleset.php @@ -0,0 +1,344 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class LegacyWafRuleset implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'legacy_waf_ruleset'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'last_push' => 'string', + 'vcl' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'last_push' => null, + 'vcl' => 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 = [ + 'last_push' => 'last_push', + 'vcl' => 'vcl' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'last_push' => 'setLastPush', + 'vcl' => 'setVcl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'last_push' => 'getLastPush', + 'vcl' => 'getVcl' + ]; + + /** + * 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['last_push'] = $data['last_push'] ?? null; + $this->container['vcl'] = $data['vcl'] ?? 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 last_push + * + * @return string|null + */ + public function getLastPush() + { + return $this->container['last_push']; + } + + /** + * Sets last_push + * + * @param string|null $last_push Date and time WAF ruleset VCL was last deployed. + * + * @return self + */ + public function setLastPush($last_push) + { + $this->container['last_push'] = $last_push; + + return $this; + } + + /** + * Gets vcl + * + * @return string|null + */ + public function getVcl() + { + return $this->container['vcl']; + } + + /** + * Sets vcl + * + * @param string|null $vcl The WAF ruleset VCL currently deployed. + * + * @return self + */ + public function setVcl($vcl) + { + $this->container['vcl'] = $vcl; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/LegacyWafTag.php b/lib/Model/LegacyWafTag.php new file mode 100644 index 00000000..f4d6cc14 --- /dev/null +++ b/lib/Model/LegacyWafTag.php @@ -0,0 +1,314 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class LegacyWafTag implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'legacy_waf_tag'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + '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 = [ + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + '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['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 name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Name of the tag. + * + * @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) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/LegacyWafUpdateStatus.php b/lib/Model/LegacyWafUpdateStatus.php new file mode 100644 index 00000000..6bb7f4e6 --- /dev/null +++ b/lib/Model/LegacyWafUpdateStatus.php @@ -0,0 +1,464 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class LegacyWafUpdateStatus implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'legacy_waf_update_status'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'completed_at' => 'string', + 'created_at' => 'string', + 'data' => 'string', + 'message' => 'string', + 'status' => 'string', + 'updated_at' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'completed_at' => null, + 'created_at' => null, + 'data' => null, + 'message' => null, + 'status' => null, + 'updated_at' => 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 = [ + 'completed_at' => 'completed_at', + 'created_at' => 'created_at', + 'data' => 'data', + 'message' => 'message', + 'status' => 'status', + 'updated_at' => 'updated_at' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'completed_at' => 'setCompletedAt', + 'created_at' => 'setCreatedAt', + 'data' => 'setData', + 'message' => 'setMessage', + 'status' => 'setStatus', + 'updated_at' => 'setUpdatedAt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'completed_at' => 'getCompletedAt', + 'created_at' => 'getCreatedAt', + 'data' => 'getData', + 'message' => 'getMessage', + 'status' => 'getStatus', + 'updated_at' => 'getUpdatedAt' + ]; + + /** + * 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['completed_at'] = $data['completed_at'] ?? null; + $this->container['created_at'] = $data['created_at'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['message'] = $data['message'] ?? null; + $this->container['status'] = $data['status'] ?? null; + $this->container['updated_at'] = $data['updated_at'] ?? 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 completed_at + * + * @return string|null + */ + public function getCompletedAt() + { + return $this->container['completed_at']; + } + + /** + * Sets completed_at + * + * @param string|null $completed_at Date and time that job was completed. + * + * @return self + */ + public function setCompletedAt($completed_at) + { + $this->container['completed_at'] = $completed_at; + + return $this; + } + + /** + * Gets created_at + * + * @return string|null + */ + public function getCreatedAt() + { + return $this->container['created_at']; + } + + /** + * Sets created_at + * + * @param string|null $created_at Date and time that job was created. + * + * @return self + */ + public function setCreatedAt($created_at) + { + $this->container['created_at'] = $created_at; + + return $this; + } + + /** + * Gets data + * + * @return string|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param string|null $data This field can contain data passed to the background worker as well as output from the background job. + * + * @return self + */ + public function setData($data) + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message Message with information about the status of the update. + * + * @return self + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status Current status of the update. + * + * @return self + */ + public function setStatus($status) + { + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets updated_at + * + * @return string|null + */ + public function getUpdatedAt() + { + return $this->container['updated_at']; + } + + /** + * Sets updated_at + * + * @param string|null $updated_at Date and time that job was last updated. + * + * @return self + */ + public function setUpdatedAt($updated_at) + { + $this->container['updated_at'] = $updated_at; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/OriginInspector.php b/lib/Model/OriginInspector.php new file mode 100644 index 00000000..2a1370d5 --- /dev/null +++ b/lib/Model/OriginInspector.php @@ -0,0 +1,374 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OriginInspector implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'origin_inspector'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'timestamp' => '\Fastly\Model\OriginInspectorSubsequentRequestTimestamp', + 'aggregate_delay' => 'int', + 'data' => '\Fastly\Model\OriginInspectorRealtimeEntry[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'timestamp' => null, + 'aggregate_delay' => null, + '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 = [ + 'timestamp' => 'Timestamp', + 'aggregate_delay' => 'AggregateDelay', + 'data' => 'Data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'timestamp' => 'setTimestamp', + 'aggregate_delay' => 'setAggregateDelay', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'timestamp' => 'getTimestamp', + 'aggregate_delay' => 'getAggregateDelay', + '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['timestamp'] = $data['timestamp'] ?? null; + $this->container['aggregate_delay'] = $data['aggregate_delay'] ?? 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 timestamp + * + * @return \Fastly\Model\OriginInspectorSubsequentRequestTimestamp|null + */ + public function getTimestamp() + { + return $this->container['timestamp']; + } + + /** + * Sets timestamp + * + * @param \Fastly\Model\OriginInspectorSubsequentRequestTimestamp|null $timestamp timestamp + * + * @return self + */ + public function setTimestamp($timestamp) + { + $this->container['timestamp'] = $timestamp; + + return $this; + } + + /** + * Gets aggregate_delay + * + * @return int|null + */ + public function getAggregateDelay() + { + return $this->container['aggregate_delay']; + } + + /** + * Sets aggregate_delay + * + * @param int|null $aggregate_delay Offset of entry timestamps from the current time due to processing time. + * + * @return self + */ + public function setAggregateDelay($aggregate_delay) + { + $this->container['aggregate_delay'] = $aggregate_delay; + + return $this; + } + + /** + * Gets data + * + * @return \Fastly\Model\OriginInspectorRealtimeEntry[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Fastly\Model\OriginInspectorRealtimeEntry[]|null $data A list of report [entries](#entry-data-model), each representing one second of time. + * + * @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) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/OriginInspectorDimensions.php b/lib/Model/OriginInspectorDimensions.php new file mode 100644 index 00000000..5145f920 --- /dev/null +++ b/lib/Model/OriginInspectorDimensions.php @@ -0,0 +1,375 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OriginInspectorDimensions implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'origin_inspector_dimensions'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'region' => 'string', + 'datacenter' => 'string', + 'host' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'region' => null, + 'datacenter' => null, + 'host' => 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 = [ + 'region' => 'region', + 'datacenter' => 'datacenter', + 'host' => 'host' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'region' => 'setRegion', + 'datacenter' => 'setDatacenter', + 'host' => 'setHost' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'region' => 'getRegion', + 'datacenter' => 'getDatacenter', + 'host' => 'getHost' + ]; + + /** + * 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['region'] = $data['region'] ?? null; + $this->container['datacenter'] = $data['datacenter'] ?? null; + $this->container['host'] = $data['host'] ?? 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 region + * + * @return string|null + */ + public function getRegion() + { + return $this->container['region']; + } + + /** + * Sets region + * + * @param string|null $region The geographic region from which the edge responses in this data entry were delivered. If unspecified, results are aggregated across regions. + * + * @return self + */ + public function setRegion($region) + { + $this->container['region'] = $region; + + return $this; + } + + /** + * Gets datacenter + * + * @return string|null + */ + public function getDatacenter() + { + return $this->container['datacenter']; + } + + /** + * Sets datacenter + * + * @param string|null $datacenter The POP from which the edge responses in this data entry were delivered. If unspecified, results are aggregated across POPs. + * + * @return self + */ + public function setDatacenter($datacenter) + { + $this->container['datacenter'] = $datacenter; + + return $this; + } + + /** + * Gets host + * + * @return string|null + */ + public function getHost() + { + return $this->container['host']; + } + + /** + * Sets host + * + * @param string|null $host The origin host from which the edge responses in this data entry were delivered. If unspecified, results are aggregated across origin hosts. + * + * @return self + */ + public function setHost($host) + { + $this->container['host'] = $host; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/OriginInspectorEntry.php b/lib/Model/OriginInspectorEntry.php new file mode 100644 index 00000000..71ebf1f0 --- /dev/null +++ b/lib/Model/OriginInspectorEntry.php @@ -0,0 +1,344 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OriginInspectorEntry implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'origin_inspector_entry'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'dimensions' => '\Fastly\Model\OriginInspectorDimensions', + 'values' => '\Fastly\Model\OriginInspectorValues[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'dimensions' => null, + 'values' => 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 = [ + 'dimensions' => 'dimensions', + 'values' => 'values' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'dimensions' => 'setDimensions', + 'values' => 'setValues' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'dimensions' => 'getDimensions', + 'values' => 'getValues' + ]; + + /** + * 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['dimensions'] = $data['dimensions'] ?? null; + $this->container['values'] = $data['values'] ?? 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 dimensions + * + * @return \Fastly\Model\OriginInspectorDimensions|null + */ + public function getDimensions() + { + return $this->container['dimensions']; + } + + /** + * Sets dimensions + * + * @param \Fastly\Model\OriginInspectorDimensions|null $dimensions dimensions + * + * @return self + */ + public function setDimensions($dimensions) + { + $this->container['dimensions'] = $dimensions; + + return $this; + } + + /** + * Gets values + * + * @return \Fastly\Model\OriginInspectorValues[]|null + */ + public function getValues() + { + return $this->container['values']; + } + + /** + * Sets values + * + * @param \Fastly\Model\OriginInspectorValues[]|null $values An array of values representing the metric values at each point in time. Note that this dataset is sparse: only the keys with non-zero values will be included in the record. + * + * @return self + */ + public function setValues($values) + { + $this->container['values'] = $values; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/OriginInspectorHistorical.php b/lib/Model/OriginInspectorHistorical.php new file mode 100644 index 00000000..e36e0936 --- /dev/null +++ b/lib/Model/OriginInspectorHistorical.php @@ -0,0 +1,404 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OriginInspectorHistorical implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'origin_inspector_historical'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'status' => 'string', + 'meta' => '\Fastly\Model\OriginInspectorHistoricalMeta', + 'msg' => 'string', + 'data' => '\Fastly\Model\OriginInspectorHistoricalData[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'status' => null, + 'meta' => null, + 'msg' => null, + '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 = [ + 'status' => 'status', + 'meta' => 'meta', + 'msg' => 'msg', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'meta' => 'setMeta', + 'msg' => 'setMsg', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'meta' => 'getMeta', + 'msg' => 'getMsg', + '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['status'] = $data['status'] ?? null; + $this->container['meta'] = $data['meta'] ?? null; + $this->container['msg'] = $data['msg'] ?? 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 status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status Whether or not we were able to successfully execute the query. + * + * @return self + */ + public function setStatus($status) + { + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets meta + * + * @return \Fastly\Model\OriginInspectorHistoricalMeta|null + */ + public function getMeta() + { + return $this->container['meta']; + } + + /** + * Sets meta + * + * @param \Fastly\Model\OriginInspectorHistoricalMeta|null $meta meta + * + * @return self + */ + public function setMeta($meta) + { + $this->container['meta'] = $meta; + + return $this; + } + + /** + * Gets msg + * + * @return string|null + */ + public function getMsg() + { + return $this->container['msg']; + } + + /** + * Sets msg + * + * @param string|null $msg If the query was not successful, this will provide a string that explains why. + * + * @return self + */ + public function setMsg($msg) + { + $this->container['msg'] = $msg; + + return $this; + } + + /** + * Gets data + * + * @return \Fastly\Model\OriginInspectorHistoricalData[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Fastly\Model\OriginInspectorHistoricalData[]|null $data A list of [entries](#entry-data-model), each representing one unique combination of dimensions, such as origin host, region or POP. + * + * @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) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/OriginInspectorHistoricalData.php b/lib/Model/OriginInspectorHistoricalData.php new file mode 100644 index 00000000..0e371cbc --- /dev/null +++ b/lib/Model/OriginInspectorHistoricalData.php @@ -0,0 +1,344 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OriginInspectorHistoricalData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'origin_inspector_historical_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'dimensions' => '\Fastly\Model\OriginInspectorDimensions', + 'values' => '\Fastly\Model\Values' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'dimensions' => null, + 'values' => 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 = [ + 'dimensions' => 'dimensions', + 'values' => 'values' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'dimensions' => 'setDimensions', + 'values' => 'setValues' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'dimensions' => 'getDimensions', + 'values' => 'getValues' + ]; + + /** + * 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['dimensions'] = $data['dimensions'] ?? null; + $this->container['values'] = $data['values'] ?? 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 dimensions + * + * @return \Fastly\Model\OriginInspectorDimensions|null + */ + public function getDimensions() + { + return $this->container['dimensions']; + } + + /** + * Sets dimensions + * + * @param \Fastly\Model\OriginInspectorDimensions|null $dimensions dimensions + * + * @return self + */ + public function setDimensions($dimensions) + { + $this->container['dimensions'] = $dimensions; + + return $this; + } + + /** + * Gets values + * + * @return \Fastly\Model\Values|null + */ + public function getValues() + { + return $this->container['values']; + } + + /** + * Sets values + * + * @param \Fastly\Model\Values|null $values values + * + * @return self + */ + public function setValues($values) + { + $this->container['values'] = $values; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/OriginInspectorHistoricalMeta.php b/lib/Model/OriginInspectorHistoricalMeta.php new file mode 100644 index 00000000..11c1d29c --- /dev/null +++ b/lib/Model/OriginInspectorHistoricalMeta.php @@ -0,0 +1,555 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OriginInspectorHistoricalMeta implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'origin_inspector_historical_meta'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'start' => 'string', + 'end' => 'string', + 'downsample' => 'string', + 'metrics' => 'string', + 'limit' => 'float', + 'next_cursor' => 'string', + 'sort' => 'string', + 'group_by' => 'string', + 'filters' => '\Fastly\Model\OriginInspectorHistoricalMetaFilters' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'start' => null, + 'end' => null, + 'downsample' => null, + 'metrics' => null, + 'limit' => null, + 'next_cursor' => null, + 'sort' => null, + 'group_by' => null, + 'filters' => 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 = [ + 'start' => 'start', + 'end' => 'end', + 'downsample' => 'downsample', + 'metrics' => 'metrics', + 'limit' => 'limit', + 'next_cursor' => 'next_cursor', + 'sort' => 'sort', + 'group_by' => 'group_by', + 'filters' => 'filters' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'start' => 'setStart', + 'end' => 'setEnd', + 'downsample' => 'setDownsample', + 'metrics' => 'setMetrics', + 'limit' => 'setLimit', + 'next_cursor' => 'setNextCursor', + 'sort' => 'setSort', + 'group_by' => 'setGroupBy', + 'filters' => 'setFilters' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'start' => 'getStart', + 'end' => 'getEnd', + 'downsample' => 'getDownsample', + 'metrics' => 'getMetrics', + 'limit' => 'getLimit', + 'next_cursor' => 'getNextCursor', + 'sort' => 'getSort', + 'group_by' => 'getGroupBy', + 'filters' => 'getFilters' + ]; + + /** + * 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['start'] = $data['start'] ?? null; + $this->container['end'] = $data['end'] ?? null; + $this->container['downsample'] = $data['downsample'] ?? null; + $this->container['metrics'] = $data['metrics'] ?? null; + $this->container['limit'] = $data['limit'] ?? null; + $this->container['next_cursor'] = $data['next_cursor'] ?? null; + $this->container['sort'] = $data['sort'] ?? null; + $this->container['group_by'] = $data['group_by'] ?? null; + $this->container['filters'] = $data['filters'] ?? 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 start + * + * @return string|null + */ + public function getStart() + { + return $this->container['start']; + } + + /** + * Sets start + * + * @param string|null $start Start time that was used to perform the query as an ISO-8601-formatted date and time. + * + * @return self + */ + public function setStart($start) + { + $this->container['start'] = $start; + + return $this; + } + + /** + * Gets end + * + * @return string|null + */ + public function getEnd() + { + return $this->container['end']; + } + + /** + * Sets end + * + * @param string|null $end End time that was used to perform the query as an ISO-8601-formatted date and time. + * + * @return self + */ + public function setEnd($end) + { + $this->container['end'] = $end; + + return $this; + } + + /** + * Gets downsample + * + * @return string|null + */ + public function getDownsample() + { + return $this->container['downsample']; + } + + /** + * Sets downsample + * + * @param string|null $downsample Downsample that was used to perform the query. One of `minute`, `hour` or `day`. + * + * @return self + */ + public function setDownsample($downsample) + { + $this->container['downsample'] = $downsample; + + return $this; + } + + /** + * Gets metrics + * + * @return string|null + */ + public function getMetrics() + { + return $this->container['metrics']; + } + + /** + * Sets metrics + * + * @param string|null $metrics A comma-separated list of the metrics that were requested. + * + * @return self + */ + public function setMetrics($metrics) + { + $this->container['metrics'] = $metrics; + + return $this; + } + + /** + * Gets limit + * + * @return float|null + */ + public function getLimit() + { + return $this->container['limit']; + } + + /** + * Sets limit + * + * @param float|null $limit The maximum number of results shown per page. + * + * @return self + */ + public function setLimit($limit) + { + $this->container['limit'] = $limit; + + return $this; + } + + /** + * Gets next_cursor + * + * @return string|null + */ + public function getNextCursor() + { + return $this->container['next_cursor']; + } + + /** + * Sets next_cursor + * + * @param string|null $next_cursor A string that can be used to request the next page of results, if any. + * + * @return self + */ + public function setNextCursor($next_cursor) + { + $this->container['next_cursor'] = $next_cursor; + + return $this; + } + + /** + * Gets sort + * + * @return string|null + */ + public function getSort() + { + return $this->container['sort']; + } + + /** + * Sets sort + * + * @param string|null $sort A comma-separated list of keys the results are sorted by. + * + * @return self + */ + public function setSort($sort) + { + $this->container['sort'] = $sort; + + return $this; + } + + /** + * Gets group_by + * + * @return string|null + */ + public function getGroupBy() + { + return $this->container['group_by']; + } + + /** + * Sets group_by + * + * @param string|null $group_by A comma-separated list of dimensions being summed over in the query. + * + * @return self + */ + public function setGroupBy($group_by) + { + $this->container['group_by'] = $group_by; + + return $this; + } + + /** + * Gets filters + * + * @return \Fastly\Model\OriginInspectorHistoricalMetaFilters|null + */ + public function getFilters() + { + return $this->container['filters']; + } + + /** + * Sets filters + * + * @param \Fastly\Model\OriginInspectorHistoricalMetaFilters|null $filters filters + * + * @return self + */ + public function setFilters($filters) + { + $this->container['filters'] = $filters; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/OriginInspectorHistoricalMetaFilters.php b/lib/Model/OriginInspectorHistoricalMetaFilters.php new file mode 100644 index 00000000..d2ac3748 --- /dev/null +++ b/lib/Model/OriginInspectorHistoricalMetaFilters.php @@ -0,0 +1,375 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OriginInspectorHistoricalMetaFilters implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'origin_inspector_historical_meta_filters'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'region' => 'string', + 'datacenter' => 'string', + 'host' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'region' => null, + 'datacenter' => null, + 'host' => 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 = [ + 'region' => 'region', + 'datacenter' => 'datacenter', + 'host' => 'host' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'region' => 'setRegion', + 'datacenter' => 'setDatacenter', + 'host' => 'setHost' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'region' => 'getRegion', + 'datacenter' => 'getDatacenter', + 'host' => 'getHost' + ]; + + /** + * 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['region'] = $data['region'] ?? null; + $this->container['datacenter'] = $data['datacenter'] ?? null; + $this->container['host'] = $data['host'] ?? 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 region + * + * @return string|null + */ + public function getRegion() + { + return $this->container['region']; + } + + /** + * Sets region + * + * @param string|null $region region + * + * @return self + */ + public function setRegion($region) + { + $this->container['region'] = $region; + + return $this; + } + + /** + * Gets datacenter + * + * @return string|null + */ + public function getDatacenter() + { + return $this->container['datacenter']; + } + + /** + * Sets datacenter + * + * @param string|null $datacenter datacenter + * + * @return self + */ + public function setDatacenter($datacenter) + { + $this->container['datacenter'] = $datacenter; + + return $this; + } + + /** + * Gets host + * + * @return string|null + */ + public function getHost() + { + return $this->container['host']; + } + + /** + * Sets host + * + * @param string|null $host host + * + * @return self + */ + public function setHost($host) + { + $this->container['host'] = $host; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/OriginInspectorMeasurements.php b/lib/Model/OriginInspectorMeasurements.php new file mode 100644 index 00000000..bb44b325 --- /dev/null +++ b/lib/Model/OriginInspectorMeasurements.php @@ -0,0 +1,4845 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OriginInspectorMeasurements implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'origin_inspector_measurements'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'responses' => 'int', + 'resp_header_bytes' => 'int', + 'resp_body_bytes' => 'int', + 'status_1xx' => 'int', + 'status_2xx' => 'int', + 'status_3xx' => 'int', + 'status_4xx' => 'int', + 'status_5xx' => 'int', + 'status_200' => 'int', + 'status_204' => 'int', + 'status_206' => 'int', + 'status_301' => 'int', + 'status_302' => 'int', + 'status_304' => 'int', + 'status_400' => 'int', + 'status_401' => 'int', + 'status_403' => 'int', + 'status_404' => 'int', + 'status_416' => 'int', + 'status_429' => 'int', + 'status_500' => 'int', + 'status_501' => 'int', + 'status_502' => 'int', + 'status_503' => 'int', + 'status_504' => 'int', + 'status_505' => 'int', + 'latency_0_to_1ms' => 'int', + 'latency_1_to_5ms' => 'int', + 'latency_5_to_10ms' => 'int', + 'latency_10_to_50ms' => 'int', + 'latency_50_to_100ms' => 'int', + 'latency_100_to_250ms' => 'int', + 'latency_250_to_500ms' => 'int', + 'latency_500_to_1000ms' => 'int', + 'latency_1000_to_5000ms' => 'int', + 'latency_5000_to_10000ms' => 'int', + 'latency_10000_to_60000ms' => 'int', + 'latency_60000ms' => 'int', + 'waf_responses' => 'int', + 'waf_resp_header_bytes' => 'int', + 'waf_resp_body_bytes' => 'int', + 'waf_status_1xx' => 'int', + 'waf_status_2xx' => 'int', + 'waf_status_3xx' => 'int', + 'waf_status_4xx' => 'int', + 'waf_status_5xx' => 'int', + 'waf_status_200' => 'int', + 'waf_status_204' => 'int', + 'waf_status_206' => 'int', + 'waf_status_301' => 'int', + 'waf_status_302' => 'int', + 'waf_status_304' => 'int', + 'waf_status_400' => 'int', + 'waf_status_401' => 'int', + 'waf_status_403' => 'int', + 'waf_status_404' => 'int', + 'waf_status_416' => 'int', + 'waf_status_429' => 'int', + 'waf_status_500' => 'int', + 'waf_status_501' => 'int', + 'waf_status_502' => 'int', + 'waf_status_503' => 'int', + 'waf_status_504' => 'int', + 'waf_status_505' => 'int', + 'waf_latency_0_to_1ms' => 'int', + 'waf_latency_1_to_5ms' => 'int', + 'waf_latency_5_to_10ms' => 'int', + 'waf_latency_10_to_50ms' => 'int', + 'waf_latency_50_to_100ms' => 'int', + 'waf_latency_100_to_250ms' => 'int', + 'waf_latency_250_to_500ms' => 'int', + 'waf_latency_500_to_1000ms' => 'int', + 'waf_latency_1000_to_5000ms' => 'int', + 'waf_latency_5000_to_10000ms' => 'int', + 'waf_latency_10000_to_60000ms' => 'int', + 'waf_latency_60000ms' => 'int', + 'compute_responses' => 'int', + 'compute_resp_header_bytes' => 'int', + 'compute_resp_body_bytes' => 'int', + 'compute_status_1xx' => 'int', + 'compute_status_2xx' => 'int', + 'compute_status_3xx' => 'int', + 'compute_status_4xx' => 'int', + 'compute_status_5xx' => 'int', + 'compute_status_200' => 'int', + 'compute_status_204' => 'int', + 'compute_status_206' => 'int', + 'compute_status_301' => 'int', + 'compute_status_302' => 'int', + 'compute_status_304' => 'int', + 'compute_status_400' => 'int', + 'compute_status_401' => 'int', + 'compute_status_403' => 'int', + 'compute_status_404' => 'int', + 'compute_status_416' => 'int', + 'compute_status_429' => 'int', + 'compute_status_500' => 'int', + 'compute_status_501' => 'int', + 'compute_status_502' => 'int', + 'compute_status_503' => 'int', + 'compute_status_504' => 'int', + 'compute_status_505' => 'int', + 'compute_latency_0_to_1ms' => 'int', + 'compute_latency_1_to_5ms' => 'int', + 'compute_latency_5_to_10ms' => 'int', + 'compute_latency_10_to_50ms' => 'int', + 'compute_latency_50_to_100ms' => 'int', + 'compute_latency_100_to_250ms' => 'int', + 'compute_latency_250_to_500ms' => 'int', + 'compute_latency_500_to_1000ms' => 'int', + 'compute_latency_1000_to_5000ms' => 'int', + 'compute_latency_5000_to_10000ms' => 'int', + 'compute_latency_10000_to_60000ms' => 'int', + 'compute_latency_60000ms' => 'int', + 'all_responses' => 'int', + 'all_resp_header_bytes' => 'int', + 'all_resp_body_bytes' => 'int', + 'all_status_1xx' => 'int', + 'all_status_2xx' => 'int', + 'all_status_3xx' => 'int', + 'all_status_4xx' => 'int', + 'all_status_5xx' => 'int', + 'all_status_200' => 'int', + 'all_status_204' => 'int', + 'all_status_206' => 'int', + 'all_status_301' => 'int', + 'all_status_302' => 'int', + 'all_status_304' => 'int', + 'all_status_400' => 'int', + 'all_status_401' => 'int', + 'all_status_403' => 'int', + 'all_status_404' => 'int', + 'all_status_416' => 'int', + 'all_status_429' => 'int', + 'all_status_500' => 'int', + 'all_status_501' => 'int', + 'all_status_502' => 'int', + 'all_status_503' => 'int', + 'all_status_504' => 'int', + 'all_status_505' => 'int', + 'all_latency_0_to_1ms' => 'int', + 'all_latency_1_to_5ms' => 'int', + 'all_latency_5_to_10ms' => 'int', + 'all_latency_10_to_50ms' => 'int', + 'all_latency_50_to_100ms' => 'int', + 'all_latency_100_to_250ms' => 'int', + 'all_latency_250_to_500ms' => 'int', + 'all_latency_500_to_1000ms' => 'int', + 'all_latency_1000_to_5000ms' => 'int', + 'all_latency_5000_to_10000ms' => 'int', + 'all_latency_10000_to_60000ms' => 'int', + 'all_latency_60000ms' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'responses' => null, + 'resp_header_bytes' => null, + 'resp_body_bytes' => null, + 'status_1xx' => null, + 'status_2xx' => null, + 'status_3xx' => null, + 'status_4xx' => null, + 'status_5xx' => null, + 'status_200' => null, + 'status_204' => null, + 'status_206' => null, + 'status_301' => null, + 'status_302' => null, + 'status_304' => null, + 'status_400' => null, + 'status_401' => null, + 'status_403' => null, + 'status_404' => null, + 'status_416' => null, + 'status_429' => null, + 'status_500' => null, + 'status_501' => null, + 'status_502' => null, + 'status_503' => null, + 'status_504' => null, + 'status_505' => null, + 'latency_0_to_1ms' => null, + 'latency_1_to_5ms' => null, + 'latency_5_to_10ms' => null, + 'latency_10_to_50ms' => null, + 'latency_50_to_100ms' => null, + 'latency_100_to_250ms' => null, + 'latency_250_to_500ms' => null, + 'latency_500_to_1000ms' => null, + 'latency_1000_to_5000ms' => null, + 'latency_5000_to_10000ms' => null, + 'latency_10000_to_60000ms' => null, + 'latency_60000ms' => null, + 'waf_responses' => null, + 'waf_resp_header_bytes' => null, + 'waf_resp_body_bytes' => null, + 'waf_status_1xx' => null, + 'waf_status_2xx' => null, + 'waf_status_3xx' => null, + 'waf_status_4xx' => null, + 'waf_status_5xx' => null, + 'waf_status_200' => null, + 'waf_status_204' => null, + 'waf_status_206' => null, + 'waf_status_301' => null, + 'waf_status_302' => null, + 'waf_status_304' => null, + 'waf_status_400' => null, + 'waf_status_401' => null, + 'waf_status_403' => null, + 'waf_status_404' => null, + 'waf_status_416' => null, + 'waf_status_429' => null, + 'waf_status_500' => null, + 'waf_status_501' => null, + 'waf_status_502' => null, + 'waf_status_503' => null, + 'waf_status_504' => null, + 'waf_status_505' => null, + 'waf_latency_0_to_1ms' => null, + 'waf_latency_1_to_5ms' => null, + 'waf_latency_5_to_10ms' => null, + 'waf_latency_10_to_50ms' => null, + 'waf_latency_50_to_100ms' => null, + 'waf_latency_100_to_250ms' => null, + 'waf_latency_250_to_500ms' => null, + 'waf_latency_500_to_1000ms' => null, + 'waf_latency_1000_to_5000ms' => null, + 'waf_latency_5000_to_10000ms' => null, + 'waf_latency_10000_to_60000ms' => null, + 'waf_latency_60000ms' => null, + 'compute_responses' => null, + 'compute_resp_header_bytes' => null, + 'compute_resp_body_bytes' => null, + 'compute_status_1xx' => null, + 'compute_status_2xx' => null, + 'compute_status_3xx' => null, + 'compute_status_4xx' => null, + 'compute_status_5xx' => null, + 'compute_status_200' => null, + 'compute_status_204' => null, + 'compute_status_206' => null, + 'compute_status_301' => null, + 'compute_status_302' => null, + 'compute_status_304' => null, + 'compute_status_400' => null, + 'compute_status_401' => null, + 'compute_status_403' => null, + 'compute_status_404' => null, + 'compute_status_416' => null, + 'compute_status_429' => null, + 'compute_status_500' => null, + 'compute_status_501' => null, + 'compute_status_502' => null, + 'compute_status_503' => null, + 'compute_status_504' => null, + 'compute_status_505' => null, + 'compute_latency_0_to_1ms' => null, + 'compute_latency_1_to_5ms' => null, + 'compute_latency_5_to_10ms' => null, + 'compute_latency_10_to_50ms' => null, + 'compute_latency_50_to_100ms' => null, + 'compute_latency_100_to_250ms' => null, + 'compute_latency_250_to_500ms' => null, + 'compute_latency_500_to_1000ms' => null, + 'compute_latency_1000_to_5000ms' => null, + 'compute_latency_5000_to_10000ms' => null, + 'compute_latency_10000_to_60000ms' => null, + 'compute_latency_60000ms' => null, + 'all_responses' => null, + 'all_resp_header_bytes' => null, + 'all_resp_body_bytes' => null, + 'all_status_1xx' => null, + 'all_status_2xx' => null, + 'all_status_3xx' => null, + 'all_status_4xx' => null, + 'all_status_5xx' => null, + 'all_status_200' => null, + 'all_status_204' => null, + 'all_status_206' => null, + 'all_status_301' => null, + 'all_status_302' => null, + 'all_status_304' => null, + 'all_status_400' => null, + 'all_status_401' => null, + 'all_status_403' => null, + 'all_status_404' => null, + 'all_status_416' => null, + 'all_status_429' => null, + 'all_status_500' => null, + 'all_status_501' => null, + 'all_status_502' => null, + 'all_status_503' => null, + 'all_status_504' => null, + 'all_status_505' => null, + 'all_latency_0_to_1ms' => null, + 'all_latency_1_to_5ms' => null, + 'all_latency_5_to_10ms' => null, + 'all_latency_10_to_50ms' => null, + 'all_latency_50_to_100ms' => null, + 'all_latency_100_to_250ms' => null, + 'all_latency_250_to_500ms' => null, + 'all_latency_500_to_1000ms' => null, + 'all_latency_1000_to_5000ms' => null, + 'all_latency_5000_to_10000ms' => null, + 'all_latency_10000_to_60000ms' => null, + 'all_latency_60000ms' => 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 = [ + 'responses' => 'responses', + 'resp_header_bytes' => 'resp_header_bytes', + 'resp_body_bytes' => 'resp_body_bytes', + 'status_1xx' => 'status_1xx', + 'status_2xx' => 'status_2xx', + 'status_3xx' => 'status_3xx', + 'status_4xx' => 'status_4xx', + 'status_5xx' => 'status_5xx', + 'status_200' => 'status_200', + 'status_204' => 'status_204', + 'status_206' => 'status_206', + 'status_301' => 'status_301', + 'status_302' => 'status_302', + 'status_304' => 'status_304', + 'status_400' => 'status_400', + 'status_401' => 'status_401', + 'status_403' => 'status_403', + 'status_404' => 'status_404', + 'status_416' => 'status_416', + 'status_429' => 'status_429', + 'status_500' => 'status_500', + 'status_501' => 'status_501', + 'status_502' => 'status_502', + 'status_503' => 'status_503', + 'status_504' => 'status_504', + 'status_505' => 'status_505', + 'latency_0_to_1ms' => 'latency_0_to_1ms', + 'latency_1_to_5ms' => 'latency_1_to_5ms', + 'latency_5_to_10ms' => 'latency_5_to_10ms', + 'latency_10_to_50ms' => 'latency_10_to_50ms', + 'latency_50_to_100ms' => 'latency_50_to_100ms', + 'latency_100_to_250ms' => 'latency_100_to_250ms', + 'latency_250_to_500ms' => 'latency_250_to_500ms', + 'latency_500_to_1000ms' => 'latency_500_to_1000ms', + 'latency_1000_to_5000ms' => 'latency_1000_to_5000ms', + 'latency_5000_to_10000ms' => 'latency_5000_to_10000ms', + 'latency_10000_to_60000ms' => 'latency_10000_to_60000ms', + 'latency_60000ms' => 'latency_60000ms', + 'waf_responses' => 'waf_responses', + 'waf_resp_header_bytes' => 'waf_resp_header_bytes', + 'waf_resp_body_bytes' => 'waf_resp_body_bytes', + 'waf_status_1xx' => 'waf_status_1xx', + 'waf_status_2xx' => 'waf_status_2xx', + 'waf_status_3xx' => 'waf_status_3xx', + 'waf_status_4xx' => 'waf_status_4xx', + 'waf_status_5xx' => 'waf_status_5xx', + 'waf_status_200' => 'waf_status_200', + 'waf_status_204' => 'waf_status_204', + 'waf_status_206' => 'waf_status_206', + 'waf_status_301' => 'waf_status_301', + 'waf_status_302' => 'waf_status_302', + 'waf_status_304' => 'waf_status_304', + 'waf_status_400' => 'waf_status_400', + 'waf_status_401' => 'waf_status_401', + 'waf_status_403' => 'waf_status_403', + 'waf_status_404' => 'waf_status_404', + 'waf_status_416' => 'waf_status_416', + 'waf_status_429' => 'waf_status_429', + 'waf_status_500' => 'waf_status_500', + 'waf_status_501' => 'waf_status_501', + 'waf_status_502' => 'waf_status_502', + 'waf_status_503' => 'waf_status_503', + 'waf_status_504' => 'waf_status_504', + 'waf_status_505' => 'waf_status_505', + 'waf_latency_0_to_1ms' => 'waf_latency_0_to_1ms', + 'waf_latency_1_to_5ms' => 'waf_latency_1_to_5ms', + 'waf_latency_5_to_10ms' => 'waf_latency_5_to_10ms', + 'waf_latency_10_to_50ms' => 'waf_latency_10_to_50ms', + 'waf_latency_50_to_100ms' => 'waf_latency_50_to_100ms', + 'waf_latency_100_to_250ms' => 'waf_latency_100_to_250ms', + 'waf_latency_250_to_500ms' => 'waf_latency_250_to_500ms', + 'waf_latency_500_to_1000ms' => 'waf_latency_500_to_1000ms', + 'waf_latency_1000_to_5000ms' => 'waf_latency_1000_to_5000ms', + 'waf_latency_5000_to_10000ms' => 'waf_latency_5000_to_10000ms', + 'waf_latency_10000_to_60000ms' => 'waf_latency_10000_to_60000ms', + 'waf_latency_60000ms' => 'waf_latency_60000ms', + 'compute_responses' => 'compute_responses', + 'compute_resp_header_bytes' => 'compute_resp_header_bytes', + 'compute_resp_body_bytes' => 'compute_resp_body_bytes', + 'compute_status_1xx' => 'compute_status_1xx', + 'compute_status_2xx' => 'compute_status_2xx', + 'compute_status_3xx' => 'compute_status_3xx', + 'compute_status_4xx' => 'compute_status_4xx', + 'compute_status_5xx' => 'compute_status_5xx', + 'compute_status_200' => 'compute_status_200', + 'compute_status_204' => 'compute_status_204', + 'compute_status_206' => 'compute_status_206', + 'compute_status_301' => 'compute_status_301', + 'compute_status_302' => 'compute_status_302', + 'compute_status_304' => 'compute_status_304', + 'compute_status_400' => 'compute_status_400', + 'compute_status_401' => 'compute_status_401', + 'compute_status_403' => 'compute_status_403', + 'compute_status_404' => 'compute_status_404', + 'compute_status_416' => 'compute_status_416', + 'compute_status_429' => 'compute_status_429', + 'compute_status_500' => 'compute_status_500', + 'compute_status_501' => 'compute_status_501', + 'compute_status_502' => 'compute_status_502', + 'compute_status_503' => 'compute_status_503', + 'compute_status_504' => 'compute_status_504', + 'compute_status_505' => 'compute_status_505', + 'compute_latency_0_to_1ms' => 'compute_latency_0_to_1ms', + 'compute_latency_1_to_5ms' => 'compute_latency_1_to_5ms', + 'compute_latency_5_to_10ms' => 'compute_latency_5_to_10ms', + 'compute_latency_10_to_50ms' => 'compute_latency_10_to_50ms', + 'compute_latency_50_to_100ms' => 'compute_latency_50_to_100ms', + 'compute_latency_100_to_250ms' => 'compute_latency_100_to_250ms', + 'compute_latency_250_to_500ms' => 'compute_latency_250_to_500ms', + 'compute_latency_500_to_1000ms' => 'compute_latency_500_to_1000ms', + 'compute_latency_1000_to_5000ms' => 'compute_latency_1000_to_5000ms', + 'compute_latency_5000_to_10000ms' => 'compute_latency_5000_to_10000ms', + 'compute_latency_10000_to_60000ms' => 'compute_latency_10000_to_60000ms', + 'compute_latency_60000ms' => 'compute_latency_60000ms', + 'all_responses' => 'all_responses', + 'all_resp_header_bytes' => 'all_resp_header_bytes', + 'all_resp_body_bytes' => 'all_resp_body_bytes', + 'all_status_1xx' => 'all_status_1xx', + '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_200' => 'all_status_200', + 'all_status_204' => 'all_status_204', + 'all_status_206' => 'all_status_206', + 'all_status_301' => 'all_status_301', + 'all_status_302' => 'all_status_302', + 'all_status_304' => 'all_status_304', + 'all_status_400' => 'all_status_400', + 'all_status_401' => 'all_status_401', + 'all_status_403' => 'all_status_403', + 'all_status_404' => 'all_status_404', + 'all_status_416' => 'all_status_416', + 'all_status_429' => 'all_status_429', + 'all_status_500' => 'all_status_500', + 'all_status_501' => 'all_status_501', + 'all_status_502' => 'all_status_502', + 'all_status_503' => 'all_status_503', + 'all_status_504' => 'all_status_504', + 'all_status_505' => 'all_status_505', + 'all_latency_0_to_1ms' => 'all_latency_0_to_1ms', + 'all_latency_1_to_5ms' => 'all_latency_1_to_5ms', + 'all_latency_5_to_10ms' => 'all_latency_5_to_10ms', + 'all_latency_10_to_50ms' => 'all_latency_10_to_50ms', + 'all_latency_50_to_100ms' => 'all_latency_50_to_100ms', + 'all_latency_100_to_250ms' => 'all_latency_100_to_250ms', + 'all_latency_250_to_500ms' => 'all_latency_250_to_500ms', + 'all_latency_500_to_1000ms' => 'all_latency_500_to_1000ms', + 'all_latency_1000_to_5000ms' => 'all_latency_1000_to_5000ms', + 'all_latency_5000_to_10000ms' => 'all_latency_5000_to_10000ms', + 'all_latency_10000_to_60000ms' => 'all_latency_10000_to_60000ms', + 'all_latency_60000ms' => 'all_latency_60000ms' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'responses' => 'setResponses', + 'resp_header_bytes' => 'setRespHeaderBytes', + 'resp_body_bytes' => 'setRespBodyBytes', + 'status_1xx' => 'setStatus1xx', + 'status_2xx' => 'setStatus2xx', + 'status_3xx' => 'setStatus3xx', + 'status_4xx' => 'setStatus4xx', + 'status_5xx' => 'setStatus5xx', + 'status_200' => 'setStatus200', + 'status_204' => 'setStatus204', + 'status_206' => 'setStatus206', + 'status_301' => 'setStatus301', + 'status_302' => 'setStatus302', + 'status_304' => 'setStatus304', + 'status_400' => 'setStatus400', + 'status_401' => 'setStatus401', + 'status_403' => 'setStatus403', + 'status_404' => 'setStatus404', + 'status_416' => 'setStatus416', + 'status_429' => 'setStatus429', + 'status_500' => 'setStatus500', + 'status_501' => 'setStatus501', + 'status_502' => 'setStatus502', + 'status_503' => 'setStatus503', + 'status_504' => 'setStatus504', + 'status_505' => 'setStatus505', + 'latency_0_to_1ms' => 'setLatency0To1ms', + 'latency_1_to_5ms' => 'setLatency1To5ms', + 'latency_5_to_10ms' => 'setLatency5To10ms', + 'latency_10_to_50ms' => 'setLatency10To50ms', + 'latency_50_to_100ms' => 'setLatency50To100ms', + 'latency_100_to_250ms' => 'setLatency100To250ms', + 'latency_250_to_500ms' => 'setLatency250To500ms', + 'latency_500_to_1000ms' => 'setLatency500To1000ms', + 'latency_1000_to_5000ms' => 'setLatency1000To5000ms', + 'latency_5000_to_10000ms' => 'setLatency5000To10000ms', + 'latency_10000_to_60000ms' => 'setLatency10000To60000ms', + 'latency_60000ms' => 'setLatency60000ms', + 'waf_responses' => 'setWafResponses', + 'waf_resp_header_bytes' => 'setWafRespHeaderBytes', + 'waf_resp_body_bytes' => 'setWafRespBodyBytes', + 'waf_status_1xx' => 'setWafStatus1xx', + 'waf_status_2xx' => 'setWafStatus2xx', + 'waf_status_3xx' => 'setWafStatus3xx', + 'waf_status_4xx' => 'setWafStatus4xx', + 'waf_status_5xx' => 'setWafStatus5xx', + 'waf_status_200' => 'setWafStatus200', + 'waf_status_204' => 'setWafStatus204', + 'waf_status_206' => 'setWafStatus206', + 'waf_status_301' => 'setWafStatus301', + 'waf_status_302' => 'setWafStatus302', + 'waf_status_304' => 'setWafStatus304', + 'waf_status_400' => 'setWafStatus400', + 'waf_status_401' => 'setWafStatus401', + 'waf_status_403' => 'setWafStatus403', + 'waf_status_404' => 'setWafStatus404', + 'waf_status_416' => 'setWafStatus416', + 'waf_status_429' => 'setWafStatus429', + 'waf_status_500' => 'setWafStatus500', + 'waf_status_501' => 'setWafStatus501', + 'waf_status_502' => 'setWafStatus502', + 'waf_status_503' => 'setWafStatus503', + 'waf_status_504' => 'setWafStatus504', + 'waf_status_505' => 'setWafStatus505', + 'waf_latency_0_to_1ms' => 'setWafLatency0To1ms', + 'waf_latency_1_to_5ms' => 'setWafLatency1To5ms', + 'waf_latency_5_to_10ms' => 'setWafLatency5To10ms', + 'waf_latency_10_to_50ms' => 'setWafLatency10To50ms', + 'waf_latency_50_to_100ms' => 'setWafLatency50To100ms', + 'waf_latency_100_to_250ms' => 'setWafLatency100To250ms', + 'waf_latency_250_to_500ms' => 'setWafLatency250To500ms', + 'waf_latency_500_to_1000ms' => 'setWafLatency500To1000ms', + 'waf_latency_1000_to_5000ms' => 'setWafLatency1000To5000ms', + 'waf_latency_5000_to_10000ms' => 'setWafLatency5000To10000ms', + 'waf_latency_10000_to_60000ms' => 'setWafLatency10000To60000ms', + 'waf_latency_60000ms' => 'setWafLatency60000ms', + 'compute_responses' => 'setComputeResponses', + 'compute_resp_header_bytes' => 'setComputeRespHeaderBytes', + 'compute_resp_body_bytes' => 'setComputeRespBodyBytes', + 'compute_status_1xx' => 'setComputeStatus1xx', + 'compute_status_2xx' => 'setComputeStatus2xx', + 'compute_status_3xx' => 'setComputeStatus3xx', + 'compute_status_4xx' => 'setComputeStatus4xx', + 'compute_status_5xx' => 'setComputeStatus5xx', + 'compute_status_200' => 'setComputeStatus200', + 'compute_status_204' => 'setComputeStatus204', + 'compute_status_206' => 'setComputeStatus206', + 'compute_status_301' => 'setComputeStatus301', + 'compute_status_302' => 'setComputeStatus302', + 'compute_status_304' => 'setComputeStatus304', + 'compute_status_400' => 'setComputeStatus400', + 'compute_status_401' => 'setComputeStatus401', + 'compute_status_403' => 'setComputeStatus403', + 'compute_status_404' => 'setComputeStatus404', + 'compute_status_416' => 'setComputeStatus416', + 'compute_status_429' => 'setComputeStatus429', + 'compute_status_500' => 'setComputeStatus500', + 'compute_status_501' => 'setComputeStatus501', + 'compute_status_502' => 'setComputeStatus502', + 'compute_status_503' => 'setComputeStatus503', + 'compute_status_504' => 'setComputeStatus504', + 'compute_status_505' => 'setComputeStatus505', + 'compute_latency_0_to_1ms' => 'setComputeLatency0To1ms', + 'compute_latency_1_to_5ms' => 'setComputeLatency1To5ms', + 'compute_latency_5_to_10ms' => 'setComputeLatency5To10ms', + 'compute_latency_10_to_50ms' => 'setComputeLatency10To50ms', + 'compute_latency_50_to_100ms' => 'setComputeLatency50To100ms', + 'compute_latency_100_to_250ms' => 'setComputeLatency100To250ms', + 'compute_latency_250_to_500ms' => 'setComputeLatency250To500ms', + 'compute_latency_500_to_1000ms' => 'setComputeLatency500To1000ms', + 'compute_latency_1000_to_5000ms' => 'setComputeLatency1000To5000ms', + 'compute_latency_5000_to_10000ms' => 'setComputeLatency5000To10000ms', + 'compute_latency_10000_to_60000ms' => 'setComputeLatency10000To60000ms', + 'compute_latency_60000ms' => 'setComputeLatency60000ms', + 'all_responses' => 'setAllResponses', + 'all_resp_header_bytes' => 'setAllRespHeaderBytes', + 'all_resp_body_bytes' => 'setAllRespBodyBytes', + 'all_status_1xx' => 'setAllStatus1xx', + 'all_status_2xx' => 'setAllStatus2xx', + 'all_status_3xx' => 'setAllStatus3xx', + 'all_status_4xx' => 'setAllStatus4xx', + 'all_status_5xx' => 'setAllStatus5xx', + 'all_status_200' => 'setAllStatus200', + 'all_status_204' => 'setAllStatus204', + 'all_status_206' => 'setAllStatus206', + 'all_status_301' => 'setAllStatus301', + 'all_status_302' => 'setAllStatus302', + 'all_status_304' => 'setAllStatus304', + 'all_status_400' => 'setAllStatus400', + 'all_status_401' => 'setAllStatus401', + 'all_status_403' => 'setAllStatus403', + 'all_status_404' => 'setAllStatus404', + 'all_status_416' => 'setAllStatus416', + 'all_status_429' => 'setAllStatus429', + 'all_status_500' => 'setAllStatus500', + 'all_status_501' => 'setAllStatus501', + 'all_status_502' => 'setAllStatus502', + 'all_status_503' => 'setAllStatus503', + 'all_status_504' => 'setAllStatus504', + 'all_status_505' => 'setAllStatus505', + 'all_latency_0_to_1ms' => 'setAllLatency0To1ms', + 'all_latency_1_to_5ms' => 'setAllLatency1To5ms', + 'all_latency_5_to_10ms' => 'setAllLatency5To10ms', + 'all_latency_10_to_50ms' => 'setAllLatency10To50ms', + 'all_latency_50_to_100ms' => 'setAllLatency50To100ms', + 'all_latency_100_to_250ms' => 'setAllLatency100To250ms', + 'all_latency_250_to_500ms' => 'setAllLatency250To500ms', + 'all_latency_500_to_1000ms' => 'setAllLatency500To1000ms', + 'all_latency_1000_to_5000ms' => 'setAllLatency1000To5000ms', + 'all_latency_5000_to_10000ms' => 'setAllLatency5000To10000ms', + 'all_latency_10000_to_60000ms' => 'setAllLatency10000To60000ms', + 'all_latency_60000ms' => 'setAllLatency60000ms' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'responses' => 'getResponses', + 'resp_header_bytes' => 'getRespHeaderBytes', + 'resp_body_bytes' => 'getRespBodyBytes', + 'status_1xx' => 'getStatus1xx', + 'status_2xx' => 'getStatus2xx', + 'status_3xx' => 'getStatus3xx', + 'status_4xx' => 'getStatus4xx', + 'status_5xx' => 'getStatus5xx', + 'status_200' => 'getStatus200', + 'status_204' => 'getStatus204', + 'status_206' => 'getStatus206', + 'status_301' => 'getStatus301', + 'status_302' => 'getStatus302', + 'status_304' => 'getStatus304', + 'status_400' => 'getStatus400', + 'status_401' => 'getStatus401', + 'status_403' => 'getStatus403', + 'status_404' => 'getStatus404', + 'status_416' => 'getStatus416', + 'status_429' => 'getStatus429', + 'status_500' => 'getStatus500', + 'status_501' => 'getStatus501', + 'status_502' => 'getStatus502', + 'status_503' => 'getStatus503', + 'status_504' => 'getStatus504', + 'status_505' => 'getStatus505', + 'latency_0_to_1ms' => 'getLatency0To1ms', + 'latency_1_to_5ms' => 'getLatency1To5ms', + 'latency_5_to_10ms' => 'getLatency5To10ms', + 'latency_10_to_50ms' => 'getLatency10To50ms', + 'latency_50_to_100ms' => 'getLatency50To100ms', + 'latency_100_to_250ms' => 'getLatency100To250ms', + 'latency_250_to_500ms' => 'getLatency250To500ms', + 'latency_500_to_1000ms' => 'getLatency500To1000ms', + 'latency_1000_to_5000ms' => 'getLatency1000To5000ms', + 'latency_5000_to_10000ms' => 'getLatency5000To10000ms', + 'latency_10000_to_60000ms' => 'getLatency10000To60000ms', + 'latency_60000ms' => 'getLatency60000ms', + 'waf_responses' => 'getWafResponses', + 'waf_resp_header_bytes' => 'getWafRespHeaderBytes', + 'waf_resp_body_bytes' => 'getWafRespBodyBytes', + 'waf_status_1xx' => 'getWafStatus1xx', + 'waf_status_2xx' => 'getWafStatus2xx', + 'waf_status_3xx' => 'getWafStatus3xx', + 'waf_status_4xx' => 'getWafStatus4xx', + 'waf_status_5xx' => 'getWafStatus5xx', + 'waf_status_200' => 'getWafStatus200', + 'waf_status_204' => 'getWafStatus204', + 'waf_status_206' => 'getWafStatus206', + 'waf_status_301' => 'getWafStatus301', + 'waf_status_302' => 'getWafStatus302', + 'waf_status_304' => 'getWafStatus304', + 'waf_status_400' => 'getWafStatus400', + 'waf_status_401' => 'getWafStatus401', + 'waf_status_403' => 'getWafStatus403', + 'waf_status_404' => 'getWafStatus404', + 'waf_status_416' => 'getWafStatus416', + 'waf_status_429' => 'getWafStatus429', + 'waf_status_500' => 'getWafStatus500', + 'waf_status_501' => 'getWafStatus501', + 'waf_status_502' => 'getWafStatus502', + 'waf_status_503' => 'getWafStatus503', + 'waf_status_504' => 'getWafStatus504', + 'waf_status_505' => 'getWafStatus505', + 'waf_latency_0_to_1ms' => 'getWafLatency0To1ms', + 'waf_latency_1_to_5ms' => 'getWafLatency1To5ms', + 'waf_latency_5_to_10ms' => 'getWafLatency5To10ms', + 'waf_latency_10_to_50ms' => 'getWafLatency10To50ms', + 'waf_latency_50_to_100ms' => 'getWafLatency50To100ms', + 'waf_latency_100_to_250ms' => 'getWafLatency100To250ms', + 'waf_latency_250_to_500ms' => 'getWafLatency250To500ms', + 'waf_latency_500_to_1000ms' => 'getWafLatency500To1000ms', + 'waf_latency_1000_to_5000ms' => 'getWafLatency1000To5000ms', + 'waf_latency_5000_to_10000ms' => 'getWafLatency5000To10000ms', + 'waf_latency_10000_to_60000ms' => 'getWafLatency10000To60000ms', + 'waf_latency_60000ms' => 'getWafLatency60000ms', + 'compute_responses' => 'getComputeResponses', + 'compute_resp_header_bytes' => 'getComputeRespHeaderBytes', + 'compute_resp_body_bytes' => 'getComputeRespBodyBytes', + 'compute_status_1xx' => 'getComputeStatus1xx', + 'compute_status_2xx' => 'getComputeStatus2xx', + 'compute_status_3xx' => 'getComputeStatus3xx', + 'compute_status_4xx' => 'getComputeStatus4xx', + 'compute_status_5xx' => 'getComputeStatus5xx', + 'compute_status_200' => 'getComputeStatus200', + 'compute_status_204' => 'getComputeStatus204', + 'compute_status_206' => 'getComputeStatus206', + 'compute_status_301' => 'getComputeStatus301', + 'compute_status_302' => 'getComputeStatus302', + 'compute_status_304' => 'getComputeStatus304', + 'compute_status_400' => 'getComputeStatus400', + 'compute_status_401' => 'getComputeStatus401', + 'compute_status_403' => 'getComputeStatus403', + 'compute_status_404' => 'getComputeStatus404', + 'compute_status_416' => 'getComputeStatus416', + 'compute_status_429' => 'getComputeStatus429', + 'compute_status_500' => 'getComputeStatus500', + 'compute_status_501' => 'getComputeStatus501', + 'compute_status_502' => 'getComputeStatus502', + 'compute_status_503' => 'getComputeStatus503', + 'compute_status_504' => 'getComputeStatus504', + 'compute_status_505' => 'getComputeStatus505', + 'compute_latency_0_to_1ms' => 'getComputeLatency0To1ms', + 'compute_latency_1_to_5ms' => 'getComputeLatency1To5ms', + 'compute_latency_5_to_10ms' => 'getComputeLatency5To10ms', + 'compute_latency_10_to_50ms' => 'getComputeLatency10To50ms', + 'compute_latency_50_to_100ms' => 'getComputeLatency50To100ms', + 'compute_latency_100_to_250ms' => 'getComputeLatency100To250ms', + 'compute_latency_250_to_500ms' => 'getComputeLatency250To500ms', + 'compute_latency_500_to_1000ms' => 'getComputeLatency500To1000ms', + 'compute_latency_1000_to_5000ms' => 'getComputeLatency1000To5000ms', + 'compute_latency_5000_to_10000ms' => 'getComputeLatency5000To10000ms', + 'compute_latency_10000_to_60000ms' => 'getComputeLatency10000To60000ms', + 'compute_latency_60000ms' => 'getComputeLatency60000ms', + 'all_responses' => 'getAllResponses', + 'all_resp_header_bytes' => 'getAllRespHeaderBytes', + 'all_resp_body_bytes' => 'getAllRespBodyBytes', + 'all_status_1xx' => 'getAllStatus1xx', + 'all_status_2xx' => 'getAllStatus2xx', + 'all_status_3xx' => 'getAllStatus3xx', + 'all_status_4xx' => 'getAllStatus4xx', + 'all_status_5xx' => 'getAllStatus5xx', + 'all_status_200' => 'getAllStatus200', + 'all_status_204' => 'getAllStatus204', + 'all_status_206' => 'getAllStatus206', + 'all_status_301' => 'getAllStatus301', + 'all_status_302' => 'getAllStatus302', + 'all_status_304' => 'getAllStatus304', + 'all_status_400' => 'getAllStatus400', + 'all_status_401' => 'getAllStatus401', + 'all_status_403' => 'getAllStatus403', + 'all_status_404' => 'getAllStatus404', + 'all_status_416' => 'getAllStatus416', + 'all_status_429' => 'getAllStatus429', + 'all_status_500' => 'getAllStatus500', + 'all_status_501' => 'getAllStatus501', + 'all_status_502' => 'getAllStatus502', + 'all_status_503' => 'getAllStatus503', + 'all_status_504' => 'getAllStatus504', + 'all_status_505' => 'getAllStatus505', + 'all_latency_0_to_1ms' => 'getAllLatency0To1ms', + 'all_latency_1_to_5ms' => 'getAllLatency1To5ms', + 'all_latency_5_to_10ms' => 'getAllLatency5To10ms', + 'all_latency_10_to_50ms' => 'getAllLatency10To50ms', + 'all_latency_50_to_100ms' => 'getAllLatency50To100ms', + 'all_latency_100_to_250ms' => 'getAllLatency100To250ms', + 'all_latency_250_to_500ms' => 'getAllLatency250To500ms', + 'all_latency_500_to_1000ms' => 'getAllLatency500To1000ms', + 'all_latency_1000_to_5000ms' => 'getAllLatency1000To5000ms', + 'all_latency_5000_to_10000ms' => 'getAllLatency5000To10000ms', + 'all_latency_10000_to_60000ms' => 'getAllLatency10000To60000ms', + 'all_latency_60000ms' => 'getAllLatency60000ms' + ]; + + /** + * 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['responses'] = $data['responses'] ?? null; + $this->container['resp_header_bytes'] = $data['resp_header_bytes'] ?? null; + $this->container['resp_body_bytes'] = $data['resp_body_bytes'] ?? null; + $this->container['status_1xx'] = $data['status_1xx'] ?? null; + $this->container['status_2xx'] = $data['status_2xx'] ?? null; + $this->container['status_3xx'] = $data['status_3xx'] ?? null; + $this->container['status_4xx'] = $data['status_4xx'] ?? null; + $this->container['status_5xx'] = $data['status_5xx'] ?? null; + $this->container['status_200'] = $data['status_200'] ?? null; + $this->container['status_204'] = $data['status_204'] ?? null; + $this->container['status_206'] = $data['status_206'] ?? null; + $this->container['status_301'] = $data['status_301'] ?? null; + $this->container['status_302'] = $data['status_302'] ?? null; + $this->container['status_304'] = $data['status_304'] ?? null; + $this->container['status_400'] = $data['status_400'] ?? null; + $this->container['status_401'] = $data['status_401'] ?? null; + $this->container['status_403'] = $data['status_403'] ?? null; + $this->container['status_404'] = $data['status_404'] ?? null; + $this->container['status_416'] = $data['status_416'] ?? null; + $this->container['status_429'] = $data['status_429'] ?? null; + $this->container['status_500'] = $data['status_500'] ?? null; + $this->container['status_501'] = $data['status_501'] ?? null; + $this->container['status_502'] = $data['status_502'] ?? null; + $this->container['status_503'] = $data['status_503'] ?? null; + $this->container['status_504'] = $data['status_504'] ?? null; + $this->container['status_505'] = $data['status_505'] ?? null; + $this->container['latency_0_to_1ms'] = $data['latency_0_to_1ms'] ?? null; + $this->container['latency_1_to_5ms'] = $data['latency_1_to_5ms'] ?? null; + $this->container['latency_5_to_10ms'] = $data['latency_5_to_10ms'] ?? null; + $this->container['latency_10_to_50ms'] = $data['latency_10_to_50ms'] ?? null; + $this->container['latency_50_to_100ms'] = $data['latency_50_to_100ms'] ?? null; + $this->container['latency_100_to_250ms'] = $data['latency_100_to_250ms'] ?? null; + $this->container['latency_250_to_500ms'] = $data['latency_250_to_500ms'] ?? null; + $this->container['latency_500_to_1000ms'] = $data['latency_500_to_1000ms'] ?? null; + $this->container['latency_1000_to_5000ms'] = $data['latency_1000_to_5000ms'] ?? null; + $this->container['latency_5000_to_10000ms'] = $data['latency_5000_to_10000ms'] ?? null; + $this->container['latency_10000_to_60000ms'] = $data['latency_10000_to_60000ms'] ?? null; + $this->container['latency_60000ms'] = $data['latency_60000ms'] ?? null; + $this->container['waf_responses'] = $data['waf_responses'] ?? null; + $this->container['waf_resp_header_bytes'] = $data['waf_resp_header_bytes'] ?? null; + $this->container['waf_resp_body_bytes'] = $data['waf_resp_body_bytes'] ?? null; + $this->container['waf_status_1xx'] = $data['waf_status_1xx'] ?? null; + $this->container['waf_status_2xx'] = $data['waf_status_2xx'] ?? null; + $this->container['waf_status_3xx'] = $data['waf_status_3xx'] ?? null; + $this->container['waf_status_4xx'] = $data['waf_status_4xx'] ?? null; + $this->container['waf_status_5xx'] = $data['waf_status_5xx'] ?? null; + $this->container['waf_status_200'] = $data['waf_status_200'] ?? null; + $this->container['waf_status_204'] = $data['waf_status_204'] ?? null; + $this->container['waf_status_206'] = $data['waf_status_206'] ?? null; + $this->container['waf_status_301'] = $data['waf_status_301'] ?? null; + $this->container['waf_status_302'] = $data['waf_status_302'] ?? null; + $this->container['waf_status_304'] = $data['waf_status_304'] ?? null; + $this->container['waf_status_400'] = $data['waf_status_400'] ?? null; + $this->container['waf_status_401'] = $data['waf_status_401'] ?? null; + $this->container['waf_status_403'] = $data['waf_status_403'] ?? null; + $this->container['waf_status_404'] = $data['waf_status_404'] ?? null; + $this->container['waf_status_416'] = $data['waf_status_416'] ?? null; + $this->container['waf_status_429'] = $data['waf_status_429'] ?? null; + $this->container['waf_status_500'] = $data['waf_status_500'] ?? null; + $this->container['waf_status_501'] = $data['waf_status_501'] ?? null; + $this->container['waf_status_502'] = $data['waf_status_502'] ?? null; + $this->container['waf_status_503'] = $data['waf_status_503'] ?? null; + $this->container['waf_status_504'] = $data['waf_status_504'] ?? null; + $this->container['waf_status_505'] = $data['waf_status_505'] ?? null; + $this->container['waf_latency_0_to_1ms'] = $data['waf_latency_0_to_1ms'] ?? null; + $this->container['waf_latency_1_to_5ms'] = $data['waf_latency_1_to_5ms'] ?? null; + $this->container['waf_latency_5_to_10ms'] = $data['waf_latency_5_to_10ms'] ?? null; + $this->container['waf_latency_10_to_50ms'] = $data['waf_latency_10_to_50ms'] ?? null; + $this->container['waf_latency_50_to_100ms'] = $data['waf_latency_50_to_100ms'] ?? null; + $this->container['waf_latency_100_to_250ms'] = $data['waf_latency_100_to_250ms'] ?? null; + $this->container['waf_latency_250_to_500ms'] = $data['waf_latency_250_to_500ms'] ?? null; + $this->container['waf_latency_500_to_1000ms'] = $data['waf_latency_500_to_1000ms'] ?? null; + $this->container['waf_latency_1000_to_5000ms'] = $data['waf_latency_1000_to_5000ms'] ?? null; + $this->container['waf_latency_5000_to_10000ms'] = $data['waf_latency_5000_to_10000ms'] ?? null; + $this->container['waf_latency_10000_to_60000ms'] = $data['waf_latency_10000_to_60000ms'] ?? null; + $this->container['waf_latency_60000ms'] = $data['waf_latency_60000ms'] ?? null; + $this->container['compute_responses'] = $data['compute_responses'] ?? null; + $this->container['compute_resp_header_bytes'] = $data['compute_resp_header_bytes'] ?? null; + $this->container['compute_resp_body_bytes'] = $data['compute_resp_body_bytes'] ?? null; + $this->container['compute_status_1xx'] = $data['compute_status_1xx'] ?? null; + $this->container['compute_status_2xx'] = $data['compute_status_2xx'] ?? null; + $this->container['compute_status_3xx'] = $data['compute_status_3xx'] ?? null; + $this->container['compute_status_4xx'] = $data['compute_status_4xx'] ?? null; + $this->container['compute_status_5xx'] = $data['compute_status_5xx'] ?? null; + $this->container['compute_status_200'] = $data['compute_status_200'] ?? null; + $this->container['compute_status_204'] = $data['compute_status_204'] ?? null; + $this->container['compute_status_206'] = $data['compute_status_206'] ?? null; + $this->container['compute_status_301'] = $data['compute_status_301'] ?? null; + $this->container['compute_status_302'] = $data['compute_status_302'] ?? null; + $this->container['compute_status_304'] = $data['compute_status_304'] ?? null; + $this->container['compute_status_400'] = $data['compute_status_400'] ?? null; + $this->container['compute_status_401'] = $data['compute_status_401'] ?? null; + $this->container['compute_status_403'] = $data['compute_status_403'] ?? null; + $this->container['compute_status_404'] = $data['compute_status_404'] ?? null; + $this->container['compute_status_416'] = $data['compute_status_416'] ?? null; + $this->container['compute_status_429'] = $data['compute_status_429'] ?? null; + $this->container['compute_status_500'] = $data['compute_status_500'] ?? null; + $this->container['compute_status_501'] = $data['compute_status_501'] ?? null; + $this->container['compute_status_502'] = $data['compute_status_502'] ?? null; + $this->container['compute_status_503'] = $data['compute_status_503'] ?? null; + $this->container['compute_status_504'] = $data['compute_status_504'] ?? null; + $this->container['compute_status_505'] = $data['compute_status_505'] ?? null; + $this->container['compute_latency_0_to_1ms'] = $data['compute_latency_0_to_1ms'] ?? null; + $this->container['compute_latency_1_to_5ms'] = $data['compute_latency_1_to_5ms'] ?? null; + $this->container['compute_latency_5_to_10ms'] = $data['compute_latency_5_to_10ms'] ?? null; + $this->container['compute_latency_10_to_50ms'] = $data['compute_latency_10_to_50ms'] ?? null; + $this->container['compute_latency_50_to_100ms'] = $data['compute_latency_50_to_100ms'] ?? null; + $this->container['compute_latency_100_to_250ms'] = $data['compute_latency_100_to_250ms'] ?? null; + $this->container['compute_latency_250_to_500ms'] = $data['compute_latency_250_to_500ms'] ?? null; + $this->container['compute_latency_500_to_1000ms'] = $data['compute_latency_500_to_1000ms'] ?? null; + $this->container['compute_latency_1000_to_5000ms'] = $data['compute_latency_1000_to_5000ms'] ?? null; + $this->container['compute_latency_5000_to_10000ms'] = $data['compute_latency_5000_to_10000ms'] ?? null; + $this->container['compute_latency_10000_to_60000ms'] = $data['compute_latency_10000_to_60000ms'] ?? null; + $this->container['compute_latency_60000ms'] = $data['compute_latency_60000ms'] ?? null; + $this->container['all_responses'] = $data['all_responses'] ?? null; + $this->container['all_resp_header_bytes'] = $data['all_resp_header_bytes'] ?? null; + $this->container['all_resp_body_bytes'] = $data['all_resp_body_bytes'] ?? null; + $this->container['all_status_1xx'] = $data['all_status_1xx'] ?? null; + $this->container['all_status_2xx'] = $data['all_status_2xx'] ?? 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['all_status_200'] = $data['all_status_200'] ?? null; + $this->container['all_status_204'] = $data['all_status_204'] ?? null; + $this->container['all_status_206'] = $data['all_status_206'] ?? null; + $this->container['all_status_301'] = $data['all_status_301'] ?? null; + $this->container['all_status_302'] = $data['all_status_302'] ?? null; + $this->container['all_status_304'] = $data['all_status_304'] ?? null; + $this->container['all_status_400'] = $data['all_status_400'] ?? null; + $this->container['all_status_401'] = $data['all_status_401'] ?? null; + $this->container['all_status_403'] = $data['all_status_403'] ?? null; + $this->container['all_status_404'] = $data['all_status_404'] ?? null; + $this->container['all_status_416'] = $data['all_status_416'] ?? null; + $this->container['all_status_429'] = $data['all_status_429'] ?? null; + $this->container['all_status_500'] = $data['all_status_500'] ?? null; + $this->container['all_status_501'] = $data['all_status_501'] ?? null; + $this->container['all_status_502'] = $data['all_status_502'] ?? null; + $this->container['all_status_503'] = $data['all_status_503'] ?? null; + $this->container['all_status_504'] = $data['all_status_504'] ?? null; + $this->container['all_status_505'] = $data['all_status_505'] ?? null; + $this->container['all_latency_0_to_1ms'] = $data['all_latency_0_to_1ms'] ?? null; + $this->container['all_latency_1_to_5ms'] = $data['all_latency_1_to_5ms'] ?? null; + $this->container['all_latency_5_to_10ms'] = $data['all_latency_5_to_10ms'] ?? null; + $this->container['all_latency_10_to_50ms'] = $data['all_latency_10_to_50ms'] ?? null; + $this->container['all_latency_50_to_100ms'] = $data['all_latency_50_to_100ms'] ?? null; + $this->container['all_latency_100_to_250ms'] = $data['all_latency_100_to_250ms'] ?? null; + $this->container['all_latency_250_to_500ms'] = $data['all_latency_250_to_500ms'] ?? null; + $this->container['all_latency_500_to_1000ms'] = $data['all_latency_500_to_1000ms'] ?? null; + $this->container['all_latency_1000_to_5000ms'] = $data['all_latency_1000_to_5000ms'] ?? null; + $this->container['all_latency_5000_to_10000ms'] = $data['all_latency_5000_to_10000ms'] ?? null; + $this->container['all_latency_10000_to_60000ms'] = $data['all_latency_10000_to_60000ms'] ?? null; + $this->container['all_latency_60000ms'] = $data['all_latency_60000ms'] ?? 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 responses + * + * @return int|null + */ + public function getResponses() + { + return $this->container['responses']; + } + + /** + * Sets responses + * + * @param int|null $responses Number of responses from origin. + * + * @return self + */ + public function setResponses($responses) + { + $this->container['responses'] = $responses; + + return $this; + } + + /** + * Gets resp_header_bytes + * + * @return int|null + */ + public function getRespHeaderBytes() + { + return $this->container['resp_header_bytes']; + } + + /** + * Sets resp_header_bytes + * + * @param int|null $resp_header_bytes Number of header bytes from origin. + * + * @return self + */ + public function setRespHeaderBytes($resp_header_bytes) + { + $this->container['resp_header_bytes'] = $resp_header_bytes; + + return $this; + } + + /** + * Gets resp_body_bytes + * + * @return int|null + */ + public function getRespBodyBytes() + { + return $this->container['resp_body_bytes']; + } + + /** + * Sets resp_body_bytes + * + * @param int|null $resp_body_bytes Number of body bytes from origin. + * + * @return self + */ + public function setRespBodyBytes($resp_body_bytes) + { + $this->container['resp_body_bytes'] = $resp_body_bytes; + + return $this; + } + + /** + * Gets status_1xx + * + * @return int|null + */ + public function getStatus1xx() + { + return $this->container['status_1xx']; + } + + /** + * Sets status_1xx + * + * @param int|null $status_1xx Number of 1xx \"Informational\" status codes delivered from origin. + * + * @return self + */ + public function setStatus1xx($status_1xx) + { + $this->container['status_1xx'] = $status_1xx; + + return $this; + } + + /** + * Gets status_2xx + * + * @return int|null + */ + public function getStatus2xx() + { + return $this->container['status_2xx']; + } + + /** + * Sets status_2xx + * + * @param int|null $status_2xx Number of 2xx \"Success\" status codes delivered from origin. + * + * @return self + */ + public function setStatus2xx($status_2xx) + { + $this->container['status_2xx'] = $status_2xx; + + return $this; + } + + /** + * Gets status_3xx + * + * @return int|null + */ + public function getStatus3xx() + { + return $this->container['status_3xx']; + } + + /** + * Sets status_3xx + * + * @param int|null $status_3xx Number of 3xx \"Redirection\" codes delivered from origin. + * + * @return self + */ + public function setStatus3xx($status_3xx) + { + $this->container['status_3xx'] = $status_3xx; + + return $this; + } + + /** + * Gets status_4xx + * + * @return int|null + */ + public function getStatus4xx() + { + return $this->container['status_4xx']; + } + + /** + * Sets status_4xx + * + * @param int|null $status_4xx Number of 4xx \"Client Error\" codes delivered from origin. + * + * @return self + */ + public function setStatus4xx($status_4xx) + { + $this->container['status_4xx'] = $status_4xx; + + return $this; + } + + /** + * Gets status_5xx + * + * @return int|null + */ + public function getStatus5xx() + { + return $this->container['status_5xx']; + } + + /** + * Sets status_5xx + * + * @param int|null $status_5xx Number of 5xx \"Server Error\" codes delivered from origin. + * + * @return self + */ + public function setStatus5xx($status_5xx) + { + $this->container['status_5xx'] = $status_5xx; + + return $this; + } + + /** + * Gets status_200 + * + * @return int|null + */ + public function getStatus200() + { + return $this->container['status_200']; + } + + /** + * Sets status_200 + * + * @param int|null $status_200 Number of responses received with status code 200 (Success) from origin. + * + * @return self + */ + public function setStatus200($status_200) + { + $this->container['status_200'] = $status_200; + + return $this; + } + + /** + * Gets status_204 + * + * @return int|null + */ + public function getStatus204() + { + return $this->container['status_204']; + } + + /** + * Sets status_204 + * + * @param int|null $status_204 Number of responses received with status code 204 (No Content) from origin. + * + * @return self + */ + public function setStatus204($status_204) + { + $this->container['status_204'] = $status_204; + + return $this; + } + + /** + * Gets status_206 + * + * @return int|null + */ + public function getStatus206() + { + return $this->container['status_206']; + } + + /** + * Sets status_206 + * + * @param int|null $status_206 Number of responses received with status code 206 (Partial Content) from origin. + * + * @return self + */ + public function setStatus206($status_206) + { + $this->container['status_206'] = $status_206; + + return $this; + } + + /** + * Gets status_301 + * + * @return int|null + */ + public function getStatus301() + { + return $this->container['status_301']; + } + + /** + * Sets status_301 + * + * @param int|null $status_301 Number of responses received with status code 301 (Moved Permanently) from origin. + * + * @return self + */ + public function setStatus301($status_301) + { + $this->container['status_301'] = $status_301; + + return $this; + } + + /** + * Gets status_302 + * + * @return int|null + */ + public function getStatus302() + { + return $this->container['status_302']; + } + + /** + * Sets status_302 + * + * @param int|null $status_302 Number of responses received with status code 302 (Found) from origin. + * + * @return self + */ + public function setStatus302($status_302) + { + $this->container['status_302'] = $status_302; + + return $this; + } + + /** + * Gets status_304 + * + * @return int|null + */ + public function getStatus304() + { + return $this->container['status_304']; + } + + /** + * Sets status_304 + * + * @param int|null $status_304 Number of responses received with status code 304 (Not Modified) from origin. + * + * @return self + */ + public function setStatus304($status_304) + { + $this->container['status_304'] = $status_304; + + return $this; + } + + /** + * Gets status_400 + * + * @return int|null + */ + public function getStatus400() + { + return $this->container['status_400']; + } + + /** + * Sets status_400 + * + * @param int|null $status_400 Number of responses received with status code 400 (Bad Request) from origin. + * + * @return self + */ + public function setStatus400($status_400) + { + $this->container['status_400'] = $status_400; + + return $this; + } + + /** + * Gets status_401 + * + * @return int|null + */ + public function getStatus401() + { + return $this->container['status_401']; + } + + /** + * Sets status_401 + * + * @param int|null $status_401 Number of responses received with status code 401 (Unauthorized) from origin. + * + * @return self + */ + public function setStatus401($status_401) + { + $this->container['status_401'] = $status_401; + + return $this; + } + + /** + * Gets status_403 + * + * @return int|null + */ + public function getStatus403() + { + return $this->container['status_403']; + } + + /** + * Sets status_403 + * + * @param int|null $status_403 Number of responses received with status code 403 (Forbidden) from origin. + * + * @return self + */ + public function setStatus403($status_403) + { + $this->container['status_403'] = $status_403; + + return $this; + } + + /** + * Gets status_404 + * + * @return int|null + */ + public function getStatus404() + { + return $this->container['status_404']; + } + + /** + * Sets status_404 + * + * @param int|null $status_404 Number of responses received with status code 404 (Not Found) from origin. + * + * @return self + */ + public function setStatus404($status_404) + { + $this->container['status_404'] = $status_404; + + return $this; + } + + /** + * Gets status_416 + * + * @return int|null + */ + public function getStatus416() + { + return $this->container['status_416']; + } + + /** + * Sets status_416 + * + * @param int|null $status_416 Number of responses received with status code 416 (Range Not Satisfiable) from origin. + * + * @return self + */ + public function setStatus416($status_416) + { + $this->container['status_416'] = $status_416; + + return $this; + } + + /** + * Gets status_429 + * + * @return int|null + */ + public function getStatus429() + { + return $this->container['status_429']; + } + + /** + * Sets status_429 + * + * @param int|null $status_429 Number of responses received with status code 429 (Too Many Requests) from origin. + * + * @return self + */ + public function setStatus429($status_429) + { + $this->container['status_429'] = $status_429; + + return $this; + } + + /** + * Gets status_500 + * + * @return int|null + */ + public function getStatus500() + { + return $this->container['status_500']; + } + + /** + * Sets status_500 + * + * @param int|null $status_500 Number of responses received with status code 500 (Internal Server Error) from origin. + * + * @return self + */ + public function setStatus500($status_500) + { + $this->container['status_500'] = $status_500; + + return $this; + } + + /** + * Gets status_501 + * + * @return int|null + */ + public function getStatus501() + { + return $this->container['status_501']; + } + + /** + * Sets status_501 + * + * @param int|null $status_501 Number of responses received with status code 501 (Not Implemented) from origin. + * + * @return self + */ + public function setStatus501($status_501) + { + $this->container['status_501'] = $status_501; + + return $this; + } + + /** + * Gets status_502 + * + * @return int|null + */ + public function getStatus502() + { + return $this->container['status_502']; + } + + /** + * Sets status_502 + * + * @param int|null $status_502 Number of responses received with status code 502 (Bad Gateway) from origin. + * + * @return self + */ + public function setStatus502($status_502) + { + $this->container['status_502'] = $status_502; + + return $this; + } + + /** + * Gets status_503 + * + * @return int|null + */ + public function getStatus503() + { + return $this->container['status_503']; + } + + /** + * Sets status_503 + * + * @param int|null $status_503 Number of responses received with status code 503 (Service Unavailable) from origin. + * + * @return self + */ + public function setStatus503($status_503) + { + $this->container['status_503'] = $status_503; + + return $this; + } + + /** + * Gets status_504 + * + * @return int|null + */ + public function getStatus504() + { + return $this->container['status_504']; + } + + /** + * Sets status_504 + * + * @param int|null $status_504 Number of responses received with status code 504 (Gateway Timeout) from origin. + * + * @return self + */ + public function setStatus504($status_504) + { + $this->container['status_504'] = $status_504; + + return $this; + } + + /** + * Gets status_505 + * + * @return int|null + */ + public function getStatus505() + { + return $this->container['status_505']; + } + + /** + * Sets status_505 + * + * @param int|null $status_505 Number of responses received with status code 505 (HTTP Version Not Supported) from origin. + * + * @return self + */ + public function setStatus505($status_505) + { + $this->container['status_505'] = $status_505; + + return $this; + } + + /** + * Gets latency_0_to_1ms + * + * @return int|null + */ + public function getLatency0To1ms() + { + return $this->container['latency_0_to_1ms']; + } + + /** + * Sets latency_0_to_1ms + * + * @param int|null $latency_0_to_1ms Number of responses from origin with latency between 0 and 1 millisecond. + * + * @return self + */ + public function setLatency0To1ms($latency_0_to_1ms) + { + $this->container['latency_0_to_1ms'] = $latency_0_to_1ms; + + return $this; + } + + /** + * Gets latency_1_to_5ms + * + * @return int|null + */ + public function getLatency1To5ms() + { + return $this->container['latency_1_to_5ms']; + } + + /** + * Sets latency_1_to_5ms + * + * @param int|null $latency_1_to_5ms Number of responses from origin with latency between 1 and 5 milliseconds. + * + * @return self + */ + public function setLatency1To5ms($latency_1_to_5ms) + { + $this->container['latency_1_to_5ms'] = $latency_1_to_5ms; + + return $this; + } + + /** + * Gets latency_5_to_10ms + * + * @return int|null + */ + public function getLatency5To10ms() + { + return $this->container['latency_5_to_10ms']; + } + + /** + * Sets latency_5_to_10ms + * + * @param int|null $latency_5_to_10ms Number of responses from origin with latency between 5 and 10 milliseconds. + * + * @return self + */ + public function setLatency5To10ms($latency_5_to_10ms) + { + $this->container['latency_5_to_10ms'] = $latency_5_to_10ms; + + return $this; + } + + /** + * Gets latency_10_to_50ms + * + * @return int|null + */ + public function getLatency10To50ms() + { + return $this->container['latency_10_to_50ms']; + } + + /** + * Sets latency_10_to_50ms + * + * @param int|null $latency_10_to_50ms Number of responses from origin with latency between 10 and 50 milliseconds. + * + * @return self + */ + public function setLatency10To50ms($latency_10_to_50ms) + { + $this->container['latency_10_to_50ms'] = $latency_10_to_50ms; + + return $this; + } + + /** + * Gets latency_50_to_100ms + * + * @return int|null + */ + public function getLatency50To100ms() + { + return $this->container['latency_50_to_100ms']; + } + + /** + * Sets latency_50_to_100ms + * + * @param int|null $latency_50_to_100ms Number of responses from origin with latency between 50 and 100 milliseconds. + * + * @return self + */ + public function setLatency50To100ms($latency_50_to_100ms) + { + $this->container['latency_50_to_100ms'] = $latency_50_to_100ms; + + return $this; + } + + /** + * Gets latency_100_to_250ms + * + * @return int|null + */ + public function getLatency100To250ms() + { + return $this->container['latency_100_to_250ms']; + } + + /** + * Sets latency_100_to_250ms + * + * @param int|null $latency_100_to_250ms Number of responses from origin with latency between 100 and 250 milliseconds. + * + * @return self + */ + public function setLatency100To250ms($latency_100_to_250ms) + { + $this->container['latency_100_to_250ms'] = $latency_100_to_250ms; + + return $this; + } + + /** + * Gets latency_250_to_500ms + * + * @return int|null + */ + public function getLatency250To500ms() + { + return $this->container['latency_250_to_500ms']; + } + + /** + * Sets latency_250_to_500ms + * + * @param int|null $latency_250_to_500ms Number of responses from origin with latency between 250 and 500 milliseconds. + * + * @return self + */ + public function setLatency250To500ms($latency_250_to_500ms) + { + $this->container['latency_250_to_500ms'] = $latency_250_to_500ms; + + return $this; + } + + /** + * Gets latency_500_to_1000ms + * + * @return int|null + */ + public function getLatency500To1000ms() + { + return $this->container['latency_500_to_1000ms']; + } + + /** + * Sets latency_500_to_1000ms + * + * @param int|null $latency_500_to_1000ms Number of responses from origin with latency between 500 and 1,000 milliseconds. + * + * @return self + */ + public function setLatency500To1000ms($latency_500_to_1000ms) + { + $this->container['latency_500_to_1000ms'] = $latency_500_to_1000ms; + + return $this; + } + + /** + * Gets latency_1000_to_5000ms + * + * @return int|null + */ + public function getLatency1000To5000ms() + { + return $this->container['latency_1000_to_5000ms']; + } + + /** + * Sets latency_1000_to_5000ms + * + * @param int|null $latency_1000_to_5000ms Number of responses from origin with latency between 1,000 and 5,000 milliseconds. + * + * @return self + */ + public function setLatency1000To5000ms($latency_1000_to_5000ms) + { + $this->container['latency_1000_to_5000ms'] = $latency_1000_to_5000ms; + + return $this; + } + + /** + * Gets latency_5000_to_10000ms + * + * @return int|null + */ + public function getLatency5000To10000ms() + { + return $this->container['latency_5000_to_10000ms']; + } + + /** + * Sets latency_5000_to_10000ms + * + * @param int|null $latency_5000_to_10000ms Number of responses from origin with latency between 5,000 and 10,000 milliseconds. + * + * @return self + */ + public function setLatency5000To10000ms($latency_5000_to_10000ms) + { + $this->container['latency_5000_to_10000ms'] = $latency_5000_to_10000ms; + + return $this; + } + + /** + * Gets latency_10000_to_60000ms + * + * @return int|null + */ + public function getLatency10000To60000ms() + { + return $this->container['latency_10000_to_60000ms']; + } + + /** + * Sets latency_10000_to_60000ms + * + * @param int|null $latency_10000_to_60000ms Number of responses from origin with latency between 10,000 and 60,000 milliseconds. + * + * @return self + */ + public function setLatency10000To60000ms($latency_10000_to_60000ms) + { + $this->container['latency_10000_to_60000ms'] = $latency_10000_to_60000ms; + + return $this; + } + + /** + * Gets latency_60000ms + * + * @return int|null + */ + public function getLatency60000ms() + { + return $this->container['latency_60000ms']; + } + + /** + * Sets latency_60000ms + * + * @param int|null $latency_60000ms Number of responses from origin with latency of 60,000 milliseconds and above. + * + * @return self + */ + public function setLatency60000ms($latency_60000ms) + { + $this->container['latency_60000ms'] = $latency_60000ms; + + return $this; + } + + /** + * Gets waf_responses + * + * @return int|null + */ + public function getWafResponses() + { + return $this->container['waf_responses']; + } + + /** + * Sets waf_responses + * + * @param int|null $waf_responses Number of responses received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafResponses($waf_responses) + { + $this->container['waf_responses'] = $waf_responses; + + return $this; + } + + /** + * Gets waf_resp_header_bytes + * + * @return int|null + */ + public function getWafRespHeaderBytes() + { + return $this->container['waf_resp_header_bytes']; + } + + /** + * Sets waf_resp_header_bytes + * + * @param int|null $waf_resp_header_bytes Number of header bytes received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafRespHeaderBytes($waf_resp_header_bytes) + { + $this->container['waf_resp_header_bytes'] = $waf_resp_header_bytes; + + return $this; + } + + /** + * Gets waf_resp_body_bytes + * + * @return int|null + */ + public function getWafRespBodyBytes() + { + return $this->container['waf_resp_body_bytes']; + } + + /** + * Sets waf_resp_body_bytes + * + * @param int|null $waf_resp_body_bytes Number of body bytes received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafRespBodyBytes($waf_resp_body_bytes) + { + $this->container['waf_resp_body_bytes'] = $waf_resp_body_bytes; + + return $this; + } + + /** + * Gets waf_status_1xx + * + * @return int|null + */ + public function getWafStatus1xx() + { + return $this->container['waf_status_1xx']; + } + + /** + * Sets waf_status_1xx + * + * @param int|null $waf_status_1xx Number of 1xx \"Informational\" status codes received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafStatus1xx($waf_status_1xx) + { + $this->container['waf_status_1xx'] = $waf_status_1xx; + + return $this; + } + + /** + * Gets waf_status_2xx + * + * @return int|null + */ + public function getWafStatus2xx() + { + return $this->container['waf_status_2xx']; + } + + /** + * Sets waf_status_2xx + * + * @param int|null $waf_status_2xx Number of 2xx \"Success\" status codes received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafStatus2xx($waf_status_2xx) + { + $this->container['waf_status_2xx'] = $waf_status_2xx; + + return $this; + } + + /** + * Gets waf_status_3xx + * + * @return int|null + */ + public function getWafStatus3xx() + { + return $this->container['waf_status_3xx']; + } + + /** + * Sets waf_status_3xx + * + * @param int|null $waf_status_3xx Number of 3xx \"Redirection\" codes received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafStatus3xx($waf_status_3xx) + { + $this->container['waf_status_3xx'] = $waf_status_3xx; + + return $this; + } + + /** + * Gets waf_status_4xx + * + * @return int|null + */ + public function getWafStatus4xx() + { + return $this->container['waf_status_4xx']; + } + + /** + * Sets waf_status_4xx + * + * @param int|null $waf_status_4xx Number of 4xx \"Client Error\" codes received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafStatus4xx($waf_status_4xx) + { + $this->container['waf_status_4xx'] = $waf_status_4xx; + + return $this; + } + + /** + * Gets waf_status_5xx + * + * @return int|null + */ + public function getWafStatus5xx() + { + return $this->container['waf_status_5xx']; + } + + /** + * Sets waf_status_5xx + * + * @param int|null $waf_status_5xx Number of 5xx \"Server Error\" codes received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafStatus5xx($waf_status_5xx) + { + $this->container['waf_status_5xx'] = $waf_status_5xx; + + return $this; + } + + /** + * Gets waf_status_200 + * + * @return int|null + */ + public function getWafStatus200() + { + return $this->container['waf_status_200']; + } + + /** + * Sets waf_status_200 + * + * @param int|null $waf_status_200 Number of responses received with status code 200 (Success) received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafStatus200($waf_status_200) + { + $this->container['waf_status_200'] = $waf_status_200; + + return $this; + } + + /** + * Gets waf_status_204 + * + * @return int|null + */ + public function getWafStatus204() + { + return $this->container['waf_status_204']; + } + + /** + * Sets waf_status_204 + * + * @param int|null $waf_status_204 Number of responses received with status code 204 (No Content) received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafStatus204($waf_status_204) + { + $this->container['waf_status_204'] = $waf_status_204; + + return $this; + } + + /** + * Gets waf_status_206 + * + * @return int|null + */ + public function getWafStatus206() + { + return $this->container['waf_status_206']; + } + + /** + * Sets waf_status_206 + * + * @param int|null $waf_status_206 Number of responses received with status code 206 (Partial Content) received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafStatus206($waf_status_206) + { + $this->container['waf_status_206'] = $waf_status_206; + + return $this; + } + + /** + * Gets waf_status_301 + * + * @return int|null + */ + public function getWafStatus301() + { + return $this->container['waf_status_301']; + } + + /** + * Sets waf_status_301 + * + * @param int|null $waf_status_301 Number of responses received with status code 301 (Moved Permanently) received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafStatus301($waf_status_301) + { + $this->container['waf_status_301'] = $waf_status_301; + + return $this; + } + + /** + * Gets waf_status_302 + * + * @return int|null + */ + public function getWafStatus302() + { + return $this->container['waf_status_302']; + } + + /** + * Sets waf_status_302 + * + * @param int|null $waf_status_302 Number of responses received with status code 302 (Found) received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafStatus302($waf_status_302) + { + $this->container['waf_status_302'] = $waf_status_302; + + return $this; + } + + /** + * Gets waf_status_304 + * + * @return int|null + */ + public function getWafStatus304() + { + return $this->container['waf_status_304']; + } + + /** + * Sets waf_status_304 + * + * @param int|null $waf_status_304 Number of responses received with status code 304 (Not Modified) received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafStatus304($waf_status_304) + { + $this->container['waf_status_304'] = $waf_status_304; + + return $this; + } + + /** + * Gets waf_status_400 + * + * @return int|null + */ + public function getWafStatus400() + { + return $this->container['waf_status_400']; + } + + /** + * Sets waf_status_400 + * + * @param int|null $waf_status_400 Number of responses received with status code 400 (Bad Request) received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafStatus400($waf_status_400) + { + $this->container['waf_status_400'] = $waf_status_400; + + return $this; + } + + /** + * Gets waf_status_401 + * + * @return int|null + */ + public function getWafStatus401() + { + return $this->container['waf_status_401']; + } + + /** + * Sets waf_status_401 + * + * @param int|null $waf_status_401 Number of responses received with status code 401 (Unauthorized) received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafStatus401($waf_status_401) + { + $this->container['waf_status_401'] = $waf_status_401; + + return $this; + } + + /** + * Gets waf_status_403 + * + * @return int|null + */ + public function getWafStatus403() + { + return $this->container['waf_status_403']; + } + + /** + * Sets waf_status_403 + * + * @param int|null $waf_status_403 Number of responses received with status code 403 (Forbidden) received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafStatus403($waf_status_403) + { + $this->container['waf_status_403'] = $waf_status_403; + + return $this; + } + + /** + * Gets waf_status_404 + * + * @return int|null + */ + public function getWafStatus404() + { + return $this->container['waf_status_404']; + } + + /** + * Sets waf_status_404 + * + * @param int|null $waf_status_404 Number of responses received with status code 404 (Not Found) received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafStatus404($waf_status_404) + { + $this->container['waf_status_404'] = $waf_status_404; + + return $this; + } + + /** + * Gets waf_status_416 + * + * @return int|null + */ + public function getWafStatus416() + { + return $this->container['waf_status_416']; + } + + /** + * Sets waf_status_416 + * + * @param int|null $waf_status_416 Number of responses received with status code 416 (Range Not Satisfiable) received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafStatus416($waf_status_416) + { + $this->container['waf_status_416'] = $waf_status_416; + + return $this; + } + + /** + * Gets waf_status_429 + * + * @return int|null + */ + public function getWafStatus429() + { + return $this->container['waf_status_429']; + } + + /** + * Sets waf_status_429 + * + * @param int|null $waf_status_429 Number of responses received with status code 429 (Too Many Requests) received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafStatus429($waf_status_429) + { + $this->container['waf_status_429'] = $waf_status_429; + + return $this; + } + + /** + * Gets waf_status_500 + * + * @return int|null + */ + public function getWafStatus500() + { + return $this->container['waf_status_500']; + } + + /** + * Sets waf_status_500 + * + * @param int|null $waf_status_500 Number of responses received with status code 500 (Internal Server Error) received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafStatus500($waf_status_500) + { + $this->container['waf_status_500'] = $waf_status_500; + + return $this; + } + + /** + * Gets waf_status_501 + * + * @return int|null + */ + public function getWafStatus501() + { + return $this->container['waf_status_501']; + } + + /** + * Sets waf_status_501 + * + * @param int|null $waf_status_501 Number of responses received with status code 501 (Not Implemented) received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafStatus501($waf_status_501) + { + $this->container['waf_status_501'] = $waf_status_501; + + return $this; + } + + /** + * Gets waf_status_502 + * + * @return int|null + */ + public function getWafStatus502() + { + return $this->container['waf_status_502']; + } + + /** + * Sets waf_status_502 + * + * @param int|null $waf_status_502 Number of responses received with status code 502 (Bad Gateway) received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafStatus502($waf_status_502) + { + $this->container['waf_status_502'] = $waf_status_502; + + return $this; + } + + /** + * Gets waf_status_503 + * + * @return int|null + */ + public function getWafStatus503() + { + return $this->container['waf_status_503']; + } + + /** + * Sets waf_status_503 + * + * @param int|null $waf_status_503 Number of responses received with status code 503 (Service Unavailable) received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafStatus503($waf_status_503) + { + $this->container['waf_status_503'] = $waf_status_503; + + return $this; + } + + /** + * Gets waf_status_504 + * + * @return int|null + */ + public function getWafStatus504() + { + return $this->container['waf_status_504']; + } + + /** + * Sets waf_status_504 + * + * @param int|null $waf_status_504 Number of responses received with status code 504 (Gateway Timeout) received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafStatus504($waf_status_504) + { + $this->container['waf_status_504'] = $waf_status_504; + + return $this; + } + + /** + * Gets waf_status_505 + * + * @return int|null + */ + public function getWafStatus505() + { + return $this->container['waf_status_505']; + } + + /** + * Sets waf_status_505 + * + * @param int|null $waf_status_505 Number of responses received with status code 505 (HTTP Version Not Supported) received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafStatus505($waf_status_505) + { + $this->container['waf_status_505'] = $waf_status_505; + + return $this; + } + + /** + * Gets waf_latency_0_to_1ms + * + * @return int|null + */ + public function getWafLatency0To1ms() + { + return $this->container['waf_latency_0_to_1ms']; + } + + /** + * Sets waf_latency_0_to_1ms + * + * @param int|null $waf_latency_0_to_1ms Number of responses with latency between 0 and 1 millisecond received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafLatency0To1ms($waf_latency_0_to_1ms) + { + $this->container['waf_latency_0_to_1ms'] = $waf_latency_0_to_1ms; + + return $this; + } + + /** + * Gets waf_latency_1_to_5ms + * + * @return int|null + */ + public function getWafLatency1To5ms() + { + return $this->container['waf_latency_1_to_5ms']; + } + + /** + * Sets waf_latency_1_to_5ms + * + * @param int|null $waf_latency_1_to_5ms Number of responses with latency between 1 and 5 milliseconds received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafLatency1To5ms($waf_latency_1_to_5ms) + { + $this->container['waf_latency_1_to_5ms'] = $waf_latency_1_to_5ms; + + return $this; + } + + /** + * Gets waf_latency_5_to_10ms + * + * @return int|null + */ + public function getWafLatency5To10ms() + { + return $this->container['waf_latency_5_to_10ms']; + } + + /** + * Sets waf_latency_5_to_10ms + * + * @param int|null $waf_latency_5_to_10ms Number of responses with latency between 5 and 10 milliseconds received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafLatency5To10ms($waf_latency_5_to_10ms) + { + $this->container['waf_latency_5_to_10ms'] = $waf_latency_5_to_10ms; + + return $this; + } + + /** + * Gets waf_latency_10_to_50ms + * + * @return int|null + */ + public function getWafLatency10To50ms() + { + return $this->container['waf_latency_10_to_50ms']; + } + + /** + * Sets waf_latency_10_to_50ms + * + * @param int|null $waf_latency_10_to_50ms Number of responses with latency between 10 and 50 milliseconds received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafLatency10To50ms($waf_latency_10_to_50ms) + { + $this->container['waf_latency_10_to_50ms'] = $waf_latency_10_to_50ms; + + return $this; + } + + /** + * Gets waf_latency_50_to_100ms + * + * @return int|null + */ + public function getWafLatency50To100ms() + { + return $this->container['waf_latency_50_to_100ms']; + } + + /** + * Sets waf_latency_50_to_100ms + * + * @param int|null $waf_latency_50_to_100ms Number of responses with latency between 50 and 100 milliseconds received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafLatency50To100ms($waf_latency_50_to_100ms) + { + $this->container['waf_latency_50_to_100ms'] = $waf_latency_50_to_100ms; + + return $this; + } + + /** + * Gets waf_latency_100_to_250ms + * + * @return int|null + */ + public function getWafLatency100To250ms() + { + return $this->container['waf_latency_100_to_250ms']; + } + + /** + * Sets waf_latency_100_to_250ms + * + * @param int|null $waf_latency_100_to_250ms Number of responses with latency between 100 and 250 milliseconds received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafLatency100To250ms($waf_latency_100_to_250ms) + { + $this->container['waf_latency_100_to_250ms'] = $waf_latency_100_to_250ms; + + return $this; + } + + /** + * Gets waf_latency_250_to_500ms + * + * @return int|null + */ + public function getWafLatency250To500ms() + { + return $this->container['waf_latency_250_to_500ms']; + } + + /** + * Sets waf_latency_250_to_500ms + * + * @param int|null $waf_latency_250_to_500ms Number of responses with latency between 250 and 500 milliseconds received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafLatency250To500ms($waf_latency_250_to_500ms) + { + $this->container['waf_latency_250_to_500ms'] = $waf_latency_250_to_500ms; + + return $this; + } + + /** + * Gets waf_latency_500_to_1000ms + * + * @return int|null + */ + public function getWafLatency500To1000ms() + { + return $this->container['waf_latency_500_to_1000ms']; + } + + /** + * Sets waf_latency_500_to_1000ms + * + * @param int|null $waf_latency_500_to_1000ms Number of responses with latency between 500 and 1,000 milliseconds received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafLatency500To1000ms($waf_latency_500_to_1000ms) + { + $this->container['waf_latency_500_to_1000ms'] = $waf_latency_500_to_1000ms; + + return $this; + } + + /** + * Gets waf_latency_1000_to_5000ms + * + * @return int|null + */ + public function getWafLatency1000To5000ms() + { + return $this->container['waf_latency_1000_to_5000ms']; + } + + /** + * Sets waf_latency_1000_to_5000ms + * + * @param int|null $waf_latency_1000_to_5000ms Number of responses with latency between 1,000 and 5,000 milliseconds received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafLatency1000To5000ms($waf_latency_1000_to_5000ms) + { + $this->container['waf_latency_1000_to_5000ms'] = $waf_latency_1000_to_5000ms; + + return $this; + } + + /** + * Gets waf_latency_5000_to_10000ms + * + * @return int|null + */ + public function getWafLatency5000To10000ms() + { + return $this->container['waf_latency_5000_to_10000ms']; + } + + /** + * Sets waf_latency_5000_to_10000ms + * + * @param int|null $waf_latency_5000_to_10000ms Number of responses with latency between 5,000 and 10,000 milliseconds received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafLatency5000To10000ms($waf_latency_5000_to_10000ms) + { + $this->container['waf_latency_5000_to_10000ms'] = $waf_latency_5000_to_10000ms; + + return $this; + } + + /** + * Gets waf_latency_10000_to_60000ms + * + * @return int|null + */ + public function getWafLatency10000To60000ms() + { + return $this->container['waf_latency_10000_to_60000ms']; + } + + /** + * Sets waf_latency_10000_to_60000ms + * + * @param int|null $waf_latency_10000_to_60000ms Number of responses with latency between 10,000 and 60,000 milliseconds received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafLatency10000To60000ms($waf_latency_10000_to_60000ms) + { + $this->container['waf_latency_10000_to_60000ms'] = $waf_latency_10000_to_60000ms; + + return $this; + } + + /** + * Gets waf_latency_60000ms + * + * @return int|null + */ + public function getWafLatency60000ms() + { + return $this->container['waf_latency_60000ms']; + } + + /** + * Sets waf_latency_60000ms + * + * @param int|null $waf_latency_60000ms Number of responses with latency of 60,000 milliseconds and above received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafLatency60000ms($waf_latency_60000ms) + { + $this->container['waf_latency_60000ms'] = $waf_latency_60000ms; + + return $this; + } + + /** + * Gets compute_responses + * + * @return int|null + */ + public function getComputeResponses() + { + return $this->container['compute_responses']; + } + + /** + * Sets compute_responses + * + * @param int|null $compute_responses Number of responses for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeResponses($compute_responses) + { + $this->container['compute_responses'] = $compute_responses; + + return $this; + } + + /** + * Gets compute_resp_header_bytes + * + * @return int|null + */ + public function getComputeRespHeaderBytes() + { + return $this->container['compute_resp_header_bytes']; + } + + /** + * Sets compute_resp_header_bytes + * + * @param int|null $compute_resp_header_bytes Number of header bytes for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeRespHeaderBytes($compute_resp_header_bytes) + { + $this->container['compute_resp_header_bytes'] = $compute_resp_header_bytes; + + return $this; + } + + /** + * Gets compute_resp_body_bytes + * + * @return int|null + */ + public function getComputeRespBodyBytes() + { + return $this->container['compute_resp_body_bytes']; + } + + /** + * Sets compute_resp_body_bytes + * + * @param int|null $compute_resp_body_bytes Number of body bytes for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeRespBodyBytes($compute_resp_body_bytes) + { + $this->container['compute_resp_body_bytes'] = $compute_resp_body_bytes; + + return $this; + } + + /** + * Gets compute_status_1xx + * + * @return int|null + */ + public function getComputeStatus1xx() + { + return $this->container['compute_status_1xx']; + } + + /** + * Sets compute_status_1xx + * + * @param int|null $compute_status_1xx Number of 1xx \"Informational\" status codes for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeStatus1xx($compute_status_1xx) + { + $this->container['compute_status_1xx'] = $compute_status_1xx; + + return $this; + } + + /** + * Gets compute_status_2xx + * + * @return int|null + */ + public function getComputeStatus2xx() + { + return $this->container['compute_status_2xx']; + } + + /** + * Sets compute_status_2xx + * + * @param int|null $compute_status_2xx Number of 2xx \"Success\" status codes for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeStatus2xx($compute_status_2xx) + { + $this->container['compute_status_2xx'] = $compute_status_2xx; + + return $this; + } + + /** + * Gets compute_status_3xx + * + * @return int|null + */ + public function getComputeStatus3xx() + { + return $this->container['compute_status_3xx']; + } + + /** + * Sets compute_status_3xx + * + * @param int|null $compute_status_3xx Number of 3xx \"Redirection\" codes for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeStatus3xx($compute_status_3xx) + { + $this->container['compute_status_3xx'] = $compute_status_3xx; + + return $this; + } + + /** + * Gets compute_status_4xx + * + * @return int|null + */ + public function getComputeStatus4xx() + { + return $this->container['compute_status_4xx']; + } + + /** + * Sets compute_status_4xx + * + * @param int|null $compute_status_4xx Number of 4xx \"Client Error\" codes for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeStatus4xx($compute_status_4xx) + { + $this->container['compute_status_4xx'] = $compute_status_4xx; + + return $this; + } + + /** + * Gets compute_status_5xx + * + * @return int|null + */ + public function getComputeStatus5xx() + { + return $this->container['compute_status_5xx']; + } + + /** + * Sets compute_status_5xx + * + * @param int|null $compute_status_5xx Number of 5xx \"Server Error\" codes for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeStatus5xx($compute_status_5xx) + { + $this->container['compute_status_5xx'] = $compute_status_5xx; + + return $this; + } + + /** + * Gets compute_status_200 + * + * @return int|null + */ + public function getComputeStatus200() + { + return $this->container['compute_status_200']; + } + + /** + * Sets compute_status_200 + * + * @param int|null $compute_status_200 Number of responses received with status code 200 (Success) for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeStatus200($compute_status_200) + { + $this->container['compute_status_200'] = $compute_status_200; + + return $this; + } + + /** + * Gets compute_status_204 + * + * @return int|null + */ + public function getComputeStatus204() + { + return $this->container['compute_status_204']; + } + + /** + * Sets compute_status_204 + * + * @param int|null $compute_status_204 Number of responses received with status code 204 (No Content) for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeStatus204($compute_status_204) + { + $this->container['compute_status_204'] = $compute_status_204; + + return $this; + } + + /** + * Gets compute_status_206 + * + * @return int|null + */ + public function getComputeStatus206() + { + return $this->container['compute_status_206']; + } + + /** + * Sets compute_status_206 + * + * @param int|null $compute_status_206 Number of responses received with status code 206 (Partial Content) for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeStatus206($compute_status_206) + { + $this->container['compute_status_206'] = $compute_status_206; + + return $this; + } + + /** + * Gets compute_status_301 + * + * @return int|null + */ + public function getComputeStatus301() + { + return $this->container['compute_status_301']; + } + + /** + * Sets compute_status_301 + * + * @param int|null $compute_status_301 Number of responses received with status code 301 (Moved Permanently) for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeStatus301($compute_status_301) + { + $this->container['compute_status_301'] = $compute_status_301; + + return $this; + } + + /** + * Gets compute_status_302 + * + * @return int|null + */ + public function getComputeStatus302() + { + return $this->container['compute_status_302']; + } + + /** + * Sets compute_status_302 + * + * @param int|null $compute_status_302 Number of responses received with status code 302 (Found) for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeStatus302($compute_status_302) + { + $this->container['compute_status_302'] = $compute_status_302; + + return $this; + } + + /** + * Gets compute_status_304 + * + * @return int|null + */ + public function getComputeStatus304() + { + return $this->container['compute_status_304']; + } + + /** + * Sets compute_status_304 + * + * @param int|null $compute_status_304 Number of responses received with status code 304 (Not Modified) for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeStatus304($compute_status_304) + { + $this->container['compute_status_304'] = $compute_status_304; + + return $this; + } + + /** + * Gets compute_status_400 + * + * @return int|null + */ + public function getComputeStatus400() + { + return $this->container['compute_status_400']; + } + + /** + * Sets compute_status_400 + * + * @param int|null $compute_status_400 Number of responses received with status code 400 (Bad Request) for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeStatus400($compute_status_400) + { + $this->container['compute_status_400'] = $compute_status_400; + + return $this; + } + + /** + * Gets compute_status_401 + * + * @return int|null + */ + public function getComputeStatus401() + { + return $this->container['compute_status_401']; + } + + /** + * Sets compute_status_401 + * + * @param int|null $compute_status_401 Number of responses received with status code 401 (Unauthorized) for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeStatus401($compute_status_401) + { + $this->container['compute_status_401'] = $compute_status_401; + + return $this; + } + + /** + * Gets compute_status_403 + * + * @return int|null + */ + public function getComputeStatus403() + { + return $this->container['compute_status_403']; + } + + /** + * Sets compute_status_403 + * + * @param int|null $compute_status_403 Number of responses received with status code 403 (Forbidden) for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeStatus403($compute_status_403) + { + $this->container['compute_status_403'] = $compute_status_403; + + return $this; + } + + /** + * Gets compute_status_404 + * + * @return int|null + */ + public function getComputeStatus404() + { + return $this->container['compute_status_404']; + } + + /** + * Sets compute_status_404 + * + * @param int|null $compute_status_404 Number of responses received with status code 404 (Not Found) for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeStatus404($compute_status_404) + { + $this->container['compute_status_404'] = $compute_status_404; + + return $this; + } + + /** + * Gets compute_status_416 + * + * @return int|null + */ + public function getComputeStatus416() + { + return $this->container['compute_status_416']; + } + + /** + * Sets compute_status_416 + * + * @param int|null $compute_status_416 Number of responses received with status code 416 (Range Not Satisfiable) for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeStatus416($compute_status_416) + { + $this->container['compute_status_416'] = $compute_status_416; + + return $this; + } + + /** + * Gets compute_status_429 + * + * @return int|null + */ + public function getComputeStatus429() + { + return $this->container['compute_status_429']; + } + + /** + * Sets compute_status_429 + * + * @param int|null $compute_status_429 Number of responses received with status code 429 (Too Many Requests) for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeStatus429($compute_status_429) + { + $this->container['compute_status_429'] = $compute_status_429; + + return $this; + } + + /** + * Gets compute_status_500 + * + * @return int|null + */ + public function getComputeStatus500() + { + return $this->container['compute_status_500']; + } + + /** + * Sets compute_status_500 + * + * @param int|null $compute_status_500 Number of responses received with status code 500 (Internal Server Error) for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeStatus500($compute_status_500) + { + $this->container['compute_status_500'] = $compute_status_500; + + return $this; + } + + /** + * Gets compute_status_501 + * + * @return int|null + */ + public function getComputeStatus501() + { + return $this->container['compute_status_501']; + } + + /** + * Sets compute_status_501 + * + * @param int|null $compute_status_501 Number of responses received with status code 501 (Not Implemented) for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeStatus501($compute_status_501) + { + $this->container['compute_status_501'] = $compute_status_501; + + return $this; + } + + /** + * Gets compute_status_502 + * + * @return int|null + */ + public function getComputeStatus502() + { + return $this->container['compute_status_502']; + } + + /** + * Sets compute_status_502 + * + * @param int|null $compute_status_502 Number of responses received with status code 502 (Bad Gateway) for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeStatus502($compute_status_502) + { + $this->container['compute_status_502'] = $compute_status_502; + + return $this; + } + + /** + * Gets compute_status_503 + * + * @return int|null + */ + public function getComputeStatus503() + { + return $this->container['compute_status_503']; + } + + /** + * Sets compute_status_503 + * + * @param int|null $compute_status_503 Number of responses received with status code 503 (Service Unavailable) for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeStatus503($compute_status_503) + { + $this->container['compute_status_503'] = $compute_status_503; + + return $this; + } + + /** + * Gets compute_status_504 + * + * @return int|null + */ + public function getComputeStatus504() + { + return $this->container['compute_status_504']; + } + + /** + * Sets compute_status_504 + * + * @param int|null $compute_status_504 Number of responses received with status code 504 (Gateway Timeout) for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeStatus504($compute_status_504) + { + $this->container['compute_status_504'] = $compute_status_504; + + return $this; + } + + /** + * Gets compute_status_505 + * + * @return int|null + */ + public function getComputeStatus505() + { + return $this->container['compute_status_505']; + } + + /** + * Sets compute_status_505 + * + * @param int|null $compute_status_505 Number of responses received with status code 505 (HTTP Version Not Supported) for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeStatus505($compute_status_505) + { + $this->container['compute_status_505'] = $compute_status_505; + + return $this; + } + + /** + * Gets compute_latency_0_to_1ms + * + * @return int|null + */ + public function getComputeLatency0To1ms() + { + return $this->container['compute_latency_0_to_1ms']; + } + + /** + * Sets compute_latency_0_to_1ms + * + * @param int|null $compute_latency_0_to_1ms Number of responses with latency between 0 and 1 millisecond for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeLatency0To1ms($compute_latency_0_to_1ms) + { + $this->container['compute_latency_0_to_1ms'] = $compute_latency_0_to_1ms; + + return $this; + } + + /** + * Gets compute_latency_1_to_5ms + * + * @return int|null + */ + public function getComputeLatency1To5ms() + { + return $this->container['compute_latency_1_to_5ms']; + } + + /** + * Sets compute_latency_1_to_5ms + * + * @param int|null $compute_latency_1_to_5ms Number of responses with latency between 1 and 5 milliseconds for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeLatency1To5ms($compute_latency_1_to_5ms) + { + $this->container['compute_latency_1_to_5ms'] = $compute_latency_1_to_5ms; + + return $this; + } + + /** + * Gets compute_latency_5_to_10ms + * + * @return int|null + */ + public function getComputeLatency5To10ms() + { + return $this->container['compute_latency_5_to_10ms']; + } + + /** + * Sets compute_latency_5_to_10ms + * + * @param int|null $compute_latency_5_to_10ms Number of responses with latency between 5 and 10 milliseconds for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeLatency5To10ms($compute_latency_5_to_10ms) + { + $this->container['compute_latency_5_to_10ms'] = $compute_latency_5_to_10ms; + + return $this; + } + + /** + * Gets compute_latency_10_to_50ms + * + * @return int|null + */ + public function getComputeLatency10To50ms() + { + return $this->container['compute_latency_10_to_50ms']; + } + + /** + * Sets compute_latency_10_to_50ms + * + * @param int|null $compute_latency_10_to_50ms Number of responses with latency between 10 and 50 milliseconds for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeLatency10To50ms($compute_latency_10_to_50ms) + { + $this->container['compute_latency_10_to_50ms'] = $compute_latency_10_to_50ms; + + return $this; + } + + /** + * Gets compute_latency_50_to_100ms + * + * @return int|null + */ + public function getComputeLatency50To100ms() + { + return $this->container['compute_latency_50_to_100ms']; + } + + /** + * Sets compute_latency_50_to_100ms + * + * @param int|null $compute_latency_50_to_100ms Number of responses with latency between 50 and 100 milliseconds for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeLatency50To100ms($compute_latency_50_to_100ms) + { + $this->container['compute_latency_50_to_100ms'] = $compute_latency_50_to_100ms; + + return $this; + } + + /** + * Gets compute_latency_100_to_250ms + * + * @return int|null + */ + public function getComputeLatency100To250ms() + { + return $this->container['compute_latency_100_to_250ms']; + } + + /** + * Sets compute_latency_100_to_250ms + * + * @param int|null $compute_latency_100_to_250ms Number of responses with latency between 100 and 250 milliseconds for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeLatency100To250ms($compute_latency_100_to_250ms) + { + $this->container['compute_latency_100_to_250ms'] = $compute_latency_100_to_250ms; + + return $this; + } + + /** + * Gets compute_latency_250_to_500ms + * + * @return int|null + */ + public function getComputeLatency250To500ms() + { + return $this->container['compute_latency_250_to_500ms']; + } + + /** + * Sets compute_latency_250_to_500ms + * + * @param int|null $compute_latency_250_to_500ms Number of responses with latency between 250 and 500 milliseconds for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeLatency250To500ms($compute_latency_250_to_500ms) + { + $this->container['compute_latency_250_to_500ms'] = $compute_latency_250_to_500ms; + + return $this; + } + + /** + * Gets compute_latency_500_to_1000ms + * + * @return int|null + */ + public function getComputeLatency500To1000ms() + { + return $this->container['compute_latency_500_to_1000ms']; + } + + /** + * Sets compute_latency_500_to_1000ms + * + * @param int|null $compute_latency_500_to_1000ms Number of responses with latency between 500 and 1,000 milliseconds for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeLatency500To1000ms($compute_latency_500_to_1000ms) + { + $this->container['compute_latency_500_to_1000ms'] = $compute_latency_500_to_1000ms; + + return $this; + } + + /** + * Gets compute_latency_1000_to_5000ms + * + * @return int|null + */ + public function getComputeLatency1000To5000ms() + { + return $this->container['compute_latency_1000_to_5000ms']; + } + + /** + * Sets compute_latency_1000_to_5000ms + * + * @param int|null $compute_latency_1000_to_5000ms Number of responses with latency between 1,000 and 5,000 milliseconds for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeLatency1000To5000ms($compute_latency_1000_to_5000ms) + { + $this->container['compute_latency_1000_to_5000ms'] = $compute_latency_1000_to_5000ms; + + return $this; + } + + /** + * Gets compute_latency_5000_to_10000ms + * + * @return int|null + */ + public function getComputeLatency5000To10000ms() + { + return $this->container['compute_latency_5000_to_10000ms']; + } + + /** + * Sets compute_latency_5000_to_10000ms + * + * @param int|null $compute_latency_5000_to_10000ms Number of responses with latency between 5,000 and 10,000 milliseconds for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeLatency5000To10000ms($compute_latency_5000_to_10000ms) + { + $this->container['compute_latency_5000_to_10000ms'] = $compute_latency_5000_to_10000ms; + + return $this; + } + + /** + * Gets compute_latency_10000_to_60000ms + * + * @return int|null + */ + public function getComputeLatency10000To60000ms() + { + return $this->container['compute_latency_10000_to_60000ms']; + } + + /** + * Sets compute_latency_10000_to_60000ms + * + * @param int|null $compute_latency_10000_to_60000ms Number of responses with latency between 10,000 and 60,000 milliseconds for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeLatency10000To60000ms($compute_latency_10000_to_60000ms) + { + $this->container['compute_latency_10000_to_60000ms'] = $compute_latency_10000_to_60000ms; + + return $this; + } + + /** + * Gets compute_latency_60000ms + * + * @return int|null + */ + public function getComputeLatency60000ms() + { + return $this->container['compute_latency_60000ms']; + } + + /** + * Sets compute_latency_60000ms + * + * @param int|null $compute_latency_60000ms Number of responses with latency of 60,000 milliseconds and above for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeLatency60000ms($compute_latency_60000ms) + { + $this->container['compute_latency_60000ms'] = $compute_latency_60000ms; + + return $this; + } + + /** + * Gets all_responses + * + * @return int|null + */ + public function getAllResponses() + { + return $this->container['all_responses']; + } + + /** + * Sets all_responses + * + * @param int|null $all_responses Number of responses received for origin requests made by all sources. + * + * @return self + */ + public function setAllResponses($all_responses) + { + $this->container['all_responses'] = $all_responses; + + return $this; + } + + /** + * Gets all_resp_header_bytes + * + * @return int|null + */ + public function getAllRespHeaderBytes() + { + return $this->container['all_resp_header_bytes']; + } + + /** + * Sets all_resp_header_bytes + * + * @param int|null $all_resp_header_bytes Number of header bytes received for origin requests made by all sources. + * + * @return self + */ + public function setAllRespHeaderBytes($all_resp_header_bytes) + { + $this->container['all_resp_header_bytes'] = $all_resp_header_bytes; + + return $this; + } + + /** + * Gets all_resp_body_bytes + * + * @return int|null + */ + public function getAllRespBodyBytes() + { + return $this->container['all_resp_body_bytes']; + } + + /** + * Sets all_resp_body_bytes + * + * @param int|null $all_resp_body_bytes Number of body bytes received for origin requests made by all sources. + * + * @return self + */ + public function setAllRespBodyBytes($all_resp_body_bytes) + { + $this->container['all_resp_body_bytes'] = $all_resp_body_bytes; + + return $this; + } + + /** + * Gets all_status_1xx + * + * @return int|null + */ + public function getAllStatus1xx() + { + return $this->container['all_status_1xx']; + } + + /** + * Sets all_status_1xx + * + * @param int|null $all_status_1xx Number of 1xx \"Informational\" category status codes delivered received for origin requests made by all sources. + * + * @return self + */ + public function setAllStatus1xx($all_status_1xx) + { + $this->container['all_status_1xx'] = $all_status_1xx; + + return $this; + } + + /** + * Gets all_status_2xx + * + * @return int|null + */ + public function getAllStatus2xx() + { + return $this->container['all_status_2xx']; + } + + /** + * Sets all_status_2xx + * + * @param int|null $all_status_2xx Number of 2xx \"Success\" status codes received for origin requests made by all sources. + * + * @return self + */ + public function setAllStatus2xx($all_status_2xx) + { + $this->container['all_status_2xx'] = $all_status_2xx; + + return $this; + } + + /** + * Gets all_status_3xx + * + * @return int|null + */ + public function getAllStatus3xx() + { + return $this->container['all_status_3xx']; + } + + /** + * Sets all_status_3xx + * + * @param int|null $all_status_3xx Number of 3xx \"Redirection\" codes received for origin requests made by all sources. + * + * @return self + */ + public function setAllStatus3xx($all_status_3xx) + { + $this->container['all_status_3xx'] = $all_status_3xx; + + return $this; + } + + /** + * Gets all_status_4xx + * + * @return int|null + */ + public function getAllStatus4xx() + { + return $this->container['all_status_4xx']; + } + + /** + * Sets all_status_4xx + * + * @param int|null $all_status_4xx Number of 4xx \"Client Error\" codes received for origin requests made by all sources. + * + * @return self + */ + public function setAllStatus4xx($all_status_4xx) + { + $this->container['all_status_4xx'] = $all_status_4xx; + + return $this; + } + + /** + * Gets all_status_5xx + * + * @return int|null + */ + public function getAllStatus5xx() + { + return $this->container['all_status_5xx']; + } + + /** + * Sets all_status_5xx + * + * @param int|null $all_status_5xx Number of 5xx \"Server Error\" codes received for origin requests made by all sources. + * + * @return self + */ + public function setAllStatus5xx($all_status_5xx) + { + $this->container['all_status_5xx'] = $all_status_5xx; + + return $this; + } + + /** + * Gets all_status_200 + * + * @return int|null + */ + public function getAllStatus200() + { + return $this->container['all_status_200']; + } + + /** + * Sets all_status_200 + * + * @param int|null $all_status_200 Number of responses received with status code 200 (Success) received for origin requests made by all sources. + * + * @return self + */ + public function setAllStatus200($all_status_200) + { + $this->container['all_status_200'] = $all_status_200; + + return $this; + } + + /** + * Gets all_status_204 + * + * @return int|null + */ + public function getAllStatus204() + { + return $this->container['all_status_204']; + } + + /** + * Sets all_status_204 + * + * @param int|null $all_status_204 Number of responses received with status code 204 (No Content) received for origin requests made by all sources. + * + * @return self + */ + public function setAllStatus204($all_status_204) + { + $this->container['all_status_204'] = $all_status_204; + + return $this; + } + + /** + * Gets all_status_206 + * + * @return int|null + */ + public function getAllStatus206() + { + return $this->container['all_status_206']; + } + + /** + * Sets all_status_206 + * + * @param int|null $all_status_206 Number of responses received with status code 206 (Partial Content) received for origin requests made by all sources. + * + * @return self + */ + public function setAllStatus206($all_status_206) + { + $this->container['all_status_206'] = $all_status_206; + + return $this; + } + + /** + * Gets all_status_301 + * + * @return int|null + */ + public function getAllStatus301() + { + return $this->container['all_status_301']; + } + + /** + * Sets all_status_301 + * + * @param int|null $all_status_301 Number of responses received with status code 301 (Moved Permanently) received for origin requests made by all sources. + * + * @return self + */ + public function setAllStatus301($all_status_301) + { + $this->container['all_status_301'] = $all_status_301; + + return $this; + } + + /** + * Gets all_status_302 + * + * @return int|null + */ + public function getAllStatus302() + { + return $this->container['all_status_302']; + } + + /** + * Sets all_status_302 + * + * @param int|null $all_status_302 Number of responses received with status code 302 (Found) received for origin requests made by all sources. + * + * @return self + */ + public function setAllStatus302($all_status_302) + { + $this->container['all_status_302'] = $all_status_302; + + return $this; + } + + /** + * Gets all_status_304 + * + * @return int|null + */ + public function getAllStatus304() + { + return $this->container['all_status_304']; + } + + /** + * Sets all_status_304 + * + * @param int|null $all_status_304 Number of responses received with status code 304 (Not Modified) received for origin requests made by all sources. + * + * @return self + */ + public function setAllStatus304($all_status_304) + { + $this->container['all_status_304'] = $all_status_304; + + return $this; + } + + /** + * Gets all_status_400 + * + * @return int|null + */ + public function getAllStatus400() + { + return $this->container['all_status_400']; + } + + /** + * Sets all_status_400 + * + * @param int|null $all_status_400 Number of responses received with status code 400 (Bad Request) received for origin requests made by all sources. + * + * @return self + */ + public function setAllStatus400($all_status_400) + { + $this->container['all_status_400'] = $all_status_400; + + return $this; + } + + /** + * Gets all_status_401 + * + * @return int|null + */ + public function getAllStatus401() + { + return $this->container['all_status_401']; + } + + /** + * Sets all_status_401 + * + * @param int|null $all_status_401 Number of responses received with status code 401 (Unauthorized) received for origin requests made by all sources. + * + * @return self + */ + public function setAllStatus401($all_status_401) + { + $this->container['all_status_401'] = $all_status_401; + + return $this; + } + + /** + * Gets all_status_403 + * + * @return int|null + */ + public function getAllStatus403() + { + return $this->container['all_status_403']; + } + + /** + * Sets all_status_403 + * + * @param int|null $all_status_403 Number of responses received with status code 403 (Forbidden) received for origin requests made by all sources. + * + * @return self + */ + public function setAllStatus403($all_status_403) + { + $this->container['all_status_403'] = $all_status_403; + + return $this; + } + + /** + * Gets all_status_404 + * + * @return int|null + */ + public function getAllStatus404() + { + return $this->container['all_status_404']; + } + + /** + * Sets all_status_404 + * + * @param int|null $all_status_404 Number of responses received with status code 404 (Not Found) received for origin requests made by all sources. + * + * @return self + */ + public function setAllStatus404($all_status_404) + { + $this->container['all_status_404'] = $all_status_404; + + return $this; + } + + /** + * Gets all_status_416 + * + * @return int|null + */ + public function getAllStatus416() + { + return $this->container['all_status_416']; + } + + /** + * Sets all_status_416 + * + * @param int|null $all_status_416 Number of responses received with status code 416 (Range Not Satisfiable) received for origin requests made by all sources. + * + * @return self + */ + public function setAllStatus416($all_status_416) + { + $this->container['all_status_416'] = $all_status_416; + + return $this; + } + + /** + * Gets all_status_429 + * + * @return int|null + */ + public function getAllStatus429() + { + return $this->container['all_status_429']; + } + + /** + * Sets all_status_429 + * + * @param int|null $all_status_429 Number of responses received with status code 429 (Too Many Requests) received for origin requests made by all sources. + * + * @return self + */ + public function setAllStatus429($all_status_429) + { + $this->container['all_status_429'] = $all_status_429; + + return $this; + } + + /** + * Gets all_status_500 + * + * @return int|null + */ + public function getAllStatus500() + { + return $this->container['all_status_500']; + } + + /** + * Sets all_status_500 + * + * @param int|null $all_status_500 Number of responses received with status code 500 (Internal Server Error) received for origin requests made by all sources. + * + * @return self + */ + public function setAllStatus500($all_status_500) + { + $this->container['all_status_500'] = $all_status_500; + + return $this; + } + + /** + * Gets all_status_501 + * + * @return int|null + */ + public function getAllStatus501() + { + return $this->container['all_status_501']; + } + + /** + * Sets all_status_501 + * + * @param int|null $all_status_501 Number of responses received with status code 501 (Not Implemented) received for origin requests made by all sources. + * + * @return self + */ + public function setAllStatus501($all_status_501) + { + $this->container['all_status_501'] = $all_status_501; + + return $this; + } + + /** + * Gets all_status_502 + * + * @return int|null + */ + public function getAllStatus502() + { + return $this->container['all_status_502']; + } + + /** + * Sets all_status_502 + * + * @param int|null $all_status_502 Number of responses received with status code 502 (Bad Gateway) received for origin requests made by all sources. + * + * @return self + */ + public function setAllStatus502($all_status_502) + { + $this->container['all_status_502'] = $all_status_502; + + return $this; + } + + /** + * Gets all_status_503 + * + * @return int|null + */ + public function getAllStatus503() + { + return $this->container['all_status_503']; + } + + /** + * Sets all_status_503 + * + * @param int|null $all_status_503 Number of responses received with status code 503 (Service Unavailable) received for origin requests made by all sources. + * + * @return self + */ + public function setAllStatus503($all_status_503) + { + $this->container['all_status_503'] = $all_status_503; + + return $this; + } + + /** + * Gets all_status_504 + * + * @return int|null + */ + public function getAllStatus504() + { + return $this->container['all_status_504']; + } + + /** + * Sets all_status_504 + * + * @param int|null $all_status_504 Number of responses received with status code 504 (Gateway Timeout) received for origin requests made by all sources. + * + * @return self + */ + public function setAllStatus504($all_status_504) + { + $this->container['all_status_504'] = $all_status_504; + + return $this; + } + + /** + * Gets all_status_505 + * + * @return int|null + */ + public function getAllStatus505() + { + return $this->container['all_status_505']; + } + + /** + * Sets all_status_505 + * + * @param int|null $all_status_505 Number of responses received with status code 505 (HTTP Version Not Supported) received for origin requests made by all sources. + * + * @return self + */ + public function setAllStatus505($all_status_505) + { + $this->container['all_status_505'] = $all_status_505; + + return $this; + } + + /** + * Gets all_latency_0_to_1ms + * + * @return int|null + */ + public function getAllLatency0To1ms() + { + return $this->container['all_latency_0_to_1ms']; + } + + /** + * Sets all_latency_0_to_1ms + * + * @param int|null $all_latency_0_to_1ms Number of responses with latency between 0 and 1 millisecond received for origin requests made by all sources. + * + * @return self + */ + public function setAllLatency0To1ms($all_latency_0_to_1ms) + { + $this->container['all_latency_0_to_1ms'] = $all_latency_0_to_1ms; + + return $this; + } + + /** + * Gets all_latency_1_to_5ms + * + * @return int|null + */ + public function getAllLatency1To5ms() + { + return $this->container['all_latency_1_to_5ms']; + } + + /** + * Sets all_latency_1_to_5ms + * + * @param int|null $all_latency_1_to_5ms Number of responses with latency between 1 and 5 milliseconds received for origin requests made by all sources. + * + * @return self + */ + public function setAllLatency1To5ms($all_latency_1_to_5ms) + { + $this->container['all_latency_1_to_5ms'] = $all_latency_1_to_5ms; + + return $this; + } + + /** + * Gets all_latency_5_to_10ms + * + * @return int|null + */ + public function getAllLatency5To10ms() + { + return $this->container['all_latency_5_to_10ms']; + } + + /** + * Sets all_latency_5_to_10ms + * + * @param int|null $all_latency_5_to_10ms Number of responses with latency between 5 and 10 milliseconds received for origin requests made by all sources. + * + * @return self + */ + public function setAllLatency5To10ms($all_latency_5_to_10ms) + { + $this->container['all_latency_5_to_10ms'] = $all_latency_5_to_10ms; + + return $this; + } + + /** + * Gets all_latency_10_to_50ms + * + * @return int|null + */ + public function getAllLatency10To50ms() + { + return $this->container['all_latency_10_to_50ms']; + } + + /** + * Sets all_latency_10_to_50ms + * + * @param int|null $all_latency_10_to_50ms Number of responses with latency between 10 and 50 milliseconds received for origin requests made by all sources. + * + * @return self + */ + public function setAllLatency10To50ms($all_latency_10_to_50ms) + { + $this->container['all_latency_10_to_50ms'] = $all_latency_10_to_50ms; + + return $this; + } + + /** + * Gets all_latency_50_to_100ms + * + * @return int|null + */ + public function getAllLatency50To100ms() + { + return $this->container['all_latency_50_to_100ms']; + } + + /** + * Sets all_latency_50_to_100ms + * + * @param int|null $all_latency_50_to_100ms Number of responses with latency between 50 and 100 milliseconds received for origin requests made by all sources. + * + * @return self + */ + public function setAllLatency50To100ms($all_latency_50_to_100ms) + { + $this->container['all_latency_50_to_100ms'] = $all_latency_50_to_100ms; + + return $this; + } + + /** + * Gets all_latency_100_to_250ms + * + * @return int|null + */ + public function getAllLatency100To250ms() + { + return $this->container['all_latency_100_to_250ms']; + } + + /** + * Sets all_latency_100_to_250ms + * + * @param int|null $all_latency_100_to_250ms Number of responses with latency between 100 and 250 milliseconds received for origin requests made by all sources. + * + * @return self + */ + public function setAllLatency100To250ms($all_latency_100_to_250ms) + { + $this->container['all_latency_100_to_250ms'] = $all_latency_100_to_250ms; + + return $this; + } + + /** + * Gets all_latency_250_to_500ms + * + * @return int|null + */ + public function getAllLatency250To500ms() + { + return $this->container['all_latency_250_to_500ms']; + } + + /** + * Sets all_latency_250_to_500ms + * + * @param int|null $all_latency_250_to_500ms Number of responses with latency between 250 and 500 milliseconds received for origin requests made by all sources. + * + * @return self + */ + public function setAllLatency250To500ms($all_latency_250_to_500ms) + { + $this->container['all_latency_250_to_500ms'] = $all_latency_250_to_500ms; + + return $this; + } + + /** + * Gets all_latency_500_to_1000ms + * + * @return int|null + */ + public function getAllLatency500To1000ms() + { + return $this->container['all_latency_500_to_1000ms']; + } + + /** + * Sets all_latency_500_to_1000ms + * + * @param int|null $all_latency_500_to_1000ms Number of responses with latency between 500 and 1,000 milliseconds received for origin requests made by all sources. + * + * @return self + */ + public function setAllLatency500To1000ms($all_latency_500_to_1000ms) + { + $this->container['all_latency_500_to_1000ms'] = $all_latency_500_to_1000ms; + + return $this; + } + + /** + * Gets all_latency_1000_to_5000ms + * + * @return int|null + */ + public function getAllLatency1000To5000ms() + { + return $this->container['all_latency_1000_to_5000ms']; + } + + /** + * Sets all_latency_1000_to_5000ms + * + * @param int|null $all_latency_1000_to_5000ms Number of responses with latency between 1,000 and 5,000 milliseconds received for origin requests made by all sources. + * + * @return self + */ + public function setAllLatency1000To5000ms($all_latency_1000_to_5000ms) + { + $this->container['all_latency_1000_to_5000ms'] = $all_latency_1000_to_5000ms; + + return $this; + } + + /** + * Gets all_latency_5000_to_10000ms + * + * @return int|null + */ + public function getAllLatency5000To10000ms() + { + return $this->container['all_latency_5000_to_10000ms']; + } + + /** + * Sets all_latency_5000_to_10000ms + * + * @param int|null $all_latency_5000_to_10000ms Number of responses with latency between 5,000 and 10,000 milliseconds received for origin requests made by all sources. + * + * @return self + */ + public function setAllLatency5000To10000ms($all_latency_5000_to_10000ms) + { + $this->container['all_latency_5000_to_10000ms'] = $all_latency_5000_to_10000ms; + + return $this; + } + + /** + * Gets all_latency_10000_to_60000ms + * + * @return int|null + */ + public function getAllLatency10000To60000ms() + { + return $this->container['all_latency_10000_to_60000ms']; + } + + /** + * Sets all_latency_10000_to_60000ms + * + * @param int|null $all_latency_10000_to_60000ms Number of responses with latency between 10,000 and 60,000 milliseconds received for origin requests made by all sources. + * + * @return self + */ + public function setAllLatency10000To60000ms($all_latency_10000_to_60000ms) + { + $this->container['all_latency_10000_to_60000ms'] = $all_latency_10000_to_60000ms; + + return $this; + } + + /** + * Gets all_latency_60000ms + * + * @return int|null + */ + public function getAllLatency60000ms() + { + return $this->container['all_latency_60000ms']; + } + + /** + * Sets all_latency_60000ms + * + * @param int|null $all_latency_60000ms Number of responses with latency of 60,000 milliseconds and above received for origin requests made by all sources. + * + * @return self + */ + public function setAllLatency60000ms($all_latency_60000ms) + { + $this->container['all_latency_60000ms'] = $all_latency_60000ms; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/OriginInspectorRealtimeEntry.php b/lib/Model/OriginInspectorRealtimeEntry.php new file mode 100644 index 00000000..64d464ec --- /dev/null +++ b/lib/Model/OriginInspectorRealtimeEntry.php @@ -0,0 +1,375 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OriginInspectorRealtimeEntry implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'origin_inspector_realtime_entry'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'recorded' => '\Fastly\Model\OriginInspectorRealtimeEntryRecorded', + 'aggregated' => 'array', + 'datacenter' => 'array>' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'recorded' => null, + 'aggregated' => null, + 'datacenter' => 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 = [ + 'recorded' => 'recorded', + 'aggregated' => 'aggregated', + 'datacenter' => 'datacenter' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'recorded' => 'setRecorded', + 'aggregated' => 'setAggregated', + 'datacenter' => 'setDatacenter' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'recorded' => 'getRecorded', + 'aggregated' => 'getAggregated', + 'datacenter' => 'getDatacenter' + ]; + + /** + * 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['recorded'] = $data['recorded'] ?? null; + $this->container['aggregated'] = $data['aggregated'] ?? null; + $this->container['datacenter'] = $data['datacenter'] ?? 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 recorded + * + * @return \Fastly\Model\OriginInspectorRealtimeEntryRecorded|null + */ + public function getRecorded() + { + return $this->container['recorded']; + } + + /** + * Sets recorded + * + * @param \Fastly\Model\OriginInspectorRealtimeEntryRecorded|null $recorded recorded + * + * @return self + */ + public function setRecorded($recorded) + { + $this->container['recorded'] = $recorded; + + return $this; + } + + /** + * Gets aggregated + * + * @return array|null + */ + public function getAggregated() + { + return $this->container['aggregated']; + } + + /** + * Sets aggregated + * + * @param array|null $aggregated Groups [measurements](#measurements-data-model) by backend name. + * + * @return self + */ + public function setAggregated($aggregated) + { + $this->container['aggregated'] = $aggregated; + + return $this; + } + + /** + * Gets datacenter + * + * @return array>|null + */ + public function getDatacenter() + { + return $this->container['datacenter']; + } + + /** + * Sets datacenter + * + * @param array>|null $datacenter Groups [measurements](#measurements-data-model) by POP, then backend name. See the [POPs API](/reference/api/utils/pops/) for details about POP identifiers. + * + * @return self + */ + public function setDatacenter($datacenter) + { + $this->container['datacenter'] = $datacenter; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/OriginInspectorRealtimeEntryRecorded.php b/lib/Model/OriginInspectorRealtimeEntryRecorded.php new file mode 100644 index 00000000..83dec9f5 --- /dev/null +++ b/lib/Model/OriginInspectorRealtimeEntryRecorded.php @@ -0,0 +1,290 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OriginInspectorRealtimeEntryRecorded implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'origin_inspector_realtime_entry_recorded'; + + /** + * 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) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/OriginInspectorSubsequentRequestTimestamp.php b/lib/Model/OriginInspectorSubsequentRequestTimestamp.php new file mode 100644 index 00000000..6cf6c15b --- /dev/null +++ b/lib/Model/OriginInspectorSubsequentRequestTimestamp.php @@ -0,0 +1,290 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OriginInspectorSubsequentRequestTimestamp implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'origin_inspector_subsequent_request_timestamp'; + + /** + * 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) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/OriginInspectorValues.php b/lib/Model/OriginInspectorValues.php new file mode 100644 index 00000000..43f10f15 --- /dev/null +++ b/lib/Model/OriginInspectorValues.php @@ -0,0 +1,4845 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OriginInspectorValues implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'origin_inspector_values'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'responses' => 'int', + 'resp_header_bytes' => 'int', + 'resp_body_bytes' => 'int', + 'status_1xx' => 'int', + 'status_2xx' => 'int', + 'status_3xx' => 'int', + 'status_4xx' => 'int', + 'status_5xx' => 'int', + 'status_200' => 'int', + 'status_204' => 'int', + 'status_206' => 'int', + 'status_301' => 'int', + 'status_302' => 'int', + 'status_304' => 'int', + 'status_400' => 'int', + 'status_401' => 'int', + 'status_403' => 'int', + 'status_404' => 'int', + 'status_416' => 'int', + 'status_429' => 'int', + 'status_500' => 'int', + 'status_501' => 'int', + 'status_502' => 'int', + 'status_503' => 'int', + 'status_504' => 'int', + 'status_505' => 'int', + 'latency_0_to_1ms' => 'int', + 'latency_1_to_5ms' => 'int', + 'latency_5_to_10ms' => 'int', + 'latency_10_to_50ms' => 'int', + 'latency_50_to_100ms' => 'int', + 'latency_100_to_250ms' => 'int', + 'latency_250_to_500ms' => 'int', + 'latency_500_to_1000ms' => 'int', + 'latency_1000_to_5000ms' => 'int', + 'latency_5000_to_10000ms' => 'int', + 'latency_10000_to_60000ms' => 'int', + 'latency_60000ms' => 'int', + 'waf_responses' => 'int', + 'waf_resp_header_bytes' => 'int', + 'waf_resp_body_bytes' => 'int', + 'waf_status_1xx' => 'int', + 'waf_status_2xx' => 'int', + 'waf_status_3xx' => 'int', + 'waf_status_4xx' => 'int', + 'waf_status_5xx' => 'int', + 'waf_status_200' => 'int', + 'waf_status_204' => 'int', + 'waf_status_206' => 'int', + 'waf_status_301' => 'int', + 'waf_status_302' => 'int', + 'waf_status_304' => 'int', + 'waf_status_400' => 'int', + 'waf_status_401' => 'int', + 'waf_status_403' => 'int', + 'waf_status_404' => 'int', + 'waf_status_416' => 'int', + 'waf_status_429' => 'int', + 'waf_status_500' => 'int', + 'waf_status_501' => 'int', + 'waf_status_502' => 'int', + 'waf_status_503' => 'int', + 'waf_status_504' => 'int', + 'waf_status_505' => 'int', + 'waf_latency_0_to_1ms' => 'int', + 'waf_latency_1_to_5ms' => 'int', + 'waf_latency_5_to_10ms' => 'int', + 'waf_latency_10_to_50ms' => 'int', + 'waf_latency_50_to_100ms' => 'int', + 'waf_latency_100_to_250ms' => 'int', + 'waf_latency_250_to_500ms' => 'int', + 'waf_latency_500_to_1000ms' => 'int', + 'waf_latency_1000_to_5000ms' => 'int', + 'waf_latency_5000_to_10000ms' => 'int', + 'waf_latency_10000_to_60000ms' => 'int', + 'waf_latency_60000ms' => 'int', + 'compute_responses' => 'int', + 'compute_resp_header_bytes' => 'int', + 'compute_resp_body_bytes' => 'int', + 'compute_status_1xx' => 'int', + 'compute_status_2xx' => 'int', + 'compute_status_3xx' => 'int', + 'compute_status_4xx' => 'int', + 'compute_status_5xx' => 'int', + 'compute_status_200' => 'int', + 'compute_status_204' => 'int', + 'compute_status_206' => 'int', + 'compute_status_301' => 'int', + 'compute_status_302' => 'int', + 'compute_status_304' => 'int', + 'compute_status_400' => 'int', + 'compute_status_401' => 'int', + 'compute_status_403' => 'int', + 'compute_status_404' => 'int', + 'compute_status_416' => 'int', + 'compute_status_429' => 'int', + 'compute_status_500' => 'int', + 'compute_status_501' => 'int', + 'compute_status_502' => 'int', + 'compute_status_503' => 'int', + 'compute_status_504' => 'int', + 'compute_status_505' => 'int', + 'compute_latency_0_to_1ms' => 'int', + 'compute_latency_1_to_5ms' => 'int', + 'compute_latency_5_to_10ms' => 'int', + 'compute_latency_10_to_50ms' => 'int', + 'compute_latency_50_to_100ms' => 'int', + 'compute_latency_100_to_250ms' => 'int', + 'compute_latency_250_to_500ms' => 'int', + 'compute_latency_500_to_1000ms' => 'int', + 'compute_latency_1000_to_5000ms' => 'int', + 'compute_latency_5000_to_10000ms' => 'int', + 'compute_latency_10000_to_60000ms' => 'int', + 'compute_latency_60000ms' => 'int', + 'all_responses' => 'int', + 'all_resp_header_bytes' => 'int', + 'all_resp_body_bytes' => 'int', + 'all_status_1xx' => 'int', + 'all_status_2xx' => 'int', + 'all_status_3xx' => 'int', + 'all_status_4xx' => 'int', + 'all_status_5xx' => 'int', + 'all_status_200' => 'int', + 'all_status_204' => 'int', + 'all_status_206' => 'int', + 'all_status_301' => 'int', + 'all_status_302' => 'int', + 'all_status_304' => 'int', + 'all_status_400' => 'int', + 'all_status_401' => 'int', + 'all_status_403' => 'int', + 'all_status_404' => 'int', + 'all_status_416' => 'int', + 'all_status_429' => 'int', + 'all_status_500' => 'int', + 'all_status_501' => 'int', + 'all_status_502' => 'int', + 'all_status_503' => 'int', + 'all_status_504' => 'int', + 'all_status_505' => 'int', + 'all_latency_0_to_1ms' => 'int', + 'all_latency_1_to_5ms' => 'int', + 'all_latency_5_to_10ms' => 'int', + 'all_latency_10_to_50ms' => 'int', + 'all_latency_50_to_100ms' => 'int', + 'all_latency_100_to_250ms' => 'int', + 'all_latency_250_to_500ms' => 'int', + 'all_latency_500_to_1000ms' => 'int', + 'all_latency_1000_to_5000ms' => 'int', + 'all_latency_5000_to_10000ms' => 'int', + 'all_latency_10000_to_60000ms' => 'int', + 'all_latency_60000ms' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'responses' => null, + 'resp_header_bytes' => null, + 'resp_body_bytes' => null, + 'status_1xx' => null, + 'status_2xx' => null, + 'status_3xx' => null, + 'status_4xx' => null, + 'status_5xx' => null, + 'status_200' => null, + 'status_204' => null, + 'status_206' => null, + 'status_301' => null, + 'status_302' => null, + 'status_304' => null, + 'status_400' => null, + 'status_401' => null, + 'status_403' => null, + 'status_404' => null, + 'status_416' => null, + 'status_429' => null, + 'status_500' => null, + 'status_501' => null, + 'status_502' => null, + 'status_503' => null, + 'status_504' => null, + 'status_505' => null, + 'latency_0_to_1ms' => null, + 'latency_1_to_5ms' => null, + 'latency_5_to_10ms' => null, + 'latency_10_to_50ms' => null, + 'latency_50_to_100ms' => null, + 'latency_100_to_250ms' => null, + 'latency_250_to_500ms' => null, + 'latency_500_to_1000ms' => null, + 'latency_1000_to_5000ms' => null, + 'latency_5000_to_10000ms' => null, + 'latency_10000_to_60000ms' => null, + 'latency_60000ms' => null, + 'waf_responses' => null, + 'waf_resp_header_bytes' => null, + 'waf_resp_body_bytes' => null, + 'waf_status_1xx' => null, + 'waf_status_2xx' => null, + 'waf_status_3xx' => null, + 'waf_status_4xx' => null, + 'waf_status_5xx' => null, + 'waf_status_200' => null, + 'waf_status_204' => null, + 'waf_status_206' => null, + 'waf_status_301' => null, + 'waf_status_302' => null, + 'waf_status_304' => null, + 'waf_status_400' => null, + 'waf_status_401' => null, + 'waf_status_403' => null, + 'waf_status_404' => null, + 'waf_status_416' => null, + 'waf_status_429' => null, + 'waf_status_500' => null, + 'waf_status_501' => null, + 'waf_status_502' => null, + 'waf_status_503' => null, + 'waf_status_504' => null, + 'waf_status_505' => null, + 'waf_latency_0_to_1ms' => null, + 'waf_latency_1_to_5ms' => null, + 'waf_latency_5_to_10ms' => null, + 'waf_latency_10_to_50ms' => null, + 'waf_latency_50_to_100ms' => null, + 'waf_latency_100_to_250ms' => null, + 'waf_latency_250_to_500ms' => null, + 'waf_latency_500_to_1000ms' => null, + 'waf_latency_1000_to_5000ms' => null, + 'waf_latency_5000_to_10000ms' => null, + 'waf_latency_10000_to_60000ms' => null, + 'waf_latency_60000ms' => null, + 'compute_responses' => null, + 'compute_resp_header_bytes' => null, + 'compute_resp_body_bytes' => null, + 'compute_status_1xx' => null, + 'compute_status_2xx' => null, + 'compute_status_3xx' => null, + 'compute_status_4xx' => null, + 'compute_status_5xx' => null, + 'compute_status_200' => null, + 'compute_status_204' => null, + 'compute_status_206' => null, + 'compute_status_301' => null, + 'compute_status_302' => null, + 'compute_status_304' => null, + 'compute_status_400' => null, + 'compute_status_401' => null, + 'compute_status_403' => null, + 'compute_status_404' => null, + 'compute_status_416' => null, + 'compute_status_429' => null, + 'compute_status_500' => null, + 'compute_status_501' => null, + 'compute_status_502' => null, + 'compute_status_503' => null, + 'compute_status_504' => null, + 'compute_status_505' => null, + 'compute_latency_0_to_1ms' => null, + 'compute_latency_1_to_5ms' => null, + 'compute_latency_5_to_10ms' => null, + 'compute_latency_10_to_50ms' => null, + 'compute_latency_50_to_100ms' => null, + 'compute_latency_100_to_250ms' => null, + 'compute_latency_250_to_500ms' => null, + 'compute_latency_500_to_1000ms' => null, + 'compute_latency_1000_to_5000ms' => null, + 'compute_latency_5000_to_10000ms' => null, + 'compute_latency_10000_to_60000ms' => null, + 'compute_latency_60000ms' => null, + 'all_responses' => null, + 'all_resp_header_bytes' => null, + 'all_resp_body_bytes' => null, + 'all_status_1xx' => null, + 'all_status_2xx' => null, + 'all_status_3xx' => null, + 'all_status_4xx' => null, + 'all_status_5xx' => null, + 'all_status_200' => null, + 'all_status_204' => null, + 'all_status_206' => null, + 'all_status_301' => null, + 'all_status_302' => null, + 'all_status_304' => null, + 'all_status_400' => null, + 'all_status_401' => null, + 'all_status_403' => null, + 'all_status_404' => null, + 'all_status_416' => null, + 'all_status_429' => null, + 'all_status_500' => null, + 'all_status_501' => null, + 'all_status_502' => null, + 'all_status_503' => null, + 'all_status_504' => null, + 'all_status_505' => null, + 'all_latency_0_to_1ms' => null, + 'all_latency_1_to_5ms' => null, + 'all_latency_5_to_10ms' => null, + 'all_latency_10_to_50ms' => null, + 'all_latency_50_to_100ms' => null, + 'all_latency_100_to_250ms' => null, + 'all_latency_250_to_500ms' => null, + 'all_latency_500_to_1000ms' => null, + 'all_latency_1000_to_5000ms' => null, + 'all_latency_5000_to_10000ms' => null, + 'all_latency_10000_to_60000ms' => null, + 'all_latency_60000ms' => 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 = [ + 'responses' => 'responses', + 'resp_header_bytes' => 'resp_header_bytes', + 'resp_body_bytes' => 'resp_body_bytes', + 'status_1xx' => 'status_1xx', + 'status_2xx' => 'status_2xx', + 'status_3xx' => 'status_3xx', + 'status_4xx' => 'status_4xx', + 'status_5xx' => 'status_5xx', + 'status_200' => 'status_200', + 'status_204' => 'status_204', + 'status_206' => 'status_206', + 'status_301' => 'status_301', + 'status_302' => 'status_302', + 'status_304' => 'status_304', + 'status_400' => 'status_400', + 'status_401' => 'status_401', + 'status_403' => 'status_403', + 'status_404' => 'status_404', + 'status_416' => 'status_416', + 'status_429' => 'status_429', + 'status_500' => 'status_500', + 'status_501' => 'status_501', + 'status_502' => 'status_502', + 'status_503' => 'status_503', + 'status_504' => 'status_504', + 'status_505' => 'status_505', + 'latency_0_to_1ms' => 'latency_0_to_1ms', + 'latency_1_to_5ms' => 'latency_1_to_5ms', + 'latency_5_to_10ms' => 'latency_5_to_10ms', + 'latency_10_to_50ms' => 'latency_10_to_50ms', + 'latency_50_to_100ms' => 'latency_50_to_100ms', + 'latency_100_to_250ms' => 'latency_100_to_250ms', + 'latency_250_to_500ms' => 'latency_250_to_500ms', + 'latency_500_to_1000ms' => 'latency_500_to_1000ms', + 'latency_1000_to_5000ms' => 'latency_1000_to_5000ms', + 'latency_5000_to_10000ms' => 'latency_5000_to_10000ms', + 'latency_10000_to_60000ms' => 'latency_10000_to_60000ms', + 'latency_60000ms' => 'latency_60000ms', + 'waf_responses' => 'waf_responses', + 'waf_resp_header_bytes' => 'waf_resp_header_bytes', + 'waf_resp_body_bytes' => 'waf_resp_body_bytes', + 'waf_status_1xx' => 'waf_status_1xx', + 'waf_status_2xx' => 'waf_status_2xx', + 'waf_status_3xx' => 'waf_status_3xx', + 'waf_status_4xx' => 'waf_status_4xx', + 'waf_status_5xx' => 'waf_status_5xx', + 'waf_status_200' => 'waf_status_200', + 'waf_status_204' => 'waf_status_204', + 'waf_status_206' => 'waf_status_206', + 'waf_status_301' => 'waf_status_301', + 'waf_status_302' => 'waf_status_302', + 'waf_status_304' => 'waf_status_304', + 'waf_status_400' => 'waf_status_400', + 'waf_status_401' => 'waf_status_401', + 'waf_status_403' => 'waf_status_403', + 'waf_status_404' => 'waf_status_404', + 'waf_status_416' => 'waf_status_416', + 'waf_status_429' => 'waf_status_429', + 'waf_status_500' => 'waf_status_500', + 'waf_status_501' => 'waf_status_501', + 'waf_status_502' => 'waf_status_502', + 'waf_status_503' => 'waf_status_503', + 'waf_status_504' => 'waf_status_504', + 'waf_status_505' => 'waf_status_505', + 'waf_latency_0_to_1ms' => 'waf_latency_0_to_1ms', + 'waf_latency_1_to_5ms' => 'waf_latency_1_to_5ms', + 'waf_latency_5_to_10ms' => 'waf_latency_5_to_10ms', + 'waf_latency_10_to_50ms' => 'waf_latency_10_to_50ms', + 'waf_latency_50_to_100ms' => 'waf_latency_50_to_100ms', + 'waf_latency_100_to_250ms' => 'waf_latency_100_to_250ms', + 'waf_latency_250_to_500ms' => 'waf_latency_250_to_500ms', + 'waf_latency_500_to_1000ms' => 'waf_latency_500_to_1000ms', + 'waf_latency_1000_to_5000ms' => 'waf_latency_1000_to_5000ms', + 'waf_latency_5000_to_10000ms' => 'waf_latency_5000_to_10000ms', + 'waf_latency_10000_to_60000ms' => 'waf_latency_10000_to_60000ms', + 'waf_latency_60000ms' => 'waf_latency_60000ms', + 'compute_responses' => 'compute_responses', + 'compute_resp_header_bytes' => 'compute_resp_header_bytes', + 'compute_resp_body_bytes' => 'compute_resp_body_bytes', + 'compute_status_1xx' => 'compute_status_1xx', + 'compute_status_2xx' => 'compute_status_2xx', + 'compute_status_3xx' => 'compute_status_3xx', + 'compute_status_4xx' => 'compute_status_4xx', + 'compute_status_5xx' => 'compute_status_5xx', + 'compute_status_200' => 'compute_status_200', + 'compute_status_204' => 'compute_status_204', + 'compute_status_206' => 'compute_status_206', + 'compute_status_301' => 'compute_status_301', + 'compute_status_302' => 'compute_status_302', + 'compute_status_304' => 'compute_status_304', + 'compute_status_400' => 'compute_status_400', + 'compute_status_401' => 'compute_status_401', + 'compute_status_403' => 'compute_status_403', + 'compute_status_404' => 'compute_status_404', + 'compute_status_416' => 'compute_status_416', + 'compute_status_429' => 'compute_status_429', + 'compute_status_500' => 'compute_status_500', + 'compute_status_501' => 'compute_status_501', + 'compute_status_502' => 'compute_status_502', + 'compute_status_503' => 'compute_status_503', + 'compute_status_504' => 'compute_status_504', + 'compute_status_505' => 'compute_status_505', + 'compute_latency_0_to_1ms' => 'compute_latency_0_to_1ms', + 'compute_latency_1_to_5ms' => 'compute_latency_1_to_5ms', + 'compute_latency_5_to_10ms' => 'compute_latency_5_to_10ms', + 'compute_latency_10_to_50ms' => 'compute_latency_10_to_50ms', + 'compute_latency_50_to_100ms' => 'compute_latency_50_to_100ms', + 'compute_latency_100_to_250ms' => 'compute_latency_100_to_250ms', + 'compute_latency_250_to_500ms' => 'compute_latency_250_to_500ms', + 'compute_latency_500_to_1000ms' => 'compute_latency_500_to_1000ms', + 'compute_latency_1000_to_5000ms' => 'compute_latency_1000_to_5000ms', + 'compute_latency_5000_to_10000ms' => 'compute_latency_5000_to_10000ms', + 'compute_latency_10000_to_60000ms' => 'compute_latency_10000_to_60000ms', + 'compute_latency_60000ms' => 'compute_latency_60000ms', + 'all_responses' => 'all_responses', + 'all_resp_header_bytes' => 'all_resp_header_bytes', + 'all_resp_body_bytes' => 'all_resp_body_bytes', + 'all_status_1xx' => 'all_status_1xx', + '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_200' => 'all_status_200', + 'all_status_204' => 'all_status_204', + 'all_status_206' => 'all_status_206', + 'all_status_301' => 'all_status_301', + 'all_status_302' => 'all_status_302', + 'all_status_304' => 'all_status_304', + 'all_status_400' => 'all_status_400', + 'all_status_401' => 'all_status_401', + 'all_status_403' => 'all_status_403', + 'all_status_404' => 'all_status_404', + 'all_status_416' => 'all_status_416', + 'all_status_429' => 'all_status_429', + 'all_status_500' => 'all_status_500', + 'all_status_501' => 'all_status_501', + 'all_status_502' => 'all_status_502', + 'all_status_503' => 'all_status_503', + 'all_status_504' => 'all_status_504', + 'all_status_505' => 'all_status_505', + 'all_latency_0_to_1ms' => 'all_latency_0_to_1ms', + 'all_latency_1_to_5ms' => 'all_latency_1_to_5ms', + 'all_latency_5_to_10ms' => 'all_latency_5_to_10ms', + 'all_latency_10_to_50ms' => 'all_latency_10_to_50ms', + 'all_latency_50_to_100ms' => 'all_latency_50_to_100ms', + 'all_latency_100_to_250ms' => 'all_latency_100_to_250ms', + 'all_latency_250_to_500ms' => 'all_latency_250_to_500ms', + 'all_latency_500_to_1000ms' => 'all_latency_500_to_1000ms', + 'all_latency_1000_to_5000ms' => 'all_latency_1000_to_5000ms', + 'all_latency_5000_to_10000ms' => 'all_latency_5000_to_10000ms', + 'all_latency_10000_to_60000ms' => 'all_latency_10000_to_60000ms', + 'all_latency_60000ms' => 'all_latency_60000ms' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'responses' => 'setResponses', + 'resp_header_bytes' => 'setRespHeaderBytes', + 'resp_body_bytes' => 'setRespBodyBytes', + 'status_1xx' => 'setStatus1xx', + 'status_2xx' => 'setStatus2xx', + 'status_3xx' => 'setStatus3xx', + 'status_4xx' => 'setStatus4xx', + 'status_5xx' => 'setStatus5xx', + 'status_200' => 'setStatus200', + 'status_204' => 'setStatus204', + 'status_206' => 'setStatus206', + 'status_301' => 'setStatus301', + 'status_302' => 'setStatus302', + 'status_304' => 'setStatus304', + 'status_400' => 'setStatus400', + 'status_401' => 'setStatus401', + 'status_403' => 'setStatus403', + 'status_404' => 'setStatus404', + 'status_416' => 'setStatus416', + 'status_429' => 'setStatus429', + 'status_500' => 'setStatus500', + 'status_501' => 'setStatus501', + 'status_502' => 'setStatus502', + 'status_503' => 'setStatus503', + 'status_504' => 'setStatus504', + 'status_505' => 'setStatus505', + 'latency_0_to_1ms' => 'setLatency0To1ms', + 'latency_1_to_5ms' => 'setLatency1To5ms', + 'latency_5_to_10ms' => 'setLatency5To10ms', + 'latency_10_to_50ms' => 'setLatency10To50ms', + 'latency_50_to_100ms' => 'setLatency50To100ms', + 'latency_100_to_250ms' => 'setLatency100To250ms', + 'latency_250_to_500ms' => 'setLatency250To500ms', + 'latency_500_to_1000ms' => 'setLatency500To1000ms', + 'latency_1000_to_5000ms' => 'setLatency1000To5000ms', + 'latency_5000_to_10000ms' => 'setLatency5000To10000ms', + 'latency_10000_to_60000ms' => 'setLatency10000To60000ms', + 'latency_60000ms' => 'setLatency60000ms', + 'waf_responses' => 'setWafResponses', + 'waf_resp_header_bytes' => 'setWafRespHeaderBytes', + 'waf_resp_body_bytes' => 'setWafRespBodyBytes', + 'waf_status_1xx' => 'setWafStatus1xx', + 'waf_status_2xx' => 'setWafStatus2xx', + 'waf_status_3xx' => 'setWafStatus3xx', + 'waf_status_4xx' => 'setWafStatus4xx', + 'waf_status_5xx' => 'setWafStatus5xx', + 'waf_status_200' => 'setWafStatus200', + 'waf_status_204' => 'setWafStatus204', + 'waf_status_206' => 'setWafStatus206', + 'waf_status_301' => 'setWafStatus301', + 'waf_status_302' => 'setWafStatus302', + 'waf_status_304' => 'setWafStatus304', + 'waf_status_400' => 'setWafStatus400', + 'waf_status_401' => 'setWafStatus401', + 'waf_status_403' => 'setWafStatus403', + 'waf_status_404' => 'setWafStatus404', + 'waf_status_416' => 'setWafStatus416', + 'waf_status_429' => 'setWafStatus429', + 'waf_status_500' => 'setWafStatus500', + 'waf_status_501' => 'setWafStatus501', + 'waf_status_502' => 'setWafStatus502', + 'waf_status_503' => 'setWafStatus503', + 'waf_status_504' => 'setWafStatus504', + 'waf_status_505' => 'setWafStatus505', + 'waf_latency_0_to_1ms' => 'setWafLatency0To1ms', + 'waf_latency_1_to_5ms' => 'setWafLatency1To5ms', + 'waf_latency_5_to_10ms' => 'setWafLatency5To10ms', + 'waf_latency_10_to_50ms' => 'setWafLatency10To50ms', + 'waf_latency_50_to_100ms' => 'setWafLatency50To100ms', + 'waf_latency_100_to_250ms' => 'setWafLatency100To250ms', + 'waf_latency_250_to_500ms' => 'setWafLatency250To500ms', + 'waf_latency_500_to_1000ms' => 'setWafLatency500To1000ms', + 'waf_latency_1000_to_5000ms' => 'setWafLatency1000To5000ms', + 'waf_latency_5000_to_10000ms' => 'setWafLatency5000To10000ms', + 'waf_latency_10000_to_60000ms' => 'setWafLatency10000To60000ms', + 'waf_latency_60000ms' => 'setWafLatency60000ms', + 'compute_responses' => 'setComputeResponses', + 'compute_resp_header_bytes' => 'setComputeRespHeaderBytes', + 'compute_resp_body_bytes' => 'setComputeRespBodyBytes', + 'compute_status_1xx' => 'setComputeStatus1xx', + 'compute_status_2xx' => 'setComputeStatus2xx', + 'compute_status_3xx' => 'setComputeStatus3xx', + 'compute_status_4xx' => 'setComputeStatus4xx', + 'compute_status_5xx' => 'setComputeStatus5xx', + 'compute_status_200' => 'setComputeStatus200', + 'compute_status_204' => 'setComputeStatus204', + 'compute_status_206' => 'setComputeStatus206', + 'compute_status_301' => 'setComputeStatus301', + 'compute_status_302' => 'setComputeStatus302', + 'compute_status_304' => 'setComputeStatus304', + 'compute_status_400' => 'setComputeStatus400', + 'compute_status_401' => 'setComputeStatus401', + 'compute_status_403' => 'setComputeStatus403', + 'compute_status_404' => 'setComputeStatus404', + 'compute_status_416' => 'setComputeStatus416', + 'compute_status_429' => 'setComputeStatus429', + 'compute_status_500' => 'setComputeStatus500', + 'compute_status_501' => 'setComputeStatus501', + 'compute_status_502' => 'setComputeStatus502', + 'compute_status_503' => 'setComputeStatus503', + 'compute_status_504' => 'setComputeStatus504', + 'compute_status_505' => 'setComputeStatus505', + 'compute_latency_0_to_1ms' => 'setComputeLatency0To1ms', + 'compute_latency_1_to_5ms' => 'setComputeLatency1To5ms', + 'compute_latency_5_to_10ms' => 'setComputeLatency5To10ms', + 'compute_latency_10_to_50ms' => 'setComputeLatency10To50ms', + 'compute_latency_50_to_100ms' => 'setComputeLatency50To100ms', + 'compute_latency_100_to_250ms' => 'setComputeLatency100To250ms', + 'compute_latency_250_to_500ms' => 'setComputeLatency250To500ms', + 'compute_latency_500_to_1000ms' => 'setComputeLatency500To1000ms', + 'compute_latency_1000_to_5000ms' => 'setComputeLatency1000To5000ms', + 'compute_latency_5000_to_10000ms' => 'setComputeLatency5000To10000ms', + 'compute_latency_10000_to_60000ms' => 'setComputeLatency10000To60000ms', + 'compute_latency_60000ms' => 'setComputeLatency60000ms', + 'all_responses' => 'setAllResponses', + 'all_resp_header_bytes' => 'setAllRespHeaderBytes', + 'all_resp_body_bytes' => 'setAllRespBodyBytes', + 'all_status_1xx' => 'setAllStatus1xx', + 'all_status_2xx' => 'setAllStatus2xx', + 'all_status_3xx' => 'setAllStatus3xx', + 'all_status_4xx' => 'setAllStatus4xx', + 'all_status_5xx' => 'setAllStatus5xx', + 'all_status_200' => 'setAllStatus200', + 'all_status_204' => 'setAllStatus204', + 'all_status_206' => 'setAllStatus206', + 'all_status_301' => 'setAllStatus301', + 'all_status_302' => 'setAllStatus302', + 'all_status_304' => 'setAllStatus304', + 'all_status_400' => 'setAllStatus400', + 'all_status_401' => 'setAllStatus401', + 'all_status_403' => 'setAllStatus403', + 'all_status_404' => 'setAllStatus404', + 'all_status_416' => 'setAllStatus416', + 'all_status_429' => 'setAllStatus429', + 'all_status_500' => 'setAllStatus500', + 'all_status_501' => 'setAllStatus501', + 'all_status_502' => 'setAllStatus502', + 'all_status_503' => 'setAllStatus503', + 'all_status_504' => 'setAllStatus504', + 'all_status_505' => 'setAllStatus505', + 'all_latency_0_to_1ms' => 'setAllLatency0To1ms', + 'all_latency_1_to_5ms' => 'setAllLatency1To5ms', + 'all_latency_5_to_10ms' => 'setAllLatency5To10ms', + 'all_latency_10_to_50ms' => 'setAllLatency10To50ms', + 'all_latency_50_to_100ms' => 'setAllLatency50To100ms', + 'all_latency_100_to_250ms' => 'setAllLatency100To250ms', + 'all_latency_250_to_500ms' => 'setAllLatency250To500ms', + 'all_latency_500_to_1000ms' => 'setAllLatency500To1000ms', + 'all_latency_1000_to_5000ms' => 'setAllLatency1000To5000ms', + 'all_latency_5000_to_10000ms' => 'setAllLatency5000To10000ms', + 'all_latency_10000_to_60000ms' => 'setAllLatency10000To60000ms', + 'all_latency_60000ms' => 'setAllLatency60000ms' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'responses' => 'getResponses', + 'resp_header_bytes' => 'getRespHeaderBytes', + 'resp_body_bytes' => 'getRespBodyBytes', + 'status_1xx' => 'getStatus1xx', + 'status_2xx' => 'getStatus2xx', + 'status_3xx' => 'getStatus3xx', + 'status_4xx' => 'getStatus4xx', + 'status_5xx' => 'getStatus5xx', + 'status_200' => 'getStatus200', + 'status_204' => 'getStatus204', + 'status_206' => 'getStatus206', + 'status_301' => 'getStatus301', + 'status_302' => 'getStatus302', + 'status_304' => 'getStatus304', + 'status_400' => 'getStatus400', + 'status_401' => 'getStatus401', + 'status_403' => 'getStatus403', + 'status_404' => 'getStatus404', + 'status_416' => 'getStatus416', + 'status_429' => 'getStatus429', + 'status_500' => 'getStatus500', + 'status_501' => 'getStatus501', + 'status_502' => 'getStatus502', + 'status_503' => 'getStatus503', + 'status_504' => 'getStatus504', + 'status_505' => 'getStatus505', + 'latency_0_to_1ms' => 'getLatency0To1ms', + 'latency_1_to_5ms' => 'getLatency1To5ms', + 'latency_5_to_10ms' => 'getLatency5To10ms', + 'latency_10_to_50ms' => 'getLatency10To50ms', + 'latency_50_to_100ms' => 'getLatency50To100ms', + 'latency_100_to_250ms' => 'getLatency100To250ms', + 'latency_250_to_500ms' => 'getLatency250To500ms', + 'latency_500_to_1000ms' => 'getLatency500To1000ms', + 'latency_1000_to_5000ms' => 'getLatency1000To5000ms', + 'latency_5000_to_10000ms' => 'getLatency5000To10000ms', + 'latency_10000_to_60000ms' => 'getLatency10000To60000ms', + 'latency_60000ms' => 'getLatency60000ms', + 'waf_responses' => 'getWafResponses', + 'waf_resp_header_bytes' => 'getWafRespHeaderBytes', + 'waf_resp_body_bytes' => 'getWafRespBodyBytes', + 'waf_status_1xx' => 'getWafStatus1xx', + 'waf_status_2xx' => 'getWafStatus2xx', + 'waf_status_3xx' => 'getWafStatus3xx', + 'waf_status_4xx' => 'getWafStatus4xx', + 'waf_status_5xx' => 'getWafStatus5xx', + 'waf_status_200' => 'getWafStatus200', + 'waf_status_204' => 'getWafStatus204', + 'waf_status_206' => 'getWafStatus206', + 'waf_status_301' => 'getWafStatus301', + 'waf_status_302' => 'getWafStatus302', + 'waf_status_304' => 'getWafStatus304', + 'waf_status_400' => 'getWafStatus400', + 'waf_status_401' => 'getWafStatus401', + 'waf_status_403' => 'getWafStatus403', + 'waf_status_404' => 'getWafStatus404', + 'waf_status_416' => 'getWafStatus416', + 'waf_status_429' => 'getWafStatus429', + 'waf_status_500' => 'getWafStatus500', + 'waf_status_501' => 'getWafStatus501', + 'waf_status_502' => 'getWafStatus502', + 'waf_status_503' => 'getWafStatus503', + 'waf_status_504' => 'getWafStatus504', + 'waf_status_505' => 'getWafStatus505', + 'waf_latency_0_to_1ms' => 'getWafLatency0To1ms', + 'waf_latency_1_to_5ms' => 'getWafLatency1To5ms', + 'waf_latency_5_to_10ms' => 'getWafLatency5To10ms', + 'waf_latency_10_to_50ms' => 'getWafLatency10To50ms', + 'waf_latency_50_to_100ms' => 'getWafLatency50To100ms', + 'waf_latency_100_to_250ms' => 'getWafLatency100To250ms', + 'waf_latency_250_to_500ms' => 'getWafLatency250To500ms', + 'waf_latency_500_to_1000ms' => 'getWafLatency500To1000ms', + 'waf_latency_1000_to_5000ms' => 'getWafLatency1000To5000ms', + 'waf_latency_5000_to_10000ms' => 'getWafLatency5000To10000ms', + 'waf_latency_10000_to_60000ms' => 'getWafLatency10000To60000ms', + 'waf_latency_60000ms' => 'getWafLatency60000ms', + 'compute_responses' => 'getComputeResponses', + 'compute_resp_header_bytes' => 'getComputeRespHeaderBytes', + 'compute_resp_body_bytes' => 'getComputeRespBodyBytes', + 'compute_status_1xx' => 'getComputeStatus1xx', + 'compute_status_2xx' => 'getComputeStatus2xx', + 'compute_status_3xx' => 'getComputeStatus3xx', + 'compute_status_4xx' => 'getComputeStatus4xx', + 'compute_status_5xx' => 'getComputeStatus5xx', + 'compute_status_200' => 'getComputeStatus200', + 'compute_status_204' => 'getComputeStatus204', + 'compute_status_206' => 'getComputeStatus206', + 'compute_status_301' => 'getComputeStatus301', + 'compute_status_302' => 'getComputeStatus302', + 'compute_status_304' => 'getComputeStatus304', + 'compute_status_400' => 'getComputeStatus400', + 'compute_status_401' => 'getComputeStatus401', + 'compute_status_403' => 'getComputeStatus403', + 'compute_status_404' => 'getComputeStatus404', + 'compute_status_416' => 'getComputeStatus416', + 'compute_status_429' => 'getComputeStatus429', + 'compute_status_500' => 'getComputeStatus500', + 'compute_status_501' => 'getComputeStatus501', + 'compute_status_502' => 'getComputeStatus502', + 'compute_status_503' => 'getComputeStatus503', + 'compute_status_504' => 'getComputeStatus504', + 'compute_status_505' => 'getComputeStatus505', + 'compute_latency_0_to_1ms' => 'getComputeLatency0To1ms', + 'compute_latency_1_to_5ms' => 'getComputeLatency1To5ms', + 'compute_latency_5_to_10ms' => 'getComputeLatency5To10ms', + 'compute_latency_10_to_50ms' => 'getComputeLatency10To50ms', + 'compute_latency_50_to_100ms' => 'getComputeLatency50To100ms', + 'compute_latency_100_to_250ms' => 'getComputeLatency100To250ms', + 'compute_latency_250_to_500ms' => 'getComputeLatency250To500ms', + 'compute_latency_500_to_1000ms' => 'getComputeLatency500To1000ms', + 'compute_latency_1000_to_5000ms' => 'getComputeLatency1000To5000ms', + 'compute_latency_5000_to_10000ms' => 'getComputeLatency5000To10000ms', + 'compute_latency_10000_to_60000ms' => 'getComputeLatency10000To60000ms', + 'compute_latency_60000ms' => 'getComputeLatency60000ms', + 'all_responses' => 'getAllResponses', + 'all_resp_header_bytes' => 'getAllRespHeaderBytes', + 'all_resp_body_bytes' => 'getAllRespBodyBytes', + 'all_status_1xx' => 'getAllStatus1xx', + 'all_status_2xx' => 'getAllStatus2xx', + 'all_status_3xx' => 'getAllStatus3xx', + 'all_status_4xx' => 'getAllStatus4xx', + 'all_status_5xx' => 'getAllStatus5xx', + 'all_status_200' => 'getAllStatus200', + 'all_status_204' => 'getAllStatus204', + 'all_status_206' => 'getAllStatus206', + 'all_status_301' => 'getAllStatus301', + 'all_status_302' => 'getAllStatus302', + 'all_status_304' => 'getAllStatus304', + 'all_status_400' => 'getAllStatus400', + 'all_status_401' => 'getAllStatus401', + 'all_status_403' => 'getAllStatus403', + 'all_status_404' => 'getAllStatus404', + 'all_status_416' => 'getAllStatus416', + 'all_status_429' => 'getAllStatus429', + 'all_status_500' => 'getAllStatus500', + 'all_status_501' => 'getAllStatus501', + 'all_status_502' => 'getAllStatus502', + 'all_status_503' => 'getAllStatus503', + 'all_status_504' => 'getAllStatus504', + 'all_status_505' => 'getAllStatus505', + 'all_latency_0_to_1ms' => 'getAllLatency0To1ms', + 'all_latency_1_to_5ms' => 'getAllLatency1To5ms', + 'all_latency_5_to_10ms' => 'getAllLatency5To10ms', + 'all_latency_10_to_50ms' => 'getAllLatency10To50ms', + 'all_latency_50_to_100ms' => 'getAllLatency50To100ms', + 'all_latency_100_to_250ms' => 'getAllLatency100To250ms', + 'all_latency_250_to_500ms' => 'getAllLatency250To500ms', + 'all_latency_500_to_1000ms' => 'getAllLatency500To1000ms', + 'all_latency_1000_to_5000ms' => 'getAllLatency1000To5000ms', + 'all_latency_5000_to_10000ms' => 'getAllLatency5000To10000ms', + 'all_latency_10000_to_60000ms' => 'getAllLatency10000To60000ms', + 'all_latency_60000ms' => 'getAllLatency60000ms' + ]; + + /** + * 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['responses'] = $data['responses'] ?? null; + $this->container['resp_header_bytes'] = $data['resp_header_bytes'] ?? null; + $this->container['resp_body_bytes'] = $data['resp_body_bytes'] ?? null; + $this->container['status_1xx'] = $data['status_1xx'] ?? null; + $this->container['status_2xx'] = $data['status_2xx'] ?? null; + $this->container['status_3xx'] = $data['status_3xx'] ?? null; + $this->container['status_4xx'] = $data['status_4xx'] ?? null; + $this->container['status_5xx'] = $data['status_5xx'] ?? null; + $this->container['status_200'] = $data['status_200'] ?? null; + $this->container['status_204'] = $data['status_204'] ?? null; + $this->container['status_206'] = $data['status_206'] ?? null; + $this->container['status_301'] = $data['status_301'] ?? null; + $this->container['status_302'] = $data['status_302'] ?? null; + $this->container['status_304'] = $data['status_304'] ?? null; + $this->container['status_400'] = $data['status_400'] ?? null; + $this->container['status_401'] = $data['status_401'] ?? null; + $this->container['status_403'] = $data['status_403'] ?? null; + $this->container['status_404'] = $data['status_404'] ?? null; + $this->container['status_416'] = $data['status_416'] ?? null; + $this->container['status_429'] = $data['status_429'] ?? null; + $this->container['status_500'] = $data['status_500'] ?? null; + $this->container['status_501'] = $data['status_501'] ?? null; + $this->container['status_502'] = $data['status_502'] ?? null; + $this->container['status_503'] = $data['status_503'] ?? null; + $this->container['status_504'] = $data['status_504'] ?? null; + $this->container['status_505'] = $data['status_505'] ?? null; + $this->container['latency_0_to_1ms'] = $data['latency_0_to_1ms'] ?? null; + $this->container['latency_1_to_5ms'] = $data['latency_1_to_5ms'] ?? null; + $this->container['latency_5_to_10ms'] = $data['latency_5_to_10ms'] ?? null; + $this->container['latency_10_to_50ms'] = $data['latency_10_to_50ms'] ?? null; + $this->container['latency_50_to_100ms'] = $data['latency_50_to_100ms'] ?? null; + $this->container['latency_100_to_250ms'] = $data['latency_100_to_250ms'] ?? null; + $this->container['latency_250_to_500ms'] = $data['latency_250_to_500ms'] ?? null; + $this->container['latency_500_to_1000ms'] = $data['latency_500_to_1000ms'] ?? null; + $this->container['latency_1000_to_5000ms'] = $data['latency_1000_to_5000ms'] ?? null; + $this->container['latency_5000_to_10000ms'] = $data['latency_5000_to_10000ms'] ?? null; + $this->container['latency_10000_to_60000ms'] = $data['latency_10000_to_60000ms'] ?? null; + $this->container['latency_60000ms'] = $data['latency_60000ms'] ?? null; + $this->container['waf_responses'] = $data['waf_responses'] ?? null; + $this->container['waf_resp_header_bytes'] = $data['waf_resp_header_bytes'] ?? null; + $this->container['waf_resp_body_bytes'] = $data['waf_resp_body_bytes'] ?? null; + $this->container['waf_status_1xx'] = $data['waf_status_1xx'] ?? null; + $this->container['waf_status_2xx'] = $data['waf_status_2xx'] ?? null; + $this->container['waf_status_3xx'] = $data['waf_status_3xx'] ?? null; + $this->container['waf_status_4xx'] = $data['waf_status_4xx'] ?? null; + $this->container['waf_status_5xx'] = $data['waf_status_5xx'] ?? null; + $this->container['waf_status_200'] = $data['waf_status_200'] ?? null; + $this->container['waf_status_204'] = $data['waf_status_204'] ?? null; + $this->container['waf_status_206'] = $data['waf_status_206'] ?? null; + $this->container['waf_status_301'] = $data['waf_status_301'] ?? null; + $this->container['waf_status_302'] = $data['waf_status_302'] ?? null; + $this->container['waf_status_304'] = $data['waf_status_304'] ?? null; + $this->container['waf_status_400'] = $data['waf_status_400'] ?? null; + $this->container['waf_status_401'] = $data['waf_status_401'] ?? null; + $this->container['waf_status_403'] = $data['waf_status_403'] ?? null; + $this->container['waf_status_404'] = $data['waf_status_404'] ?? null; + $this->container['waf_status_416'] = $data['waf_status_416'] ?? null; + $this->container['waf_status_429'] = $data['waf_status_429'] ?? null; + $this->container['waf_status_500'] = $data['waf_status_500'] ?? null; + $this->container['waf_status_501'] = $data['waf_status_501'] ?? null; + $this->container['waf_status_502'] = $data['waf_status_502'] ?? null; + $this->container['waf_status_503'] = $data['waf_status_503'] ?? null; + $this->container['waf_status_504'] = $data['waf_status_504'] ?? null; + $this->container['waf_status_505'] = $data['waf_status_505'] ?? null; + $this->container['waf_latency_0_to_1ms'] = $data['waf_latency_0_to_1ms'] ?? null; + $this->container['waf_latency_1_to_5ms'] = $data['waf_latency_1_to_5ms'] ?? null; + $this->container['waf_latency_5_to_10ms'] = $data['waf_latency_5_to_10ms'] ?? null; + $this->container['waf_latency_10_to_50ms'] = $data['waf_latency_10_to_50ms'] ?? null; + $this->container['waf_latency_50_to_100ms'] = $data['waf_latency_50_to_100ms'] ?? null; + $this->container['waf_latency_100_to_250ms'] = $data['waf_latency_100_to_250ms'] ?? null; + $this->container['waf_latency_250_to_500ms'] = $data['waf_latency_250_to_500ms'] ?? null; + $this->container['waf_latency_500_to_1000ms'] = $data['waf_latency_500_to_1000ms'] ?? null; + $this->container['waf_latency_1000_to_5000ms'] = $data['waf_latency_1000_to_5000ms'] ?? null; + $this->container['waf_latency_5000_to_10000ms'] = $data['waf_latency_5000_to_10000ms'] ?? null; + $this->container['waf_latency_10000_to_60000ms'] = $data['waf_latency_10000_to_60000ms'] ?? null; + $this->container['waf_latency_60000ms'] = $data['waf_latency_60000ms'] ?? null; + $this->container['compute_responses'] = $data['compute_responses'] ?? null; + $this->container['compute_resp_header_bytes'] = $data['compute_resp_header_bytes'] ?? null; + $this->container['compute_resp_body_bytes'] = $data['compute_resp_body_bytes'] ?? null; + $this->container['compute_status_1xx'] = $data['compute_status_1xx'] ?? null; + $this->container['compute_status_2xx'] = $data['compute_status_2xx'] ?? null; + $this->container['compute_status_3xx'] = $data['compute_status_3xx'] ?? null; + $this->container['compute_status_4xx'] = $data['compute_status_4xx'] ?? null; + $this->container['compute_status_5xx'] = $data['compute_status_5xx'] ?? null; + $this->container['compute_status_200'] = $data['compute_status_200'] ?? null; + $this->container['compute_status_204'] = $data['compute_status_204'] ?? null; + $this->container['compute_status_206'] = $data['compute_status_206'] ?? null; + $this->container['compute_status_301'] = $data['compute_status_301'] ?? null; + $this->container['compute_status_302'] = $data['compute_status_302'] ?? null; + $this->container['compute_status_304'] = $data['compute_status_304'] ?? null; + $this->container['compute_status_400'] = $data['compute_status_400'] ?? null; + $this->container['compute_status_401'] = $data['compute_status_401'] ?? null; + $this->container['compute_status_403'] = $data['compute_status_403'] ?? null; + $this->container['compute_status_404'] = $data['compute_status_404'] ?? null; + $this->container['compute_status_416'] = $data['compute_status_416'] ?? null; + $this->container['compute_status_429'] = $data['compute_status_429'] ?? null; + $this->container['compute_status_500'] = $data['compute_status_500'] ?? null; + $this->container['compute_status_501'] = $data['compute_status_501'] ?? null; + $this->container['compute_status_502'] = $data['compute_status_502'] ?? null; + $this->container['compute_status_503'] = $data['compute_status_503'] ?? null; + $this->container['compute_status_504'] = $data['compute_status_504'] ?? null; + $this->container['compute_status_505'] = $data['compute_status_505'] ?? null; + $this->container['compute_latency_0_to_1ms'] = $data['compute_latency_0_to_1ms'] ?? null; + $this->container['compute_latency_1_to_5ms'] = $data['compute_latency_1_to_5ms'] ?? null; + $this->container['compute_latency_5_to_10ms'] = $data['compute_latency_5_to_10ms'] ?? null; + $this->container['compute_latency_10_to_50ms'] = $data['compute_latency_10_to_50ms'] ?? null; + $this->container['compute_latency_50_to_100ms'] = $data['compute_latency_50_to_100ms'] ?? null; + $this->container['compute_latency_100_to_250ms'] = $data['compute_latency_100_to_250ms'] ?? null; + $this->container['compute_latency_250_to_500ms'] = $data['compute_latency_250_to_500ms'] ?? null; + $this->container['compute_latency_500_to_1000ms'] = $data['compute_latency_500_to_1000ms'] ?? null; + $this->container['compute_latency_1000_to_5000ms'] = $data['compute_latency_1000_to_5000ms'] ?? null; + $this->container['compute_latency_5000_to_10000ms'] = $data['compute_latency_5000_to_10000ms'] ?? null; + $this->container['compute_latency_10000_to_60000ms'] = $data['compute_latency_10000_to_60000ms'] ?? null; + $this->container['compute_latency_60000ms'] = $data['compute_latency_60000ms'] ?? null; + $this->container['all_responses'] = $data['all_responses'] ?? null; + $this->container['all_resp_header_bytes'] = $data['all_resp_header_bytes'] ?? null; + $this->container['all_resp_body_bytes'] = $data['all_resp_body_bytes'] ?? null; + $this->container['all_status_1xx'] = $data['all_status_1xx'] ?? null; + $this->container['all_status_2xx'] = $data['all_status_2xx'] ?? 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['all_status_200'] = $data['all_status_200'] ?? null; + $this->container['all_status_204'] = $data['all_status_204'] ?? null; + $this->container['all_status_206'] = $data['all_status_206'] ?? null; + $this->container['all_status_301'] = $data['all_status_301'] ?? null; + $this->container['all_status_302'] = $data['all_status_302'] ?? null; + $this->container['all_status_304'] = $data['all_status_304'] ?? null; + $this->container['all_status_400'] = $data['all_status_400'] ?? null; + $this->container['all_status_401'] = $data['all_status_401'] ?? null; + $this->container['all_status_403'] = $data['all_status_403'] ?? null; + $this->container['all_status_404'] = $data['all_status_404'] ?? null; + $this->container['all_status_416'] = $data['all_status_416'] ?? null; + $this->container['all_status_429'] = $data['all_status_429'] ?? null; + $this->container['all_status_500'] = $data['all_status_500'] ?? null; + $this->container['all_status_501'] = $data['all_status_501'] ?? null; + $this->container['all_status_502'] = $data['all_status_502'] ?? null; + $this->container['all_status_503'] = $data['all_status_503'] ?? null; + $this->container['all_status_504'] = $data['all_status_504'] ?? null; + $this->container['all_status_505'] = $data['all_status_505'] ?? null; + $this->container['all_latency_0_to_1ms'] = $data['all_latency_0_to_1ms'] ?? null; + $this->container['all_latency_1_to_5ms'] = $data['all_latency_1_to_5ms'] ?? null; + $this->container['all_latency_5_to_10ms'] = $data['all_latency_5_to_10ms'] ?? null; + $this->container['all_latency_10_to_50ms'] = $data['all_latency_10_to_50ms'] ?? null; + $this->container['all_latency_50_to_100ms'] = $data['all_latency_50_to_100ms'] ?? null; + $this->container['all_latency_100_to_250ms'] = $data['all_latency_100_to_250ms'] ?? null; + $this->container['all_latency_250_to_500ms'] = $data['all_latency_250_to_500ms'] ?? null; + $this->container['all_latency_500_to_1000ms'] = $data['all_latency_500_to_1000ms'] ?? null; + $this->container['all_latency_1000_to_5000ms'] = $data['all_latency_1000_to_5000ms'] ?? null; + $this->container['all_latency_5000_to_10000ms'] = $data['all_latency_5000_to_10000ms'] ?? null; + $this->container['all_latency_10000_to_60000ms'] = $data['all_latency_10000_to_60000ms'] ?? null; + $this->container['all_latency_60000ms'] = $data['all_latency_60000ms'] ?? 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 responses + * + * @return int|null + */ + public function getResponses() + { + return $this->container['responses']; + } + + /** + * Sets responses + * + * @param int|null $responses Number of responses from origin. + * + * @return self + */ + public function setResponses($responses) + { + $this->container['responses'] = $responses; + + return $this; + } + + /** + * Gets resp_header_bytes + * + * @return int|null + */ + public function getRespHeaderBytes() + { + return $this->container['resp_header_bytes']; + } + + /** + * Sets resp_header_bytes + * + * @param int|null $resp_header_bytes Number of header bytes from origin. + * + * @return self + */ + public function setRespHeaderBytes($resp_header_bytes) + { + $this->container['resp_header_bytes'] = $resp_header_bytes; + + return $this; + } + + /** + * Gets resp_body_bytes + * + * @return int|null + */ + public function getRespBodyBytes() + { + return $this->container['resp_body_bytes']; + } + + /** + * Sets resp_body_bytes + * + * @param int|null $resp_body_bytes Number of body bytes from origin. + * + * @return self + */ + public function setRespBodyBytes($resp_body_bytes) + { + $this->container['resp_body_bytes'] = $resp_body_bytes; + + return $this; + } + + /** + * Gets status_1xx + * + * @return int|null + */ + public function getStatus1xx() + { + return $this->container['status_1xx']; + } + + /** + * Sets status_1xx + * + * @param int|null $status_1xx Number of 1xx \"Informational\" status codes delivered from origin. + * + * @return self + */ + public function setStatus1xx($status_1xx) + { + $this->container['status_1xx'] = $status_1xx; + + return $this; + } + + /** + * Gets status_2xx + * + * @return int|null + */ + public function getStatus2xx() + { + return $this->container['status_2xx']; + } + + /** + * Sets status_2xx + * + * @param int|null $status_2xx Number of 2xx \"Success\" status codes delivered from origin. + * + * @return self + */ + public function setStatus2xx($status_2xx) + { + $this->container['status_2xx'] = $status_2xx; + + return $this; + } + + /** + * Gets status_3xx + * + * @return int|null + */ + public function getStatus3xx() + { + return $this->container['status_3xx']; + } + + /** + * Sets status_3xx + * + * @param int|null $status_3xx Number of 3xx \"Redirection\" codes delivered from origin. + * + * @return self + */ + public function setStatus3xx($status_3xx) + { + $this->container['status_3xx'] = $status_3xx; + + return $this; + } + + /** + * Gets status_4xx + * + * @return int|null + */ + public function getStatus4xx() + { + return $this->container['status_4xx']; + } + + /** + * Sets status_4xx + * + * @param int|null $status_4xx Number of 4xx \"Client Error\" codes delivered from origin. + * + * @return self + */ + public function setStatus4xx($status_4xx) + { + $this->container['status_4xx'] = $status_4xx; + + return $this; + } + + /** + * Gets status_5xx + * + * @return int|null + */ + public function getStatus5xx() + { + return $this->container['status_5xx']; + } + + /** + * Sets status_5xx + * + * @param int|null $status_5xx Number of 5xx \"Server Error\" codes delivered from origin. + * + * @return self + */ + public function setStatus5xx($status_5xx) + { + $this->container['status_5xx'] = $status_5xx; + + return $this; + } + + /** + * Gets status_200 + * + * @return int|null + */ + public function getStatus200() + { + return $this->container['status_200']; + } + + /** + * Sets status_200 + * + * @param int|null $status_200 Number of responses received with status code 200 (Success) from origin. + * + * @return self + */ + public function setStatus200($status_200) + { + $this->container['status_200'] = $status_200; + + return $this; + } + + /** + * Gets status_204 + * + * @return int|null + */ + public function getStatus204() + { + return $this->container['status_204']; + } + + /** + * Sets status_204 + * + * @param int|null $status_204 Number of responses received with status code 204 (No Content) from origin. + * + * @return self + */ + public function setStatus204($status_204) + { + $this->container['status_204'] = $status_204; + + return $this; + } + + /** + * Gets status_206 + * + * @return int|null + */ + public function getStatus206() + { + return $this->container['status_206']; + } + + /** + * Sets status_206 + * + * @param int|null $status_206 Number of responses received with status code 206 (Partial Content) from origin. + * + * @return self + */ + public function setStatus206($status_206) + { + $this->container['status_206'] = $status_206; + + return $this; + } + + /** + * Gets status_301 + * + * @return int|null + */ + public function getStatus301() + { + return $this->container['status_301']; + } + + /** + * Sets status_301 + * + * @param int|null $status_301 Number of responses received with status code 301 (Moved Permanently) from origin. + * + * @return self + */ + public function setStatus301($status_301) + { + $this->container['status_301'] = $status_301; + + return $this; + } + + /** + * Gets status_302 + * + * @return int|null + */ + public function getStatus302() + { + return $this->container['status_302']; + } + + /** + * Sets status_302 + * + * @param int|null $status_302 Number of responses received with status code 302 (Found) from origin. + * + * @return self + */ + public function setStatus302($status_302) + { + $this->container['status_302'] = $status_302; + + return $this; + } + + /** + * Gets status_304 + * + * @return int|null + */ + public function getStatus304() + { + return $this->container['status_304']; + } + + /** + * Sets status_304 + * + * @param int|null $status_304 Number of responses received with status code 304 (Not Modified) from origin. + * + * @return self + */ + public function setStatus304($status_304) + { + $this->container['status_304'] = $status_304; + + return $this; + } + + /** + * Gets status_400 + * + * @return int|null + */ + public function getStatus400() + { + return $this->container['status_400']; + } + + /** + * Sets status_400 + * + * @param int|null $status_400 Number of responses received with status code 400 (Bad Request) from origin. + * + * @return self + */ + public function setStatus400($status_400) + { + $this->container['status_400'] = $status_400; + + return $this; + } + + /** + * Gets status_401 + * + * @return int|null + */ + public function getStatus401() + { + return $this->container['status_401']; + } + + /** + * Sets status_401 + * + * @param int|null $status_401 Number of responses received with status code 401 (Unauthorized) from origin. + * + * @return self + */ + public function setStatus401($status_401) + { + $this->container['status_401'] = $status_401; + + return $this; + } + + /** + * Gets status_403 + * + * @return int|null + */ + public function getStatus403() + { + return $this->container['status_403']; + } + + /** + * Sets status_403 + * + * @param int|null $status_403 Number of responses received with status code 403 (Forbidden) from origin. + * + * @return self + */ + public function setStatus403($status_403) + { + $this->container['status_403'] = $status_403; + + return $this; + } + + /** + * Gets status_404 + * + * @return int|null + */ + public function getStatus404() + { + return $this->container['status_404']; + } + + /** + * Sets status_404 + * + * @param int|null $status_404 Number of responses received with status code 404 (Not Found) from origin. + * + * @return self + */ + public function setStatus404($status_404) + { + $this->container['status_404'] = $status_404; + + return $this; + } + + /** + * Gets status_416 + * + * @return int|null + */ + public function getStatus416() + { + return $this->container['status_416']; + } + + /** + * Sets status_416 + * + * @param int|null $status_416 Number of responses received with status code 416 (Range Not Satisfiable) from origin. + * + * @return self + */ + public function setStatus416($status_416) + { + $this->container['status_416'] = $status_416; + + return $this; + } + + /** + * Gets status_429 + * + * @return int|null + */ + public function getStatus429() + { + return $this->container['status_429']; + } + + /** + * Sets status_429 + * + * @param int|null $status_429 Number of responses received with status code 429 (Too Many Requests) from origin. + * + * @return self + */ + public function setStatus429($status_429) + { + $this->container['status_429'] = $status_429; + + return $this; + } + + /** + * Gets status_500 + * + * @return int|null + */ + public function getStatus500() + { + return $this->container['status_500']; + } + + /** + * Sets status_500 + * + * @param int|null $status_500 Number of responses received with status code 500 (Internal Server Error) from origin. + * + * @return self + */ + public function setStatus500($status_500) + { + $this->container['status_500'] = $status_500; + + return $this; + } + + /** + * Gets status_501 + * + * @return int|null + */ + public function getStatus501() + { + return $this->container['status_501']; + } + + /** + * Sets status_501 + * + * @param int|null $status_501 Number of responses received with status code 501 (Not Implemented) from origin. + * + * @return self + */ + public function setStatus501($status_501) + { + $this->container['status_501'] = $status_501; + + return $this; + } + + /** + * Gets status_502 + * + * @return int|null + */ + public function getStatus502() + { + return $this->container['status_502']; + } + + /** + * Sets status_502 + * + * @param int|null $status_502 Number of responses received with status code 502 (Bad Gateway) from origin. + * + * @return self + */ + public function setStatus502($status_502) + { + $this->container['status_502'] = $status_502; + + return $this; + } + + /** + * Gets status_503 + * + * @return int|null + */ + public function getStatus503() + { + return $this->container['status_503']; + } + + /** + * Sets status_503 + * + * @param int|null $status_503 Number of responses received with status code 503 (Service Unavailable) from origin. + * + * @return self + */ + public function setStatus503($status_503) + { + $this->container['status_503'] = $status_503; + + return $this; + } + + /** + * Gets status_504 + * + * @return int|null + */ + public function getStatus504() + { + return $this->container['status_504']; + } + + /** + * Sets status_504 + * + * @param int|null $status_504 Number of responses received with status code 504 (Gateway Timeout) from origin. + * + * @return self + */ + public function setStatus504($status_504) + { + $this->container['status_504'] = $status_504; + + return $this; + } + + /** + * Gets status_505 + * + * @return int|null + */ + public function getStatus505() + { + return $this->container['status_505']; + } + + /** + * Sets status_505 + * + * @param int|null $status_505 Number of responses received with status code 505 (HTTP Version Not Supported) from origin. + * + * @return self + */ + public function setStatus505($status_505) + { + $this->container['status_505'] = $status_505; + + return $this; + } + + /** + * Gets latency_0_to_1ms + * + * @return int|null + */ + public function getLatency0To1ms() + { + return $this->container['latency_0_to_1ms']; + } + + /** + * Sets latency_0_to_1ms + * + * @param int|null $latency_0_to_1ms Number of responses from origin with latency between 0 and 1 millisecond. + * + * @return self + */ + public function setLatency0To1ms($latency_0_to_1ms) + { + $this->container['latency_0_to_1ms'] = $latency_0_to_1ms; + + return $this; + } + + /** + * Gets latency_1_to_5ms + * + * @return int|null + */ + public function getLatency1To5ms() + { + return $this->container['latency_1_to_5ms']; + } + + /** + * Sets latency_1_to_5ms + * + * @param int|null $latency_1_to_5ms Number of responses from origin with latency between 1 and 5 milliseconds. + * + * @return self + */ + public function setLatency1To5ms($latency_1_to_5ms) + { + $this->container['latency_1_to_5ms'] = $latency_1_to_5ms; + + return $this; + } + + /** + * Gets latency_5_to_10ms + * + * @return int|null + */ + public function getLatency5To10ms() + { + return $this->container['latency_5_to_10ms']; + } + + /** + * Sets latency_5_to_10ms + * + * @param int|null $latency_5_to_10ms Number of responses from origin with latency between 5 and 10 milliseconds. + * + * @return self + */ + public function setLatency5To10ms($latency_5_to_10ms) + { + $this->container['latency_5_to_10ms'] = $latency_5_to_10ms; + + return $this; + } + + /** + * Gets latency_10_to_50ms + * + * @return int|null + */ + public function getLatency10To50ms() + { + return $this->container['latency_10_to_50ms']; + } + + /** + * Sets latency_10_to_50ms + * + * @param int|null $latency_10_to_50ms Number of responses from origin with latency between 10 and 50 milliseconds. + * + * @return self + */ + public function setLatency10To50ms($latency_10_to_50ms) + { + $this->container['latency_10_to_50ms'] = $latency_10_to_50ms; + + return $this; + } + + /** + * Gets latency_50_to_100ms + * + * @return int|null + */ + public function getLatency50To100ms() + { + return $this->container['latency_50_to_100ms']; + } + + /** + * Sets latency_50_to_100ms + * + * @param int|null $latency_50_to_100ms Number of responses from origin with latency between 50 and 100 milliseconds. + * + * @return self + */ + public function setLatency50To100ms($latency_50_to_100ms) + { + $this->container['latency_50_to_100ms'] = $latency_50_to_100ms; + + return $this; + } + + /** + * Gets latency_100_to_250ms + * + * @return int|null + */ + public function getLatency100To250ms() + { + return $this->container['latency_100_to_250ms']; + } + + /** + * Sets latency_100_to_250ms + * + * @param int|null $latency_100_to_250ms Number of responses from origin with latency between 100 and 250 milliseconds. + * + * @return self + */ + public function setLatency100To250ms($latency_100_to_250ms) + { + $this->container['latency_100_to_250ms'] = $latency_100_to_250ms; + + return $this; + } + + /** + * Gets latency_250_to_500ms + * + * @return int|null + */ + public function getLatency250To500ms() + { + return $this->container['latency_250_to_500ms']; + } + + /** + * Sets latency_250_to_500ms + * + * @param int|null $latency_250_to_500ms Number of responses from origin with latency between 250 and 500 milliseconds. + * + * @return self + */ + public function setLatency250To500ms($latency_250_to_500ms) + { + $this->container['latency_250_to_500ms'] = $latency_250_to_500ms; + + return $this; + } + + /** + * Gets latency_500_to_1000ms + * + * @return int|null + */ + public function getLatency500To1000ms() + { + return $this->container['latency_500_to_1000ms']; + } + + /** + * Sets latency_500_to_1000ms + * + * @param int|null $latency_500_to_1000ms Number of responses from origin with latency between 500 and 1,000 milliseconds. + * + * @return self + */ + public function setLatency500To1000ms($latency_500_to_1000ms) + { + $this->container['latency_500_to_1000ms'] = $latency_500_to_1000ms; + + return $this; + } + + /** + * Gets latency_1000_to_5000ms + * + * @return int|null + */ + public function getLatency1000To5000ms() + { + return $this->container['latency_1000_to_5000ms']; + } + + /** + * Sets latency_1000_to_5000ms + * + * @param int|null $latency_1000_to_5000ms Number of responses from origin with latency between 1,000 and 5,000 milliseconds. + * + * @return self + */ + public function setLatency1000To5000ms($latency_1000_to_5000ms) + { + $this->container['latency_1000_to_5000ms'] = $latency_1000_to_5000ms; + + return $this; + } + + /** + * Gets latency_5000_to_10000ms + * + * @return int|null + */ + public function getLatency5000To10000ms() + { + return $this->container['latency_5000_to_10000ms']; + } + + /** + * Sets latency_5000_to_10000ms + * + * @param int|null $latency_5000_to_10000ms Number of responses from origin with latency between 5,000 and 10,000 milliseconds. + * + * @return self + */ + public function setLatency5000To10000ms($latency_5000_to_10000ms) + { + $this->container['latency_5000_to_10000ms'] = $latency_5000_to_10000ms; + + return $this; + } + + /** + * Gets latency_10000_to_60000ms + * + * @return int|null + */ + public function getLatency10000To60000ms() + { + return $this->container['latency_10000_to_60000ms']; + } + + /** + * Sets latency_10000_to_60000ms + * + * @param int|null $latency_10000_to_60000ms Number of responses from origin with latency between 10,000 and 60,000 milliseconds. + * + * @return self + */ + public function setLatency10000To60000ms($latency_10000_to_60000ms) + { + $this->container['latency_10000_to_60000ms'] = $latency_10000_to_60000ms; + + return $this; + } + + /** + * Gets latency_60000ms + * + * @return int|null + */ + public function getLatency60000ms() + { + return $this->container['latency_60000ms']; + } + + /** + * Sets latency_60000ms + * + * @param int|null $latency_60000ms Number of responses from origin with latency of 60,000 milliseconds and above. + * + * @return self + */ + public function setLatency60000ms($latency_60000ms) + { + $this->container['latency_60000ms'] = $latency_60000ms; + + return $this; + } + + /** + * Gets waf_responses + * + * @return int|null + */ + public function getWafResponses() + { + return $this->container['waf_responses']; + } + + /** + * Sets waf_responses + * + * @param int|null $waf_responses Number of responses received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafResponses($waf_responses) + { + $this->container['waf_responses'] = $waf_responses; + + return $this; + } + + /** + * Gets waf_resp_header_bytes + * + * @return int|null + */ + public function getWafRespHeaderBytes() + { + return $this->container['waf_resp_header_bytes']; + } + + /** + * Sets waf_resp_header_bytes + * + * @param int|null $waf_resp_header_bytes Number of header bytes received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafRespHeaderBytes($waf_resp_header_bytes) + { + $this->container['waf_resp_header_bytes'] = $waf_resp_header_bytes; + + return $this; + } + + /** + * Gets waf_resp_body_bytes + * + * @return int|null + */ + public function getWafRespBodyBytes() + { + return $this->container['waf_resp_body_bytes']; + } + + /** + * Sets waf_resp_body_bytes + * + * @param int|null $waf_resp_body_bytes Number of body bytes received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafRespBodyBytes($waf_resp_body_bytes) + { + $this->container['waf_resp_body_bytes'] = $waf_resp_body_bytes; + + return $this; + } + + /** + * Gets waf_status_1xx + * + * @return int|null + */ + public function getWafStatus1xx() + { + return $this->container['waf_status_1xx']; + } + + /** + * Sets waf_status_1xx + * + * @param int|null $waf_status_1xx Number of 1xx \"Informational\" status codes received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafStatus1xx($waf_status_1xx) + { + $this->container['waf_status_1xx'] = $waf_status_1xx; + + return $this; + } + + /** + * Gets waf_status_2xx + * + * @return int|null + */ + public function getWafStatus2xx() + { + return $this->container['waf_status_2xx']; + } + + /** + * Sets waf_status_2xx + * + * @param int|null $waf_status_2xx Number of 2xx \"Success\" status codes received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafStatus2xx($waf_status_2xx) + { + $this->container['waf_status_2xx'] = $waf_status_2xx; + + return $this; + } + + /** + * Gets waf_status_3xx + * + * @return int|null + */ + public function getWafStatus3xx() + { + return $this->container['waf_status_3xx']; + } + + /** + * Sets waf_status_3xx + * + * @param int|null $waf_status_3xx Number of 3xx \"Redirection\" codes received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafStatus3xx($waf_status_3xx) + { + $this->container['waf_status_3xx'] = $waf_status_3xx; + + return $this; + } + + /** + * Gets waf_status_4xx + * + * @return int|null + */ + public function getWafStatus4xx() + { + return $this->container['waf_status_4xx']; + } + + /** + * Sets waf_status_4xx + * + * @param int|null $waf_status_4xx Number of 4xx \"Client Error\" codes received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafStatus4xx($waf_status_4xx) + { + $this->container['waf_status_4xx'] = $waf_status_4xx; + + return $this; + } + + /** + * Gets waf_status_5xx + * + * @return int|null + */ + public function getWafStatus5xx() + { + return $this->container['waf_status_5xx']; + } + + /** + * Sets waf_status_5xx + * + * @param int|null $waf_status_5xx Number of 5xx \"Server Error\" codes received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafStatus5xx($waf_status_5xx) + { + $this->container['waf_status_5xx'] = $waf_status_5xx; + + return $this; + } + + /** + * Gets waf_status_200 + * + * @return int|null + */ + public function getWafStatus200() + { + return $this->container['waf_status_200']; + } + + /** + * Sets waf_status_200 + * + * @param int|null $waf_status_200 Number of responses received with status code 200 (Success) received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafStatus200($waf_status_200) + { + $this->container['waf_status_200'] = $waf_status_200; + + return $this; + } + + /** + * Gets waf_status_204 + * + * @return int|null + */ + public function getWafStatus204() + { + return $this->container['waf_status_204']; + } + + /** + * Sets waf_status_204 + * + * @param int|null $waf_status_204 Number of responses received with status code 204 (No Content) received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafStatus204($waf_status_204) + { + $this->container['waf_status_204'] = $waf_status_204; + + return $this; + } + + /** + * Gets waf_status_206 + * + * @return int|null + */ + public function getWafStatus206() + { + return $this->container['waf_status_206']; + } + + /** + * Sets waf_status_206 + * + * @param int|null $waf_status_206 Number of responses received with status code 206 (Partial Content) received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafStatus206($waf_status_206) + { + $this->container['waf_status_206'] = $waf_status_206; + + return $this; + } + + /** + * Gets waf_status_301 + * + * @return int|null + */ + public function getWafStatus301() + { + return $this->container['waf_status_301']; + } + + /** + * Sets waf_status_301 + * + * @param int|null $waf_status_301 Number of responses received with status code 301 (Moved Permanently) received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafStatus301($waf_status_301) + { + $this->container['waf_status_301'] = $waf_status_301; + + return $this; + } + + /** + * Gets waf_status_302 + * + * @return int|null + */ + public function getWafStatus302() + { + return $this->container['waf_status_302']; + } + + /** + * Sets waf_status_302 + * + * @param int|null $waf_status_302 Number of responses received with status code 302 (Found) received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafStatus302($waf_status_302) + { + $this->container['waf_status_302'] = $waf_status_302; + + return $this; + } + + /** + * Gets waf_status_304 + * + * @return int|null + */ + public function getWafStatus304() + { + return $this->container['waf_status_304']; + } + + /** + * Sets waf_status_304 + * + * @param int|null $waf_status_304 Number of responses received with status code 304 (Not Modified) received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafStatus304($waf_status_304) + { + $this->container['waf_status_304'] = $waf_status_304; + + return $this; + } + + /** + * Gets waf_status_400 + * + * @return int|null + */ + public function getWafStatus400() + { + return $this->container['waf_status_400']; + } + + /** + * Sets waf_status_400 + * + * @param int|null $waf_status_400 Number of responses received with status code 400 (Bad Request) received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafStatus400($waf_status_400) + { + $this->container['waf_status_400'] = $waf_status_400; + + return $this; + } + + /** + * Gets waf_status_401 + * + * @return int|null + */ + public function getWafStatus401() + { + return $this->container['waf_status_401']; + } + + /** + * Sets waf_status_401 + * + * @param int|null $waf_status_401 Number of responses received with status code 401 (Unauthorized) received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafStatus401($waf_status_401) + { + $this->container['waf_status_401'] = $waf_status_401; + + return $this; + } + + /** + * Gets waf_status_403 + * + * @return int|null + */ + public function getWafStatus403() + { + return $this->container['waf_status_403']; + } + + /** + * Sets waf_status_403 + * + * @param int|null $waf_status_403 Number of responses received with status code 403 (Forbidden) received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafStatus403($waf_status_403) + { + $this->container['waf_status_403'] = $waf_status_403; + + return $this; + } + + /** + * Gets waf_status_404 + * + * @return int|null + */ + public function getWafStatus404() + { + return $this->container['waf_status_404']; + } + + /** + * Sets waf_status_404 + * + * @param int|null $waf_status_404 Number of responses received with status code 404 (Not Found) received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafStatus404($waf_status_404) + { + $this->container['waf_status_404'] = $waf_status_404; + + return $this; + } + + /** + * Gets waf_status_416 + * + * @return int|null + */ + public function getWafStatus416() + { + return $this->container['waf_status_416']; + } + + /** + * Sets waf_status_416 + * + * @param int|null $waf_status_416 Number of responses received with status code 416 (Range Not Satisfiable) received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafStatus416($waf_status_416) + { + $this->container['waf_status_416'] = $waf_status_416; + + return $this; + } + + /** + * Gets waf_status_429 + * + * @return int|null + */ + public function getWafStatus429() + { + return $this->container['waf_status_429']; + } + + /** + * Sets waf_status_429 + * + * @param int|null $waf_status_429 Number of responses received with status code 429 (Too Many Requests) received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafStatus429($waf_status_429) + { + $this->container['waf_status_429'] = $waf_status_429; + + return $this; + } + + /** + * Gets waf_status_500 + * + * @return int|null + */ + public function getWafStatus500() + { + return $this->container['waf_status_500']; + } + + /** + * Sets waf_status_500 + * + * @param int|null $waf_status_500 Number of responses received with status code 500 (Internal Server Error) received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafStatus500($waf_status_500) + { + $this->container['waf_status_500'] = $waf_status_500; + + return $this; + } + + /** + * Gets waf_status_501 + * + * @return int|null + */ + public function getWafStatus501() + { + return $this->container['waf_status_501']; + } + + /** + * Sets waf_status_501 + * + * @param int|null $waf_status_501 Number of responses received with status code 501 (Not Implemented) received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafStatus501($waf_status_501) + { + $this->container['waf_status_501'] = $waf_status_501; + + return $this; + } + + /** + * Gets waf_status_502 + * + * @return int|null + */ + public function getWafStatus502() + { + return $this->container['waf_status_502']; + } + + /** + * Sets waf_status_502 + * + * @param int|null $waf_status_502 Number of responses received with status code 502 (Bad Gateway) received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafStatus502($waf_status_502) + { + $this->container['waf_status_502'] = $waf_status_502; + + return $this; + } + + /** + * Gets waf_status_503 + * + * @return int|null + */ + public function getWafStatus503() + { + return $this->container['waf_status_503']; + } + + /** + * Sets waf_status_503 + * + * @param int|null $waf_status_503 Number of responses received with status code 503 (Service Unavailable) received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafStatus503($waf_status_503) + { + $this->container['waf_status_503'] = $waf_status_503; + + return $this; + } + + /** + * Gets waf_status_504 + * + * @return int|null + */ + public function getWafStatus504() + { + return $this->container['waf_status_504']; + } + + /** + * Sets waf_status_504 + * + * @param int|null $waf_status_504 Number of responses received with status code 504 (Gateway Timeout) received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafStatus504($waf_status_504) + { + $this->container['waf_status_504'] = $waf_status_504; + + return $this; + } + + /** + * Gets waf_status_505 + * + * @return int|null + */ + public function getWafStatus505() + { + return $this->container['waf_status_505']; + } + + /** + * Sets waf_status_505 + * + * @param int|null $waf_status_505 Number of responses received with status code 505 (HTTP Version Not Supported) received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafStatus505($waf_status_505) + { + $this->container['waf_status_505'] = $waf_status_505; + + return $this; + } + + /** + * Gets waf_latency_0_to_1ms + * + * @return int|null + */ + public function getWafLatency0To1ms() + { + return $this->container['waf_latency_0_to_1ms']; + } + + /** + * Sets waf_latency_0_to_1ms + * + * @param int|null $waf_latency_0_to_1ms Number of responses with latency between 0 and 1 millisecond received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafLatency0To1ms($waf_latency_0_to_1ms) + { + $this->container['waf_latency_0_to_1ms'] = $waf_latency_0_to_1ms; + + return $this; + } + + /** + * Gets waf_latency_1_to_5ms + * + * @return int|null + */ + public function getWafLatency1To5ms() + { + return $this->container['waf_latency_1_to_5ms']; + } + + /** + * Sets waf_latency_1_to_5ms + * + * @param int|null $waf_latency_1_to_5ms Number of responses with latency between 1 and 5 milliseconds received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafLatency1To5ms($waf_latency_1_to_5ms) + { + $this->container['waf_latency_1_to_5ms'] = $waf_latency_1_to_5ms; + + return $this; + } + + /** + * Gets waf_latency_5_to_10ms + * + * @return int|null + */ + public function getWafLatency5To10ms() + { + return $this->container['waf_latency_5_to_10ms']; + } + + /** + * Sets waf_latency_5_to_10ms + * + * @param int|null $waf_latency_5_to_10ms Number of responses with latency between 5 and 10 milliseconds received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafLatency5To10ms($waf_latency_5_to_10ms) + { + $this->container['waf_latency_5_to_10ms'] = $waf_latency_5_to_10ms; + + return $this; + } + + /** + * Gets waf_latency_10_to_50ms + * + * @return int|null + */ + public function getWafLatency10To50ms() + { + return $this->container['waf_latency_10_to_50ms']; + } + + /** + * Sets waf_latency_10_to_50ms + * + * @param int|null $waf_latency_10_to_50ms Number of responses with latency between 10 and 50 milliseconds received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafLatency10To50ms($waf_latency_10_to_50ms) + { + $this->container['waf_latency_10_to_50ms'] = $waf_latency_10_to_50ms; + + return $this; + } + + /** + * Gets waf_latency_50_to_100ms + * + * @return int|null + */ + public function getWafLatency50To100ms() + { + return $this->container['waf_latency_50_to_100ms']; + } + + /** + * Sets waf_latency_50_to_100ms + * + * @param int|null $waf_latency_50_to_100ms Number of responses with latency between 50 and 100 milliseconds received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafLatency50To100ms($waf_latency_50_to_100ms) + { + $this->container['waf_latency_50_to_100ms'] = $waf_latency_50_to_100ms; + + return $this; + } + + /** + * Gets waf_latency_100_to_250ms + * + * @return int|null + */ + public function getWafLatency100To250ms() + { + return $this->container['waf_latency_100_to_250ms']; + } + + /** + * Sets waf_latency_100_to_250ms + * + * @param int|null $waf_latency_100_to_250ms Number of responses with latency between 100 and 250 milliseconds received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafLatency100To250ms($waf_latency_100_to_250ms) + { + $this->container['waf_latency_100_to_250ms'] = $waf_latency_100_to_250ms; + + return $this; + } + + /** + * Gets waf_latency_250_to_500ms + * + * @return int|null + */ + public function getWafLatency250To500ms() + { + return $this->container['waf_latency_250_to_500ms']; + } + + /** + * Sets waf_latency_250_to_500ms + * + * @param int|null $waf_latency_250_to_500ms Number of responses with latency between 250 and 500 milliseconds received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafLatency250To500ms($waf_latency_250_to_500ms) + { + $this->container['waf_latency_250_to_500ms'] = $waf_latency_250_to_500ms; + + return $this; + } + + /** + * Gets waf_latency_500_to_1000ms + * + * @return int|null + */ + public function getWafLatency500To1000ms() + { + return $this->container['waf_latency_500_to_1000ms']; + } + + /** + * Sets waf_latency_500_to_1000ms + * + * @param int|null $waf_latency_500_to_1000ms Number of responses with latency between 500 and 1,000 milliseconds received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafLatency500To1000ms($waf_latency_500_to_1000ms) + { + $this->container['waf_latency_500_to_1000ms'] = $waf_latency_500_to_1000ms; + + return $this; + } + + /** + * Gets waf_latency_1000_to_5000ms + * + * @return int|null + */ + public function getWafLatency1000To5000ms() + { + return $this->container['waf_latency_1000_to_5000ms']; + } + + /** + * Sets waf_latency_1000_to_5000ms + * + * @param int|null $waf_latency_1000_to_5000ms Number of responses with latency between 1,000 and 5,000 milliseconds received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafLatency1000To5000ms($waf_latency_1000_to_5000ms) + { + $this->container['waf_latency_1000_to_5000ms'] = $waf_latency_1000_to_5000ms; + + return $this; + } + + /** + * Gets waf_latency_5000_to_10000ms + * + * @return int|null + */ + public function getWafLatency5000To10000ms() + { + return $this->container['waf_latency_5000_to_10000ms']; + } + + /** + * Sets waf_latency_5000_to_10000ms + * + * @param int|null $waf_latency_5000_to_10000ms Number of responses with latency between 5,000 and 10,000 milliseconds received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafLatency5000To10000ms($waf_latency_5000_to_10000ms) + { + $this->container['waf_latency_5000_to_10000ms'] = $waf_latency_5000_to_10000ms; + + return $this; + } + + /** + * Gets waf_latency_10000_to_60000ms + * + * @return int|null + */ + public function getWafLatency10000To60000ms() + { + return $this->container['waf_latency_10000_to_60000ms']; + } + + /** + * Sets waf_latency_10000_to_60000ms + * + * @param int|null $waf_latency_10000_to_60000ms Number of responses with latency between 10,000 and 60,000 milliseconds received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafLatency10000To60000ms($waf_latency_10000_to_60000ms) + { + $this->container['waf_latency_10000_to_60000ms'] = $waf_latency_10000_to_60000ms; + + return $this; + } + + /** + * Gets waf_latency_60000ms + * + * @return int|null + */ + public function getWafLatency60000ms() + { + return $this->container['waf_latency_60000ms']; + } + + /** + * Sets waf_latency_60000ms + * + * @param int|null $waf_latency_60000ms Number of responses with latency of 60,000 milliseconds and above received for origin requests made by the Fastly WAF. + * + * @return self + */ + public function setWafLatency60000ms($waf_latency_60000ms) + { + $this->container['waf_latency_60000ms'] = $waf_latency_60000ms; + + return $this; + } + + /** + * Gets compute_responses + * + * @return int|null + */ + public function getComputeResponses() + { + return $this->container['compute_responses']; + } + + /** + * Sets compute_responses + * + * @param int|null $compute_responses Number of responses for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeResponses($compute_responses) + { + $this->container['compute_responses'] = $compute_responses; + + return $this; + } + + /** + * Gets compute_resp_header_bytes + * + * @return int|null + */ + public function getComputeRespHeaderBytes() + { + return $this->container['compute_resp_header_bytes']; + } + + /** + * Sets compute_resp_header_bytes + * + * @param int|null $compute_resp_header_bytes Number of header bytes for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeRespHeaderBytes($compute_resp_header_bytes) + { + $this->container['compute_resp_header_bytes'] = $compute_resp_header_bytes; + + return $this; + } + + /** + * Gets compute_resp_body_bytes + * + * @return int|null + */ + public function getComputeRespBodyBytes() + { + return $this->container['compute_resp_body_bytes']; + } + + /** + * Sets compute_resp_body_bytes + * + * @param int|null $compute_resp_body_bytes Number of body bytes for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeRespBodyBytes($compute_resp_body_bytes) + { + $this->container['compute_resp_body_bytes'] = $compute_resp_body_bytes; + + return $this; + } + + /** + * Gets compute_status_1xx + * + * @return int|null + */ + public function getComputeStatus1xx() + { + return $this->container['compute_status_1xx']; + } + + /** + * Sets compute_status_1xx + * + * @param int|null $compute_status_1xx Number of 1xx \"Informational\" status codes for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeStatus1xx($compute_status_1xx) + { + $this->container['compute_status_1xx'] = $compute_status_1xx; + + return $this; + } + + /** + * Gets compute_status_2xx + * + * @return int|null + */ + public function getComputeStatus2xx() + { + return $this->container['compute_status_2xx']; + } + + /** + * Sets compute_status_2xx + * + * @param int|null $compute_status_2xx Number of 2xx \"Success\" status codes for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeStatus2xx($compute_status_2xx) + { + $this->container['compute_status_2xx'] = $compute_status_2xx; + + return $this; + } + + /** + * Gets compute_status_3xx + * + * @return int|null + */ + public function getComputeStatus3xx() + { + return $this->container['compute_status_3xx']; + } + + /** + * Sets compute_status_3xx + * + * @param int|null $compute_status_3xx Number of 3xx \"Redirection\" codes for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeStatus3xx($compute_status_3xx) + { + $this->container['compute_status_3xx'] = $compute_status_3xx; + + return $this; + } + + /** + * Gets compute_status_4xx + * + * @return int|null + */ + public function getComputeStatus4xx() + { + return $this->container['compute_status_4xx']; + } + + /** + * Sets compute_status_4xx + * + * @param int|null $compute_status_4xx Number of 4xx \"Client Error\" codes for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeStatus4xx($compute_status_4xx) + { + $this->container['compute_status_4xx'] = $compute_status_4xx; + + return $this; + } + + /** + * Gets compute_status_5xx + * + * @return int|null + */ + public function getComputeStatus5xx() + { + return $this->container['compute_status_5xx']; + } + + /** + * Sets compute_status_5xx + * + * @param int|null $compute_status_5xx Number of 5xx \"Server Error\" codes for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeStatus5xx($compute_status_5xx) + { + $this->container['compute_status_5xx'] = $compute_status_5xx; + + return $this; + } + + /** + * Gets compute_status_200 + * + * @return int|null + */ + public function getComputeStatus200() + { + return $this->container['compute_status_200']; + } + + /** + * Sets compute_status_200 + * + * @param int|null $compute_status_200 Number of responses received with status code 200 (Success) for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeStatus200($compute_status_200) + { + $this->container['compute_status_200'] = $compute_status_200; + + return $this; + } + + /** + * Gets compute_status_204 + * + * @return int|null + */ + public function getComputeStatus204() + { + return $this->container['compute_status_204']; + } + + /** + * Sets compute_status_204 + * + * @param int|null $compute_status_204 Number of responses received with status code 204 (No Content) for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeStatus204($compute_status_204) + { + $this->container['compute_status_204'] = $compute_status_204; + + return $this; + } + + /** + * Gets compute_status_206 + * + * @return int|null + */ + public function getComputeStatus206() + { + return $this->container['compute_status_206']; + } + + /** + * Sets compute_status_206 + * + * @param int|null $compute_status_206 Number of responses received with status code 206 (Partial Content) for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeStatus206($compute_status_206) + { + $this->container['compute_status_206'] = $compute_status_206; + + return $this; + } + + /** + * Gets compute_status_301 + * + * @return int|null + */ + public function getComputeStatus301() + { + return $this->container['compute_status_301']; + } + + /** + * Sets compute_status_301 + * + * @param int|null $compute_status_301 Number of responses received with status code 301 (Moved Permanently) for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeStatus301($compute_status_301) + { + $this->container['compute_status_301'] = $compute_status_301; + + return $this; + } + + /** + * Gets compute_status_302 + * + * @return int|null + */ + public function getComputeStatus302() + { + return $this->container['compute_status_302']; + } + + /** + * Sets compute_status_302 + * + * @param int|null $compute_status_302 Number of responses received with status code 302 (Found) for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeStatus302($compute_status_302) + { + $this->container['compute_status_302'] = $compute_status_302; + + return $this; + } + + /** + * Gets compute_status_304 + * + * @return int|null + */ + public function getComputeStatus304() + { + return $this->container['compute_status_304']; + } + + /** + * Sets compute_status_304 + * + * @param int|null $compute_status_304 Number of responses received with status code 304 (Not Modified) for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeStatus304($compute_status_304) + { + $this->container['compute_status_304'] = $compute_status_304; + + return $this; + } + + /** + * Gets compute_status_400 + * + * @return int|null + */ + public function getComputeStatus400() + { + return $this->container['compute_status_400']; + } + + /** + * Sets compute_status_400 + * + * @param int|null $compute_status_400 Number of responses received with status code 400 (Bad Request) for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeStatus400($compute_status_400) + { + $this->container['compute_status_400'] = $compute_status_400; + + return $this; + } + + /** + * Gets compute_status_401 + * + * @return int|null + */ + public function getComputeStatus401() + { + return $this->container['compute_status_401']; + } + + /** + * Sets compute_status_401 + * + * @param int|null $compute_status_401 Number of responses received with status code 401 (Unauthorized) for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeStatus401($compute_status_401) + { + $this->container['compute_status_401'] = $compute_status_401; + + return $this; + } + + /** + * Gets compute_status_403 + * + * @return int|null + */ + public function getComputeStatus403() + { + return $this->container['compute_status_403']; + } + + /** + * Sets compute_status_403 + * + * @param int|null $compute_status_403 Number of responses received with status code 403 (Forbidden) for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeStatus403($compute_status_403) + { + $this->container['compute_status_403'] = $compute_status_403; + + return $this; + } + + /** + * Gets compute_status_404 + * + * @return int|null + */ + public function getComputeStatus404() + { + return $this->container['compute_status_404']; + } + + /** + * Sets compute_status_404 + * + * @param int|null $compute_status_404 Number of responses received with status code 404 (Not Found) for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeStatus404($compute_status_404) + { + $this->container['compute_status_404'] = $compute_status_404; + + return $this; + } + + /** + * Gets compute_status_416 + * + * @return int|null + */ + public function getComputeStatus416() + { + return $this->container['compute_status_416']; + } + + /** + * Sets compute_status_416 + * + * @param int|null $compute_status_416 Number of responses received with status code 416 (Range Not Satisfiable) for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeStatus416($compute_status_416) + { + $this->container['compute_status_416'] = $compute_status_416; + + return $this; + } + + /** + * Gets compute_status_429 + * + * @return int|null + */ + public function getComputeStatus429() + { + return $this->container['compute_status_429']; + } + + /** + * Sets compute_status_429 + * + * @param int|null $compute_status_429 Number of responses received with status code 429 (Too Many Requests) for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeStatus429($compute_status_429) + { + $this->container['compute_status_429'] = $compute_status_429; + + return $this; + } + + /** + * Gets compute_status_500 + * + * @return int|null + */ + public function getComputeStatus500() + { + return $this->container['compute_status_500']; + } + + /** + * Sets compute_status_500 + * + * @param int|null $compute_status_500 Number of responses received with status code 500 (Internal Server Error) for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeStatus500($compute_status_500) + { + $this->container['compute_status_500'] = $compute_status_500; + + return $this; + } + + /** + * Gets compute_status_501 + * + * @return int|null + */ + public function getComputeStatus501() + { + return $this->container['compute_status_501']; + } + + /** + * Sets compute_status_501 + * + * @param int|null $compute_status_501 Number of responses received with status code 501 (Not Implemented) for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeStatus501($compute_status_501) + { + $this->container['compute_status_501'] = $compute_status_501; + + return $this; + } + + /** + * Gets compute_status_502 + * + * @return int|null + */ + public function getComputeStatus502() + { + return $this->container['compute_status_502']; + } + + /** + * Sets compute_status_502 + * + * @param int|null $compute_status_502 Number of responses received with status code 502 (Bad Gateway) for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeStatus502($compute_status_502) + { + $this->container['compute_status_502'] = $compute_status_502; + + return $this; + } + + /** + * Gets compute_status_503 + * + * @return int|null + */ + public function getComputeStatus503() + { + return $this->container['compute_status_503']; + } + + /** + * Sets compute_status_503 + * + * @param int|null $compute_status_503 Number of responses received with status code 503 (Service Unavailable) for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeStatus503($compute_status_503) + { + $this->container['compute_status_503'] = $compute_status_503; + + return $this; + } + + /** + * Gets compute_status_504 + * + * @return int|null + */ + public function getComputeStatus504() + { + return $this->container['compute_status_504']; + } + + /** + * Sets compute_status_504 + * + * @param int|null $compute_status_504 Number of responses received with status code 504 (Gateway Timeout) for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeStatus504($compute_status_504) + { + $this->container['compute_status_504'] = $compute_status_504; + + return $this; + } + + /** + * Gets compute_status_505 + * + * @return int|null + */ + public function getComputeStatus505() + { + return $this->container['compute_status_505']; + } + + /** + * Sets compute_status_505 + * + * @param int|null $compute_status_505 Number of responses received with status code 505 (HTTP Version Not Supported) for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeStatus505($compute_status_505) + { + $this->container['compute_status_505'] = $compute_status_505; + + return $this; + } + + /** + * Gets compute_latency_0_to_1ms + * + * @return int|null + */ + public function getComputeLatency0To1ms() + { + return $this->container['compute_latency_0_to_1ms']; + } + + /** + * Sets compute_latency_0_to_1ms + * + * @param int|null $compute_latency_0_to_1ms Number of responses with latency between 0 and 1 millisecond for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeLatency0To1ms($compute_latency_0_to_1ms) + { + $this->container['compute_latency_0_to_1ms'] = $compute_latency_0_to_1ms; + + return $this; + } + + /** + * Gets compute_latency_1_to_5ms + * + * @return int|null + */ + public function getComputeLatency1To5ms() + { + return $this->container['compute_latency_1_to_5ms']; + } + + /** + * Sets compute_latency_1_to_5ms + * + * @param int|null $compute_latency_1_to_5ms Number of responses with latency between 1 and 5 milliseconds for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeLatency1To5ms($compute_latency_1_to_5ms) + { + $this->container['compute_latency_1_to_5ms'] = $compute_latency_1_to_5ms; + + return $this; + } + + /** + * Gets compute_latency_5_to_10ms + * + * @return int|null + */ + public function getComputeLatency5To10ms() + { + return $this->container['compute_latency_5_to_10ms']; + } + + /** + * Sets compute_latency_5_to_10ms + * + * @param int|null $compute_latency_5_to_10ms Number of responses with latency between 5 and 10 milliseconds for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeLatency5To10ms($compute_latency_5_to_10ms) + { + $this->container['compute_latency_5_to_10ms'] = $compute_latency_5_to_10ms; + + return $this; + } + + /** + * Gets compute_latency_10_to_50ms + * + * @return int|null + */ + public function getComputeLatency10To50ms() + { + return $this->container['compute_latency_10_to_50ms']; + } + + /** + * Sets compute_latency_10_to_50ms + * + * @param int|null $compute_latency_10_to_50ms Number of responses with latency between 10 and 50 milliseconds for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeLatency10To50ms($compute_latency_10_to_50ms) + { + $this->container['compute_latency_10_to_50ms'] = $compute_latency_10_to_50ms; + + return $this; + } + + /** + * Gets compute_latency_50_to_100ms + * + * @return int|null + */ + public function getComputeLatency50To100ms() + { + return $this->container['compute_latency_50_to_100ms']; + } + + /** + * Sets compute_latency_50_to_100ms + * + * @param int|null $compute_latency_50_to_100ms Number of responses with latency between 50 and 100 milliseconds for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeLatency50To100ms($compute_latency_50_to_100ms) + { + $this->container['compute_latency_50_to_100ms'] = $compute_latency_50_to_100ms; + + return $this; + } + + /** + * Gets compute_latency_100_to_250ms + * + * @return int|null + */ + public function getComputeLatency100To250ms() + { + return $this->container['compute_latency_100_to_250ms']; + } + + /** + * Sets compute_latency_100_to_250ms + * + * @param int|null $compute_latency_100_to_250ms Number of responses with latency between 100 and 250 milliseconds for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeLatency100To250ms($compute_latency_100_to_250ms) + { + $this->container['compute_latency_100_to_250ms'] = $compute_latency_100_to_250ms; + + return $this; + } + + /** + * Gets compute_latency_250_to_500ms + * + * @return int|null + */ + public function getComputeLatency250To500ms() + { + return $this->container['compute_latency_250_to_500ms']; + } + + /** + * Sets compute_latency_250_to_500ms + * + * @param int|null $compute_latency_250_to_500ms Number of responses with latency between 250 and 500 milliseconds for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeLatency250To500ms($compute_latency_250_to_500ms) + { + $this->container['compute_latency_250_to_500ms'] = $compute_latency_250_to_500ms; + + return $this; + } + + /** + * Gets compute_latency_500_to_1000ms + * + * @return int|null + */ + public function getComputeLatency500To1000ms() + { + return $this->container['compute_latency_500_to_1000ms']; + } + + /** + * Sets compute_latency_500_to_1000ms + * + * @param int|null $compute_latency_500_to_1000ms Number of responses with latency between 500 and 1,000 milliseconds for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeLatency500To1000ms($compute_latency_500_to_1000ms) + { + $this->container['compute_latency_500_to_1000ms'] = $compute_latency_500_to_1000ms; + + return $this; + } + + /** + * Gets compute_latency_1000_to_5000ms + * + * @return int|null + */ + public function getComputeLatency1000To5000ms() + { + return $this->container['compute_latency_1000_to_5000ms']; + } + + /** + * Sets compute_latency_1000_to_5000ms + * + * @param int|null $compute_latency_1000_to_5000ms Number of responses with latency between 1,000 and 5,000 milliseconds for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeLatency1000To5000ms($compute_latency_1000_to_5000ms) + { + $this->container['compute_latency_1000_to_5000ms'] = $compute_latency_1000_to_5000ms; + + return $this; + } + + /** + * Gets compute_latency_5000_to_10000ms + * + * @return int|null + */ + public function getComputeLatency5000To10000ms() + { + return $this->container['compute_latency_5000_to_10000ms']; + } + + /** + * Sets compute_latency_5000_to_10000ms + * + * @param int|null $compute_latency_5000_to_10000ms Number of responses with latency between 5,000 and 10,000 milliseconds for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeLatency5000To10000ms($compute_latency_5000_to_10000ms) + { + $this->container['compute_latency_5000_to_10000ms'] = $compute_latency_5000_to_10000ms; + + return $this; + } + + /** + * Gets compute_latency_10000_to_60000ms + * + * @return int|null + */ + public function getComputeLatency10000To60000ms() + { + return $this->container['compute_latency_10000_to_60000ms']; + } + + /** + * Sets compute_latency_10000_to_60000ms + * + * @param int|null $compute_latency_10000_to_60000ms Number of responses with latency between 10,000 and 60,000 milliseconds for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeLatency10000To60000ms($compute_latency_10000_to_60000ms) + { + $this->container['compute_latency_10000_to_60000ms'] = $compute_latency_10000_to_60000ms; + + return $this; + } + + /** + * Gets compute_latency_60000ms + * + * @return int|null + */ + public function getComputeLatency60000ms() + { + return $this->container['compute_latency_60000ms']; + } + + /** + * Sets compute_latency_60000ms + * + * @param int|null $compute_latency_60000ms Number of responses with latency of 60,000 milliseconds and above for origin received by Compute@Edge. + * + * @return self + */ + public function setComputeLatency60000ms($compute_latency_60000ms) + { + $this->container['compute_latency_60000ms'] = $compute_latency_60000ms; + + return $this; + } + + /** + * Gets all_responses + * + * @return int|null + */ + public function getAllResponses() + { + return $this->container['all_responses']; + } + + /** + * Sets all_responses + * + * @param int|null $all_responses Number of responses received for origin requests made by all sources. + * + * @return self + */ + public function setAllResponses($all_responses) + { + $this->container['all_responses'] = $all_responses; + + return $this; + } + + /** + * Gets all_resp_header_bytes + * + * @return int|null + */ + public function getAllRespHeaderBytes() + { + return $this->container['all_resp_header_bytes']; + } + + /** + * Sets all_resp_header_bytes + * + * @param int|null $all_resp_header_bytes Number of header bytes received for origin requests made by all sources. + * + * @return self + */ + public function setAllRespHeaderBytes($all_resp_header_bytes) + { + $this->container['all_resp_header_bytes'] = $all_resp_header_bytes; + + return $this; + } + + /** + * Gets all_resp_body_bytes + * + * @return int|null + */ + public function getAllRespBodyBytes() + { + return $this->container['all_resp_body_bytes']; + } + + /** + * Sets all_resp_body_bytes + * + * @param int|null $all_resp_body_bytes Number of body bytes received for origin requests made by all sources. + * + * @return self + */ + public function setAllRespBodyBytes($all_resp_body_bytes) + { + $this->container['all_resp_body_bytes'] = $all_resp_body_bytes; + + return $this; + } + + /** + * Gets all_status_1xx + * + * @return int|null + */ + public function getAllStatus1xx() + { + return $this->container['all_status_1xx']; + } + + /** + * Sets all_status_1xx + * + * @param int|null $all_status_1xx Number of 1xx \"Informational\" category status codes delivered received for origin requests made by all sources. + * + * @return self + */ + public function setAllStatus1xx($all_status_1xx) + { + $this->container['all_status_1xx'] = $all_status_1xx; + + return $this; + } + + /** + * Gets all_status_2xx + * + * @return int|null + */ + public function getAllStatus2xx() + { + return $this->container['all_status_2xx']; + } + + /** + * Sets all_status_2xx + * + * @param int|null $all_status_2xx Number of 2xx \"Success\" status codes received for origin requests made by all sources. + * + * @return self + */ + public function setAllStatus2xx($all_status_2xx) + { + $this->container['all_status_2xx'] = $all_status_2xx; + + return $this; + } + + /** + * Gets all_status_3xx + * + * @return int|null + */ + public function getAllStatus3xx() + { + return $this->container['all_status_3xx']; + } + + /** + * Sets all_status_3xx + * + * @param int|null $all_status_3xx Number of 3xx \"Redirection\" codes received for origin requests made by all sources. + * + * @return self + */ + public function setAllStatus3xx($all_status_3xx) + { + $this->container['all_status_3xx'] = $all_status_3xx; + + return $this; + } + + /** + * Gets all_status_4xx + * + * @return int|null + */ + public function getAllStatus4xx() + { + return $this->container['all_status_4xx']; + } + + /** + * Sets all_status_4xx + * + * @param int|null $all_status_4xx Number of 4xx \"Client Error\" codes received for origin requests made by all sources. + * + * @return self + */ + public function setAllStatus4xx($all_status_4xx) + { + $this->container['all_status_4xx'] = $all_status_4xx; + + return $this; + } + + /** + * Gets all_status_5xx + * + * @return int|null + */ + public function getAllStatus5xx() + { + return $this->container['all_status_5xx']; + } + + /** + * Sets all_status_5xx + * + * @param int|null $all_status_5xx Number of 5xx \"Server Error\" codes received for origin requests made by all sources. + * + * @return self + */ + public function setAllStatus5xx($all_status_5xx) + { + $this->container['all_status_5xx'] = $all_status_5xx; + + return $this; + } + + /** + * Gets all_status_200 + * + * @return int|null + */ + public function getAllStatus200() + { + return $this->container['all_status_200']; + } + + /** + * Sets all_status_200 + * + * @param int|null $all_status_200 Number of responses received with status code 200 (Success) received for origin requests made by all sources. + * + * @return self + */ + public function setAllStatus200($all_status_200) + { + $this->container['all_status_200'] = $all_status_200; + + return $this; + } + + /** + * Gets all_status_204 + * + * @return int|null + */ + public function getAllStatus204() + { + return $this->container['all_status_204']; + } + + /** + * Sets all_status_204 + * + * @param int|null $all_status_204 Number of responses received with status code 204 (No Content) received for origin requests made by all sources. + * + * @return self + */ + public function setAllStatus204($all_status_204) + { + $this->container['all_status_204'] = $all_status_204; + + return $this; + } + + /** + * Gets all_status_206 + * + * @return int|null + */ + public function getAllStatus206() + { + return $this->container['all_status_206']; + } + + /** + * Sets all_status_206 + * + * @param int|null $all_status_206 Number of responses received with status code 206 (Partial Content) received for origin requests made by all sources. + * + * @return self + */ + public function setAllStatus206($all_status_206) + { + $this->container['all_status_206'] = $all_status_206; + + return $this; + } + + /** + * Gets all_status_301 + * + * @return int|null + */ + public function getAllStatus301() + { + return $this->container['all_status_301']; + } + + /** + * Sets all_status_301 + * + * @param int|null $all_status_301 Number of responses received with status code 301 (Moved Permanently) received for origin requests made by all sources. + * + * @return self + */ + public function setAllStatus301($all_status_301) + { + $this->container['all_status_301'] = $all_status_301; + + return $this; + } + + /** + * Gets all_status_302 + * + * @return int|null + */ + public function getAllStatus302() + { + return $this->container['all_status_302']; + } + + /** + * Sets all_status_302 + * + * @param int|null $all_status_302 Number of responses received with status code 302 (Found) received for origin requests made by all sources. + * + * @return self + */ + public function setAllStatus302($all_status_302) + { + $this->container['all_status_302'] = $all_status_302; + + return $this; + } + + /** + * Gets all_status_304 + * + * @return int|null + */ + public function getAllStatus304() + { + return $this->container['all_status_304']; + } + + /** + * Sets all_status_304 + * + * @param int|null $all_status_304 Number of responses received with status code 304 (Not Modified) received for origin requests made by all sources. + * + * @return self + */ + public function setAllStatus304($all_status_304) + { + $this->container['all_status_304'] = $all_status_304; + + return $this; + } + + /** + * Gets all_status_400 + * + * @return int|null + */ + public function getAllStatus400() + { + return $this->container['all_status_400']; + } + + /** + * Sets all_status_400 + * + * @param int|null $all_status_400 Number of responses received with status code 400 (Bad Request) received for origin requests made by all sources. + * + * @return self + */ + public function setAllStatus400($all_status_400) + { + $this->container['all_status_400'] = $all_status_400; + + return $this; + } + + /** + * Gets all_status_401 + * + * @return int|null + */ + public function getAllStatus401() + { + return $this->container['all_status_401']; + } + + /** + * Sets all_status_401 + * + * @param int|null $all_status_401 Number of responses received with status code 401 (Unauthorized) received for origin requests made by all sources. + * + * @return self + */ + public function setAllStatus401($all_status_401) + { + $this->container['all_status_401'] = $all_status_401; + + return $this; + } + + /** + * Gets all_status_403 + * + * @return int|null + */ + public function getAllStatus403() + { + return $this->container['all_status_403']; + } + + /** + * Sets all_status_403 + * + * @param int|null $all_status_403 Number of responses received with status code 403 (Forbidden) received for origin requests made by all sources. + * + * @return self + */ + public function setAllStatus403($all_status_403) + { + $this->container['all_status_403'] = $all_status_403; + + return $this; + } + + /** + * Gets all_status_404 + * + * @return int|null + */ + public function getAllStatus404() + { + return $this->container['all_status_404']; + } + + /** + * Sets all_status_404 + * + * @param int|null $all_status_404 Number of responses received with status code 404 (Not Found) received for origin requests made by all sources. + * + * @return self + */ + public function setAllStatus404($all_status_404) + { + $this->container['all_status_404'] = $all_status_404; + + return $this; + } + + /** + * Gets all_status_416 + * + * @return int|null + */ + public function getAllStatus416() + { + return $this->container['all_status_416']; + } + + /** + * Sets all_status_416 + * + * @param int|null $all_status_416 Number of responses received with status code 416 (Range Not Satisfiable) received for origin requests made by all sources. + * + * @return self + */ + public function setAllStatus416($all_status_416) + { + $this->container['all_status_416'] = $all_status_416; + + return $this; + } + + /** + * Gets all_status_429 + * + * @return int|null + */ + public function getAllStatus429() + { + return $this->container['all_status_429']; + } + + /** + * Sets all_status_429 + * + * @param int|null $all_status_429 Number of responses received with status code 429 (Too Many Requests) received for origin requests made by all sources. + * + * @return self + */ + public function setAllStatus429($all_status_429) + { + $this->container['all_status_429'] = $all_status_429; + + return $this; + } + + /** + * Gets all_status_500 + * + * @return int|null + */ + public function getAllStatus500() + { + return $this->container['all_status_500']; + } + + /** + * Sets all_status_500 + * + * @param int|null $all_status_500 Number of responses received with status code 500 (Internal Server Error) received for origin requests made by all sources. + * + * @return self + */ + public function setAllStatus500($all_status_500) + { + $this->container['all_status_500'] = $all_status_500; + + return $this; + } + + /** + * Gets all_status_501 + * + * @return int|null + */ + public function getAllStatus501() + { + return $this->container['all_status_501']; + } + + /** + * Sets all_status_501 + * + * @param int|null $all_status_501 Number of responses received with status code 501 (Not Implemented) received for origin requests made by all sources. + * + * @return self + */ + public function setAllStatus501($all_status_501) + { + $this->container['all_status_501'] = $all_status_501; + + return $this; + } + + /** + * Gets all_status_502 + * + * @return int|null + */ + public function getAllStatus502() + { + return $this->container['all_status_502']; + } + + /** + * Sets all_status_502 + * + * @param int|null $all_status_502 Number of responses received with status code 502 (Bad Gateway) received for origin requests made by all sources. + * + * @return self + */ + public function setAllStatus502($all_status_502) + { + $this->container['all_status_502'] = $all_status_502; + + return $this; + } + + /** + * Gets all_status_503 + * + * @return int|null + */ + public function getAllStatus503() + { + return $this->container['all_status_503']; + } + + /** + * Sets all_status_503 + * + * @param int|null $all_status_503 Number of responses received with status code 503 (Service Unavailable) received for origin requests made by all sources. + * + * @return self + */ + public function setAllStatus503($all_status_503) + { + $this->container['all_status_503'] = $all_status_503; + + return $this; + } + + /** + * Gets all_status_504 + * + * @return int|null + */ + public function getAllStatus504() + { + return $this->container['all_status_504']; + } + + /** + * Sets all_status_504 + * + * @param int|null $all_status_504 Number of responses received with status code 504 (Gateway Timeout) received for origin requests made by all sources. + * + * @return self + */ + public function setAllStatus504($all_status_504) + { + $this->container['all_status_504'] = $all_status_504; + + return $this; + } + + /** + * Gets all_status_505 + * + * @return int|null + */ + public function getAllStatus505() + { + return $this->container['all_status_505']; + } + + /** + * Sets all_status_505 + * + * @param int|null $all_status_505 Number of responses received with status code 505 (HTTP Version Not Supported) received for origin requests made by all sources. + * + * @return self + */ + public function setAllStatus505($all_status_505) + { + $this->container['all_status_505'] = $all_status_505; + + return $this; + } + + /** + * Gets all_latency_0_to_1ms + * + * @return int|null + */ + public function getAllLatency0To1ms() + { + return $this->container['all_latency_0_to_1ms']; + } + + /** + * Sets all_latency_0_to_1ms + * + * @param int|null $all_latency_0_to_1ms Number of responses with latency between 0 and 1 millisecond received for origin requests made by all sources. + * + * @return self + */ + public function setAllLatency0To1ms($all_latency_0_to_1ms) + { + $this->container['all_latency_0_to_1ms'] = $all_latency_0_to_1ms; + + return $this; + } + + /** + * Gets all_latency_1_to_5ms + * + * @return int|null + */ + public function getAllLatency1To5ms() + { + return $this->container['all_latency_1_to_5ms']; + } + + /** + * Sets all_latency_1_to_5ms + * + * @param int|null $all_latency_1_to_5ms Number of responses with latency between 1 and 5 milliseconds received for origin requests made by all sources. + * + * @return self + */ + public function setAllLatency1To5ms($all_latency_1_to_5ms) + { + $this->container['all_latency_1_to_5ms'] = $all_latency_1_to_5ms; + + return $this; + } + + /** + * Gets all_latency_5_to_10ms + * + * @return int|null + */ + public function getAllLatency5To10ms() + { + return $this->container['all_latency_5_to_10ms']; + } + + /** + * Sets all_latency_5_to_10ms + * + * @param int|null $all_latency_5_to_10ms Number of responses with latency between 5 and 10 milliseconds received for origin requests made by all sources. + * + * @return self + */ + public function setAllLatency5To10ms($all_latency_5_to_10ms) + { + $this->container['all_latency_5_to_10ms'] = $all_latency_5_to_10ms; + + return $this; + } + + /** + * Gets all_latency_10_to_50ms + * + * @return int|null + */ + public function getAllLatency10To50ms() + { + return $this->container['all_latency_10_to_50ms']; + } + + /** + * Sets all_latency_10_to_50ms + * + * @param int|null $all_latency_10_to_50ms Number of responses with latency between 10 and 50 milliseconds received for origin requests made by all sources. + * + * @return self + */ + public function setAllLatency10To50ms($all_latency_10_to_50ms) + { + $this->container['all_latency_10_to_50ms'] = $all_latency_10_to_50ms; + + return $this; + } + + /** + * Gets all_latency_50_to_100ms + * + * @return int|null + */ + public function getAllLatency50To100ms() + { + return $this->container['all_latency_50_to_100ms']; + } + + /** + * Sets all_latency_50_to_100ms + * + * @param int|null $all_latency_50_to_100ms Number of responses with latency between 50 and 100 milliseconds received for origin requests made by all sources. + * + * @return self + */ + public function setAllLatency50To100ms($all_latency_50_to_100ms) + { + $this->container['all_latency_50_to_100ms'] = $all_latency_50_to_100ms; + + return $this; + } + + /** + * Gets all_latency_100_to_250ms + * + * @return int|null + */ + public function getAllLatency100To250ms() + { + return $this->container['all_latency_100_to_250ms']; + } + + /** + * Sets all_latency_100_to_250ms + * + * @param int|null $all_latency_100_to_250ms Number of responses with latency between 100 and 250 milliseconds received for origin requests made by all sources. + * + * @return self + */ + public function setAllLatency100To250ms($all_latency_100_to_250ms) + { + $this->container['all_latency_100_to_250ms'] = $all_latency_100_to_250ms; + + return $this; + } + + /** + * Gets all_latency_250_to_500ms + * + * @return int|null + */ + public function getAllLatency250To500ms() + { + return $this->container['all_latency_250_to_500ms']; + } + + /** + * Sets all_latency_250_to_500ms + * + * @param int|null $all_latency_250_to_500ms Number of responses with latency between 250 and 500 milliseconds received for origin requests made by all sources. + * + * @return self + */ + public function setAllLatency250To500ms($all_latency_250_to_500ms) + { + $this->container['all_latency_250_to_500ms'] = $all_latency_250_to_500ms; + + return $this; + } + + /** + * Gets all_latency_500_to_1000ms + * + * @return int|null + */ + public function getAllLatency500To1000ms() + { + return $this->container['all_latency_500_to_1000ms']; + } + + /** + * Sets all_latency_500_to_1000ms + * + * @param int|null $all_latency_500_to_1000ms Number of responses with latency between 500 and 1,000 milliseconds received for origin requests made by all sources. + * + * @return self + */ + public function setAllLatency500To1000ms($all_latency_500_to_1000ms) + { + $this->container['all_latency_500_to_1000ms'] = $all_latency_500_to_1000ms; + + return $this; + } + + /** + * Gets all_latency_1000_to_5000ms + * + * @return int|null + */ + public function getAllLatency1000To5000ms() + { + return $this->container['all_latency_1000_to_5000ms']; + } + + /** + * Sets all_latency_1000_to_5000ms + * + * @param int|null $all_latency_1000_to_5000ms Number of responses with latency between 1,000 and 5,000 milliseconds received for origin requests made by all sources. + * + * @return self + */ + public function setAllLatency1000To5000ms($all_latency_1000_to_5000ms) + { + $this->container['all_latency_1000_to_5000ms'] = $all_latency_1000_to_5000ms; + + return $this; + } + + /** + * Gets all_latency_5000_to_10000ms + * + * @return int|null + */ + public function getAllLatency5000To10000ms() + { + return $this->container['all_latency_5000_to_10000ms']; + } + + /** + * Sets all_latency_5000_to_10000ms + * + * @param int|null $all_latency_5000_to_10000ms Number of responses with latency between 5,000 and 10,000 milliseconds received for origin requests made by all sources. + * + * @return self + */ + public function setAllLatency5000To10000ms($all_latency_5000_to_10000ms) + { + $this->container['all_latency_5000_to_10000ms'] = $all_latency_5000_to_10000ms; + + return $this; + } + + /** + * Gets all_latency_10000_to_60000ms + * + * @return int|null + */ + public function getAllLatency10000To60000ms() + { + return $this->container['all_latency_10000_to_60000ms']; + } + + /** + * Sets all_latency_10000_to_60000ms + * + * @param int|null $all_latency_10000_to_60000ms Number of responses with latency between 10,000 and 60,000 milliseconds received for origin requests made by all sources. + * + * @return self + */ + public function setAllLatency10000To60000ms($all_latency_10000_to_60000ms) + { + $this->container['all_latency_10000_to_60000ms'] = $all_latency_10000_to_60000ms; + + return $this; + } + + /** + * Gets all_latency_60000ms + * + * @return int|null + */ + public function getAllLatency60000ms() + { + return $this->container['all_latency_60000ms']; + } + + /** + * Sets all_latency_60000ms + * + * @param int|null $all_latency_60000ms Number of responses with latency of 60,000 milliseconds and above received for origin requests made by all sources. + * + * @return self + */ + public function setAllLatency60000ms($all_latency_60000ms) + { + $this->container['all_latency_60000ms'] = $all_latency_60000ms; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/PaginationCursorMeta.php b/lib/Model/PaginationCursorMeta.php new file mode 100644 index 00000000..cd5e5ee4 --- /dev/null +++ b/lib/Model/PaginationCursorMeta.php @@ -0,0 +1,344 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PaginationCursorMeta implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'pagination_cursor_meta'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'next_cursor' => 'string', + 'limit' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'next_cursor' => null, + 'limit' => 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 = [ + 'next_cursor' => 'next_cursor', + 'limit' => 'limit' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'next_cursor' => 'setNextCursor', + 'limit' => 'setLimit' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'next_cursor' => 'getNextCursor', + 'limit' => 'getLimit' + ]; + + /** + * 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['next_cursor'] = $data['next_cursor'] ?? null; + $this->container['limit'] = $data['limit'] ?? 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 next_cursor + * + * @return string|null + */ + public function getNextCursor() + { + return $this->container['next_cursor']; + } + + /** + * Sets next_cursor + * + * @param string|null $next_cursor Cursor for the next page. + * + * @return self + */ + public function setNextCursor($next_cursor) + { + $this->container['next_cursor'] = $next_cursor; + + return $this; + } + + /** + * Gets limit + * + * @return int|null + */ + public function getLimit() + { + return $this->container['limit']; + } + + /** + * Sets limit + * + * @param int|null $limit Maximum number of results returned. + * + * @return self + */ + public function setLimit($limit) + { + $this->container['limit'] = $limit; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/ReadOnlyServiceId.php b/lib/Model/ReadOnlyServiceId.php new file mode 100644 index 00000000..514782ac --- /dev/null +++ b/lib/Model/ReadOnlyServiceId.php @@ -0,0 +1,289 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ReadOnlyServiceId implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'read_only_service_id'; + + /** + * 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) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/ReadOnlyVersion.php b/lib/Model/ReadOnlyVersion.php new file mode 100644 index 00000000..1b321820 --- /dev/null +++ b/lib/Model/ReadOnlyVersion.php @@ -0,0 +1,289 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ReadOnlyVersion implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'read_only_version'; + + /** + * 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) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/RealtimeEntry.php b/lib/Model/RealtimeEntry.php index c668a60f..be9dc41e 100644 --- a/lib/Model/RealtimeEntry.php +++ b/lib/Model/RealtimeEntry.php @@ -54,8 +54,8 @@ class RealtimeEntry implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $fastlyTypes = [ - 'recorded' => 'int', - 'aggregated' => 'RealtimeMeasurements', + 'recorded' => '\Fastly\Model\RealtimeEntryRecorded', + 'aggregated' => '\Fastly\Model\RealtimeEntryAggregated', 'datacenter' => 'array' ]; @@ -215,7 +215,7 @@ public function valid() /** * Gets recorded * - * @return int|null + * @return \Fastly\Model\RealtimeEntryRecorded|null */ public function getRecorded() { @@ -225,7 +225,7 @@ public function getRecorded() /** * Sets recorded * - * @param int|null $recorded The Unix timestamp at which this record's data was generated. + * @param \Fastly\Model\RealtimeEntryRecorded|null $recorded recorded * * @return self */ @@ -239,7 +239,7 @@ public function setRecorded($recorded) /** * Gets aggregated * - * @return RealtimeMeasurements|null + * @return \Fastly\Model\RealtimeEntryAggregated|null */ public function getAggregated() { @@ -249,7 +249,7 @@ public function getAggregated() /** * Sets aggregated * - * @param RealtimeMeasurements|null $aggregated Aggregates [measurements](#measurements-data-model) across all Fastly POPs. + * @param \Fastly\Model\RealtimeEntryAggregated|null $aggregated aggregated * * @return self */ diff --git a/lib/Model/RealtimeEntryAggregated.php b/lib/Model/RealtimeEntryAggregated.php new file mode 100644 index 00000000..d13b8d0f --- /dev/null +++ b/lib/Model/RealtimeEntryAggregated.php @@ -0,0 +1,6829 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RealtimeEntryAggregated implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'realtime_entry_aggregated'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'requests' => 'int', + 'logging' => 'int', + 'log' => 'int', + 'resp_header_bytes' => 'int', + 'header_size' => 'int', + 'resp_body_bytes' => 'int', + 'body_size' => 'int', + 'hits' => 'int', + 'miss' => 'int', + 'pass' => 'int', + 'synth' => 'int', + 'errors' => 'int', + 'hits_time' => 'float', + 'miss_time' => 'float', + 'miss_histogram' => 'array', + 'compute_requests' => 'int', + 'compute_execution_time_ms' => 'float', + 'compute_ram_used' => 'int', + 'compute_request_time_ms' => 'float', + 'compute_request_time_billed_ms' => 'float', + 'shield' => 'int', + 'ipv6' => 'int', + 'imgopto' => 'int', + 'imgopto_shield' => 'int', + 'imgopto_transforms' => 'int', + 'otfp' => 'int', + 'otfp_shield' => 'int', + 'otfp_manifests' => 'int', + 'video' => 'int', + 'pci' => 'int', + 'http2' => 'int', + 'http3' => 'int', + 'restarts' => 'int', + 'req_header_bytes' => 'int', + 'req_body_bytes' => 'int', + 'bereq_header_bytes' => 'int', + 'bereq_body_bytes' => 'int', + 'waf_blocked' => 'int', + 'waf_logged' => 'int', + 'waf_passed' => 'int', + 'attack_req_header_bytes' => 'int', + 'attack_req_body_bytes' => 'int', + 'attack_resp_synth_bytes' => 'int', + 'attack_logged_req_header_bytes' => 'int', + 'attack_logged_req_body_bytes' => 'int', + 'attack_blocked_req_header_bytes' => 'int', + 'attack_blocked_req_body_bytes' => 'int', + 'attack_passed_req_header_bytes' => 'int', + 'attack_passed_req_body_bytes' => 'int', + 'shield_resp_header_bytes' => 'int', + 'shield_resp_body_bytes' => 'int', + 'otfp_resp_header_bytes' => 'int', + 'otfp_resp_body_bytes' => 'int', + 'otfp_shield_resp_header_bytes' => 'int', + 'otfp_shield_resp_body_bytes' => 'int', + 'otfp_shield_time' => 'float', + 'otfp_deliver_time' => 'float', + 'imgopto_resp_header_bytes' => 'int', + 'imgopto_resp_body_bytes' => 'int', + 'imgopto_shield_resp_header_bytes' => 'int', + 'imgopto_shield_resp_body_bytes' => 'int', + 'status_1xx' => 'int', + 'status_2xx' => 'int', + 'status_3xx' => 'int', + 'status_4xx' => 'int', + 'status_5xx' => 'int', + 'status_200' => 'int', + 'status_204' => 'int', + 'status_206' => 'int', + 'status_301' => 'int', + 'status_302' => 'int', + 'status_304' => 'int', + 'status_400' => 'int', + 'status_401' => 'int', + 'status_403' => 'int', + 'status_404' => 'int', + 'status_406' => 'int', + 'status_416' => 'int', + 'status_429' => 'int', + 'status_500' => 'int', + 'status_501' => 'int', + 'status_502' => 'int', + 'status_503' => 'int', + 'status_504' => 'int', + 'status_505' => 'int', + 'uncacheable' => 'int', + 'pass_time' => 'float', + 'tls' => 'int', + 'tls_v10' => 'int', + 'tls_v11' => 'int', + 'tls_v12' => 'int', + 'tls_v13' => 'int', + 'object_size_1k' => 'int', + 'object_size_10k' => 'int', + 'object_size_100k' => 'int', + 'object_size_1m' => 'int', + 'object_size_10m' => 'int', + 'object_size_100m' => 'int', + 'object_size_1g' => 'int', + 'object_size_other' => 'int', + 'recv_sub_time' => 'float', + 'recv_sub_count' => 'int', + 'hash_sub_time' => 'float', + 'hash_sub_count' => 'int', + 'miss_sub_time' => 'float', + 'miss_sub_count' => 'int', + 'fetch_sub_time' => 'float', + 'fetch_sub_count' => 'int', + 'pass_sub_time' => 'float', + 'pass_sub_count' => 'int', + 'pipe_sub_time' => 'float', + 'pipe_sub_count' => 'int', + 'deliver_sub_time' => 'float', + 'deliver_sub_count' => 'int', + 'error_sub_time' => 'float', + 'error_sub_count' => 'int', + 'hit_sub_time' => 'float', + 'hit_sub_count' => 'int', + 'prehash_sub_time' => 'float', + 'prehash_sub_count' => 'int', + 'predeliver_sub_time' => 'float', + 'predeliver_sub_count' => 'int', + 'hit_resp_body_bytes' => 'int', + 'miss_resp_body_bytes' => 'int', + 'pass_resp_body_bytes' => 'int', + 'compute_req_header_bytes' => 'int', + 'compute_req_body_bytes' => 'int', + 'compute_resp_header_bytes' => 'int', + 'compute_resp_body_bytes' => 'int', + 'imgvideo' => 'int', + 'imgvideo_frames' => 'int', + 'imgvideo_resp_header_bytes' => 'int', + 'imgvideo_resp_body_bytes' => 'int', + 'imgvideo_shield' => 'int', + 'imgvideo_shield_frames' => 'int', + 'imgvideo_shield_resp_header_bytes' => 'int', + 'imgvideo_shield_resp_body_bytes' => 'int', + 'log_bytes' => 'int', + 'edge_requests' => 'int', + 'edge_resp_header_bytes' => 'int', + 'edge_resp_body_bytes' => 'int', + 'origin_revalidations' => 'int', + 'origin_fetches' => 'int', + 'origin_fetch_header_bytes' => 'int', + 'origin_fetch_body_bytes' => 'int', + 'origin_fetch_resp_header_bytes' => 'int', + 'origin_fetch_resp_body_bytes' => 'int', + 'shield_revalidations' => 'int', + 'shield_fetches' => 'int', + 'shield_fetch_header_bytes' => 'int', + 'shield_fetch_body_bytes' => 'int', + 'shield_fetch_resp_header_bytes' => 'int', + 'shield_fetch_resp_body_bytes' => 'int', + 'segblock_origin_fetches' => 'int', + 'segblock_shield_fetches' => 'int', + 'compute_resp_status_1xx' => 'int', + 'compute_resp_status_2xx' => 'int', + 'compute_resp_status_3xx' => 'int', + 'compute_resp_status_4xx' => 'int', + 'compute_resp_status_5xx' => 'int', + 'edge_hit_requests' => 'int', + 'edge_miss_requests' => 'int', + 'compute_bereq_header_bytes' => 'int', + 'compute_bereq_body_bytes' => 'int', + 'compute_beresp_header_bytes' => 'int', + 'compute_beresp_body_bytes' => 'int', + 'origin_cache_fetches' => 'int', + 'shield_cache_fetches' => 'int', + 'compute_bereqs' => 'int', + 'compute_bereq_errors' => 'int', + 'compute_resource_limit_exceeded' => 'int', + 'compute_heap_limit_exceeded' => 'int', + 'compute_stack_limit_exceeded' => 'int', + 'compute_globals_limit_exceeded' => 'int', + 'compute_guest_errors' => 'int', + 'compute_runtime_errors' => 'int', + 'edge_hit_resp_body_bytes' => 'int', + 'edge_hit_resp_header_bytes' => 'int', + 'edge_miss_resp_body_bytes' => 'int', + 'edge_miss_resp_header_bytes' => 'int', + 'origin_cache_fetch_resp_body_bytes' => 'int', + 'origin_cache_fetch_resp_header_bytes' => 'int', + 'shield_hit_requests' => 'int', + 'shield_miss_requests' => 'int', + 'shield_hit_resp_header_bytes' => 'int', + 'shield_hit_resp_body_bytes' => 'int', + 'shield_miss_resp_header_bytes' => 'int', + 'shield_miss_resp_body_bytes' => 'int', + 'websocket_req_header_bytes' => 'int', + 'websocket_req_body_bytes' => 'int', + 'websocket_resp_header_bytes' => 'int', + 'websocket_bereq_header_bytes' => 'int', + 'websocket_bereq_body_bytes' => 'int', + 'websocket_beresp_header_bytes' => 'int', + 'websocket_beresp_body_bytes' => 'int', + 'websocket_conn_time_ms' => 'int', + 'websocket_resp_body_bytes' => 'int', + 'fanout_recv_publishes' => 'int', + 'fanout_send_publishes' => 'int', + 'kv_store_class_a_operations' => 'int', + 'kv_store_class_b_operations' => 'int', + 'object_store_class_a_operations' => 'int', + 'object_store_class_b_operations' => 'int', + 'fanout_req_header_bytes' => 'int', + 'fanout_req_body_bytes' => 'int', + 'fanout_resp_header_bytes' => 'int', + 'fanout_resp_body_bytes' => 'int', + 'fanout_bereq_header_bytes' => 'int', + 'fanout_bereq_body_bytes' => 'int', + 'fanout_beresp_header_bytes' => 'int', + 'fanout_beresp_body_bytes' => 'int', + 'fanout_conn_time_ms' => 'int', + 'ddos_action_limit_streams_connections' => 'int', + 'ddos_action_limit_streams_requests' => 'int', + 'ddos_action_tarpit_accept' => 'int', + 'ddos_action_tarpit' => 'int', + 'ddos_action_close' => 'int', + 'ddos_action_blackhole' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'requests' => null, + 'logging' => null, + 'log' => null, + 'resp_header_bytes' => null, + 'header_size' => null, + 'resp_body_bytes' => null, + 'body_size' => null, + 'hits' => null, + 'miss' => null, + 'pass' => null, + 'synth' => null, + 'errors' => null, + 'hits_time' => null, + 'miss_time' => null, + 'miss_histogram' => null, + 'compute_requests' => null, + 'compute_execution_time_ms' => null, + 'compute_ram_used' => null, + 'compute_request_time_ms' => null, + 'compute_request_time_billed_ms' => null, + 'shield' => null, + 'ipv6' => null, + 'imgopto' => null, + 'imgopto_shield' => null, + 'imgopto_transforms' => null, + 'otfp' => null, + 'otfp_shield' => null, + 'otfp_manifests' => null, + 'video' => null, + 'pci' => null, + 'http2' => null, + 'http3' => null, + 'restarts' => null, + 'req_header_bytes' => null, + 'req_body_bytes' => null, + 'bereq_header_bytes' => null, + 'bereq_body_bytes' => null, + 'waf_blocked' => null, + 'waf_logged' => null, + 'waf_passed' => null, + 'attack_req_header_bytes' => null, + 'attack_req_body_bytes' => null, + 'attack_resp_synth_bytes' => null, + 'attack_logged_req_header_bytes' => null, + 'attack_logged_req_body_bytes' => null, + 'attack_blocked_req_header_bytes' => null, + 'attack_blocked_req_body_bytes' => null, + 'attack_passed_req_header_bytes' => null, + 'attack_passed_req_body_bytes' => null, + 'shield_resp_header_bytes' => null, + 'shield_resp_body_bytes' => null, + 'otfp_resp_header_bytes' => null, + 'otfp_resp_body_bytes' => null, + 'otfp_shield_resp_header_bytes' => null, + 'otfp_shield_resp_body_bytes' => null, + 'otfp_shield_time' => null, + 'otfp_deliver_time' => null, + 'imgopto_resp_header_bytes' => null, + 'imgopto_resp_body_bytes' => null, + 'imgopto_shield_resp_header_bytes' => null, + 'imgopto_shield_resp_body_bytes' => null, + 'status_1xx' => null, + 'status_2xx' => null, + 'status_3xx' => null, + 'status_4xx' => null, + 'status_5xx' => null, + 'status_200' => null, + 'status_204' => null, + 'status_206' => null, + 'status_301' => null, + 'status_302' => null, + 'status_304' => null, + 'status_400' => null, + 'status_401' => null, + 'status_403' => null, + 'status_404' => null, + 'status_406' => null, + 'status_416' => null, + 'status_429' => null, + 'status_500' => null, + 'status_501' => null, + 'status_502' => null, + 'status_503' => null, + 'status_504' => null, + 'status_505' => null, + 'uncacheable' => null, + 'pass_time' => null, + 'tls' => null, + 'tls_v10' => null, + 'tls_v11' => null, + 'tls_v12' => null, + 'tls_v13' => null, + 'object_size_1k' => null, + 'object_size_10k' => null, + 'object_size_100k' => null, + 'object_size_1m' => null, + 'object_size_10m' => null, + 'object_size_100m' => null, + 'object_size_1g' => null, + 'object_size_other' => null, + 'recv_sub_time' => null, + 'recv_sub_count' => null, + 'hash_sub_time' => null, + 'hash_sub_count' => null, + 'miss_sub_time' => null, + 'miss_sub_count' => null, + 'fetch_sub_time' => null, + 'fetch_sub_count' => null, + 'pass_sub_time' => null, + 'pass_sub_count' => null, + 'pipe_sub_time' => null, + 'pipe_sub_count' => null, + 'deliver_sub_time' => null, + 'deliver_sub_count' => null, + 'error_sub_time' => null, + 'error_sub_count' => null, + 'hit_sub_time' => null, + 'hit_sub_count' => null, + 'prehash_sub_time' => null, + 'prehash_sub_count' => null, + 'predeliver_sub_time' => null, + 'predeliver_sub_count' => null, + 'hit_resp_body_bytes' => null, + 'miss_resp_body_bytes' => null, + 'pass_resp_body_bytes' => null, + 'compute_req_header_bytes' => null, + 'compute_req_body_bytes' => null, + 'compute_resp_header_bytes' => null, + 'compute_resp_body_bytes' => null, + 'imgvideo' => null, + 'imgvideo_frames' => null, + 'imgvideo_resp_header_bytes' => null, + 'imgvideo_resp_body_bytes' => null, + 'imgvideo_shield' => null, + 'imgvideo_shield_frames' => null, + 'imgvideo_shield_resp_header_bytes' => null, + 'imgvideo_shield_resp_body_bytes' => null, + 'log_bytes' => null, + 'edge_requests' => null, + 'edge_resp_header_bytes' => null, + 'edge_resp_body_bytes' => null, + 'origin_revalidations' => null, + 'origin_fetches' => null, + 'origin_fetch_header_bytes' => null, + 'origin_fetch_body_bytes' => null, + 'origin_fetch_resp_header_bytes' => null, + 'origin_fetch_resp_body_bytes' => null, + 'shield_revalidations' => null, + 'shield_fetches' => null, + 'shield_fetch_header_bytes' => null, + 'shield_fetch_body_bytes' => null, + 'shield_fetch_resp_header_bytes' => null, + 'shield_fetch_resp_body_bytes' => null, + 'segblock_origin_fetches' => null, + 'segblock_shield_fetches' => null, + 'compute_resp_status_1xx' => null, + 'compute_resp_status_2xx' => null, + 'compute_resp_status_3xx' => null, + 'compute_resp_status_4xx' => null, + 'compute_resp_status_5xx' => null, + 'edge_hit_requests' => null, + 'edge_miss_requests' => null, + 'compute_bereq_header_bytes' => null, + 'compute_bereq_body_bytes' => null, + 'compute_beresp_header_bytes' => null, + 'compute_beresp_body_bytes' => null, + 'origin_cache_fetches' => null, + 'shield_cache_fetches' => null, + 'compute_bereqs' => null, + 'compute_bereq_errors' => null, + 'compute_resource_limit_exceeded' => null, + 'compute_heap_limit_exceeded' => null, + 'compute_stack_limit_exceeded' => null, + 'compute_globals_limit_exceeded' => null, + 'compute_guest_errors' => null, + 'compute_runtime_errors' => null, + 'edge_hit_resp_body_bytes' => null, + 'edge_hit_resp_header_bytes' => null, + 'edge_miss_resp_body_bytes' => null, + 'edge_miss_resp_header_bytes' => null, + 'origin_cache_fetch_resp_body_bytes' => null, + 'origin_cache_fetch_resp_header_bytes' => null, + 'shield_hit_requests' => null, + 'shield_miss_requests' => null, + 'shield_hit_resp_header_bytes' => null, + 'shield_hit_resp_body_bytes' => null, + 'shield_miss_resp_header_bytes' => null, + 'shield_miss_resp_body_bytes' => null, + 'websocket_req_header_bytes' => null, + 'websocket_req_body_bytes' => null, + 'websocket_resp_header_bytes' => null, + 'websocket_bereq_header_bytes' => null, + 'websocket_bereq_body_bytes' => null, + 'websocket_beresp_header_bytes' => null, + 'websocket_beresp_body_bytes' => null, + 'websocket_conn_time_ms' => null, + 'websocket_resp_body_bytes' => null, + 'fanout_recv_publishes' => null, + 'fanout_send_publishes' => null, + 'kv_store_class_a_operations' => null, + 'kv_store_class_b_operations' => null, + 'object_store_class_a_operations' => null, + 'object_store_class_b_operations' => null, + 'fanout_req_header_bytes' => null, + 'fanout_req_body_bytes' => null, + 'fanout_resp_header_bytes' => null, + 'fanout_resp_body_bytes' => null, + 'fanout_bereq_header_bytes' => null, + 'fanout_bereq_body_bytes' => null, + 'fanout_beresp_header_bytes' => null, + 'fanout_beresp_body_bytes' => null, + 'fanout_conn_time_ms' => null, + 'ddos_action_limit_streams_connections' => null, + 'ddos_action_limit_streams_requests' => null, + 'ddos_action_tarpit_accept' => null, + 'ddos_action_tarpit' => null, + 'ddos_action_close' => null, + 'ddos_action_blackhole' => 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 = [ + 'requests' => 'requests', + 'logging' => 'logging', + 'log' => 'log', + 'resp_header_bytes' => 'resp_header_bytes', + 'header_size' => 'header_size', + 'resp_body_bytes' => 'resp_body_bytes', + 'body_size' => 'body_size', + 'hits' => 'hits', + 'miss' => 'miss', + 'pass' => 'pass', + 'synth' => 'synth', + 'errors' => 'errors', + 'hits_time' => 'hits_time', + 'miss_time' => 'miss_time', + 'miss_histogram' => 'miss_histogram', + 'compute_requests' => 'compute_requests', + 'compute_execution_time_ms' => 'compute_execution_time_ms', + 'compute_ram_used' => 'compute_ram_used', + 'compute_request_time_ms' => 'compute_request_time_ms', + 'compute_request_time_billed_ms' => 'compute_request_time_billed_ms', + 'shield' => 'shield', + 'ipv6' => 'ipv6', + 'imgopto' => 'imgopto', + 'imgopto_shield' => 'imgopto_shield', + 'imgopto_transforms' => 'imgopto_transforms', + 'otfp' => 'otfp', + 'otfp_shield' => 'otfp_shield', + 'otfp_manifests' => 'otfp_manifests', + 'video' => 'video', + 'pci' => 'pci', + 'http2' => 'http2', + 'http3' => 'http3', + 'restarts' => 'restarts', + 'req_header_bytes' => 'req_header_bytes', + 'req_body_bytes' => 'req_body_bytes', + 'bereq_header_bytes' => 'bereq_header_bytes', + 'bereq_body_bytes' => 'bereq_body_bytes', + 'waf_blocked' => 'waf_blocked', + 'waf_logged' => 'waf_logged', + 'waf_passed' => 'waf_passed', + 'attack_req_header_bytes' => 'attack_req_header_bytes', + 'attack_req_body_bytes' => 'attack_req_body_bytes', + 'attack_resp_synth_bytes' => 'attack_resp_synth_bytes', + 'attack_logged_req_header_bytes' => 'attack_logged_req_header_bytes', + 'attack_logged_req_body_bytes' => 'attack_logged_req_body_bytes', + 'attack_blocked_req_header_bytes' => 'attack_blocked_req_header_bytes', + 'attack_blocked_req_body_bytes' => 'attack_blocked_req_body_bytes', + 'attack_passed_req_header_bytes' => 'attack_passed_req_header_bytes', + 'attack_passed_req_body_bytes' => 'attack_passed_req_body_bytes', + 'shield_resp_header_bytes' => 'shield_resp_header_bytes', + 'shield_resp_body_bytes' => 'shield_resp_body_bytes', + 'otfp_resp_header_bytes' => 'otfp_resp_header_bytes', + 'otfp_resp_body_bytes' => 'otfp_resp_body_bytes', + 'otfp_shield_resp_header_bytes' => 'otfp_shield_resp_header_bytes', + 'otfp_shield_resp_body_bytes' => 'otfp_shield_resp_body_bytes', + 'otfp_shield_time' => 'otfp_shield_time', + 'otfp_deliver_time' => 'otfp_deliver_time', + 'imgopto_resp_header_bytes' => 'imgopto_resp_header_bytes', + 'imgopto_resp_body_bytes' => 'imgopto_resp_body_bytes', + 'imgopto_shield_resp_header_bytes' => 'imgopto_shield_resp_header_bytes', + 'imgopto_shield_resp_body_bytes' => 'imgopto_shield_resp_body_bytes', + 'status_1xx' => 'status_1xx', + 'status_2xx' => 'status_2xx', + 'status_3xx' => 'status_3xx', + 'status_4xx' => 'status_4xx', + 'status_5xx' => 'status_5xx', + 'status_200' => 'status_200', + 'status_204' => 'status_204', + 'status_206' => 'status_206', + 'status_301' => 'status_301', + 'status_302' => 'status_302', + 'status_304' => 'status_304', + 'status_400' => 'status_400', + 'status_401' => 'status_401', + 'status_403' => 'status_403', + 'status_404' => 'status_404', + 'status_406' => 'status_406', + 'status_416' => 'status_416', + 'status_429' => 'status_429', + 'status_500' => 'status_500', + 'status_501' => 'status_501', + 'status_502' => 'status_502', + 'status_503' => 'status_503', + 'status_504' => 'status_504', + 'status_505' => 'status_505', + 'uncacheable' => 'uncacheable', + 'pass_time' => 'pass_time', + 'tls' => 'tls', + 'tls_v10' => 'tls_v10', + 'tls_v11' => 'tls_v11', + 'tls_v12' => 'tls_v12', + 'tls_v13' => 'tls_v13', + 'object_size_1k' => 'object_size_1k', + 'object_size_10k' => 'object_size_10k', + 'object_size_100k' => 'object_size_100k', + 'object_size_1m' => 'object_size_1m', + 'object_size_10m' => 'object_size_10m', + 'object_size_100m' => 'object_size_100m', + 'object_size_1g' => 'object_size_1g', + 'object_size_other' => 'object_size_other', + 'recv_sub_time' => 'recv_sub_time', + 'recv_sub_count' => 'recv_sub_count', + 'hash_sub_time' => 'hash_sub_time', + 'hash_sub_count' => 'hash_sub_count', + 'miss_sub_time' => 'miss_sub_time', + 'miss_sub_count' => 'miss_sub_count', + 'fetch_sub_time' => 'fetch_sub_time', + 'fetch_sub_count' => 'fetch_sub_count', + 'pass_sub_time' => 'pass_sub_time', + 'pass_sub_count' => 'pass_sub_count', + 'pipe_sub_time' => 'pipe_sub_time', + 'pipe_sub_count' => 'pipe_sub_count', + 'deliver_sub_time' => 'deliver_sub_time', + 'deliver_sub_count' => 'deliver_sub_count', + 'error_sub_time' => 'error_sub_time', + 'error_sub_count' => 'error_sub_count', + 'hit_sub_time' => 'hit_sub_time', + 'hit_sub_count' => 'hit_sub_count', + 'prehash_sub_time' => 'prehash_sub_time', + 'prehash_sub_count' => 'prehash_sub_count', + 'predeliver_sub_time' => 'predeliver_sub_time', + 'predeliver_sub_count' => 'predeliver_sub_count', + 'hit_resp_body_bytes' => 'hit_resp_body_bytes', + 'miss_resp_body_bytes' => 'miss_resp_body_bytes', + 'pass_resp_body_bytes' => 'pass_resp_body_bytes', + 'compute_req_header_bytes' => 'compute_req_header_bytes', + 'compute_req_body_bytes' => 'compute_req_body_bytes', + 'compute_resp_header_bytes' => 'compute_resp_header_bytes', + 'compute_resp_body_bytes' => 'compute_resp_body_bytes', + 'imgvideo' => 'imgvideo', + 'imgvideo_frames' => 'imgvideo_frames', + 'imgvideo_resp_header_bytes' => 'imgvideo_resp_header_bytes', + 'imgvideo_resp_body_bytes' => 'imgvideo_resp_body_bytes', + 'imgvideo_shield' => 'imgvideo_shield', + 'imgvideo_shield_frames' => 'imgvideo_shield_frames', + 'imgvideo_shield_resp_header_bytes' => 'imgvideo_shield_resp_header_bytes', + 'imgvideo_shield_resp_body_bytes' => 'imgvideo_shield_resp_body_bytes', + 'log_bytes' => 'log_bytes', + 'edge_requests' => 'edge_requests', + 'edge_resp_header_bytes' => 'edge_resp_header_bytes', + 'edge_resp_body_bytes' => 'edge_resp_body_bytes', + 'origin_revalidations' => 'origin_revalidations', + 'origin_fetches' => 'origin_fetches', + 'origin_fetch_header_bytes' => 'origin_fetch_header_bytes', + 'origin_fetch_body_bytes' => 'origin_fetch_body_bytes', + 'origin_fetch_resp_header_bytes' => 'origin_fetch_resp_header_bytes', + 'origin_fetch_resp_body_bytes' => 'origin_fetch_resp_body_bytes', + 'shield_revalidations' => 'shield_revalidations', + 'shield_fetches' => 'shield_fetches', + 'shield_fetch_header_bytes' => 'shield_fetch_header_bytes', + 'shield_fetch_body_bytes' => 'shield_fetch_body_bytes', + 'shield_fetch_resp_header_bytes' => 'shield_fetch_resp_header_bytes', + 'shield_fetch_resp_body_bytes' => 'shield_fetch_resp_body_bytes', + 'segblock_origin_fetches' => 'segblock_origin_fetches', + 'segblock_shield_fetches' => 'segblock_shield_fetches', + 'compute_resp_status_1xx' => 'compute_resp_status_1xx', + 'compute_resp_status_2xx' => 'compute_resp_status_2xx', + 'compute_resp_status_3xx' => 'compute_resp_status_3xx', + 'compute_resp_status_4xx' => 'compute_resp_status_4xx', + 'compute_resp_status_5xx' => 'compute_resp_status_5xx', + 'edge_hit_requests' => 'edge_hit_requests', + 'edge_miss_requests' => 'edge_miss_requests', + 'compute_bereq_header_bytes' => 'compute_bereq_header_bytes', + 'compute_bereq_body_bytes' => 'compute_bereq_body_bytes', + 'compute_beresp_header_bytes' => 'compute_beresp_header_bytes', + 'compute_beresp_body_bytes' => 'compute_beresp_body_bytes', + 'origin_cache_fetches' => 'origin_cache_fetches', + 'shield_cache_fetches' => 'shield_cache_fetches', + 'compute_bereqs' => 'compute_bereqs', + 'compute_bereq_errors' => 'compute_bereq_errors', + 'compute_resource_limit_exceeded' => 'compute_resource_limit_exceeded', + 'compute_heap_limit_exceeded' => 'compute_heap_limit_exceeded', + 'compute_stack_limit_exceeded' => 'compute_stack_limit_exceeded', + 'compute_globals_limit_exceeded' => 'compute_globals_limit_exceeded', + 'compute_guest_errors' => 'compute_guest_errors', + 'compute_runtime_errors' => 'compute_runtime_errors', + 'edge_hit_resp_body_bytes' => 'edge_hit_resp_body_bytes', + 'edge_hit_resp_header_bytes' => 'edge_hit_resp_header_bytes', + 'edge_miss_resp_body_bytes' => 'edge_miss_resp_body_bytes', + 'edge_miss_resp_header_bytes' => 'edge_miss_resp_header_bytes', + 'origin_cache_fetch_resp_body_bytes' => 'origin_cache_fetch_resp_body_bytes', + 'origin_cache_fetch_resp_header_bytes' => 'origin_cache_fetch_resp_header_bytes', + 'shield_hit_requests' => 'shield_hit_requests', + 'shield_miss_requests' => 'shield_miss_requests', + 'shield_hit_resp_header_bytes' => 'shield_hit_resp_header_bytes', + 'shield_hit_resp_body_bytes' => 'shield_hit_resp_body_bytes', + 'shield_miss_resp_header_bytes' => 'shield_miss_resp_header_bytes', + 'shield_miss_resp_body_bytes' => 'shield_miss_resp_body_bytes', + 'websocket_req_header_bytes' => 'websocket_req_header_bytes', + 'websocket_req_body_bytes' => 'websocket_req_body_bytes', + 'websocket_resp_header_bytes' => 'websocket_resp_header_bytes', + 'websocket_bereq_header_bytes' => 'websocket_bereq_header_bytes', + 'websocket_bereq_body_bytes' => 'websocket_bereq_body_bytes', + 'websocket_beresp_header_bytes' => 'websocket_beresp_header_bytes', + 'websocket_beresp_body_bytes' => 'websocket_beresp_body_bytes', + 'websocket_conn_time_ms' => 'websocket_conn_time_ms', + 'websocket_resp_body_bytes' => 'websocket_resp_body_bytes', + 'fanout_recv_publishes' => 'fanout_recv_publishes', + 'fanout_send_publishes' => 'fanout_send_publishes', + 'kv_store_class_a_operations' => 'kv_store_class_a_operations', + 'kv_store_class_b_operations' => 'kv_store_class_b_operations', + 'object_store_class_a_operations' => 'object_store_class_a_operations', + 'object_store_class_b_operations' => 'object_store_class_b_operations', + 'fanout_req_header_bytes' => 'fanout_req_header_bytes', + 'fanout_req_body_bytes' => 'fanout_req_body_bytes', + 'fanout_resp_header_bytes' => 'fanout_resp_header_bytes', + 'fanout_resp_body_bytes' => 'fanout_resp_body_bytes', + 'fanout_bereq_header_bytes' => 'fanout_bereq_header_bytes', + 'fanout_bereq_body_bytes' => 'fanout_bereq_body_bytes', + 'fanout_beresp_header_bytes' => 'fanout_beresp_header_bytes', + 'fanout_beresp_body_bytes' => 'fanout_beresp_body_bytes', + 'fanout_conn_time_ms' => 'fanout_conn_time_ms', + 'ddos_action_limit_streams_connections' => 'ddos_action_limit_streams_connections', + 'ddos_action_limit_streams_requests' => 'ddos_action_limit_streams_requests', + 'ddos_action_tarpit_accept' => 'ddos_action_tarpit_accept', + 'ddos_action_tarpit' => 'ddos_action_tarpit', + 'ddos_action_close' => 'ddos_action_close', + 'ddos_action_blackhole' => 'ddos_action_blackhole' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'requests' => 'setRequests', + 'logging' => 'setLogging', + 'log' => 'setLog', + 'resp_header_bytes' => 'setRespHeaderBytes', + 'header_size' => 'setHeaderSize', + 'resp_body_bytes' => 'setRespBodyBytes', + 'body_size' => 'setBodySize', + 'hits' => 'setHits', + 'miss' => 'setMiss', + 'pass' => 'setPass', + 'synth' => 'setSynth', + 'errors' => 'setErrors', + 'hits_time' => 'setHitsTime', + 'miss_time' => 'setMissTime', + 'miss_histogram' => 'setMissHistogram', + 'compute_requests' => 'setComputeRequests', + 'compute_execution_time_ms' => 'setComputeExecutionTimeMs', + 'compute_ram_used' => 'setComputeRamUsed', + 'compute_request_time_ms' => 'setComputeRequestTimeMs', + 'compute_request_time_billed_ms' => 'setComputeRequestTimeBilledMs', + 'shield' => 'setShield', + 'ipv6' => 'setIpv6', + 'imgopto' => 'setImgopto', + 'imgopto_shield' => 'setImgoptoShield', + 'imgopto_transforms' => 'setImgoptoTransforms', + 'otfp' => 'setOtfp', + 'otfp_shield' => 'setOtfpShield', + 'otfp_manifests' => 'setOtfpManifests', + 'video' => 'setVideo', + 'pci' => 'setPci', + 'http2' => 'setHttp2', + 'http3' => 'setHttp3', + 'restarts' => 'setRestarts', + 'req_header_bytes' => 'setReqHeaderBytes', + 'req_body_bytes' => 'setReqBodyBytes', + 'bereq_header_bytes' => 'setBereqHeaderBytes', + 'bereq_body_bytes' => 'setBereqBodyBytes', + 'waf_blocked' => 'setWafBlocked', + 'waf_logged' => 'setWafLogged', + 'waf_passed' => 'setWafPassed', + 'attack_req_header_bytes' => 'setAttackReqHeaderBytes', + 'attack_req_body_bytes' => 'setAttackReqBodyBytes', + 'attack_resp_synth_bytes' => 'setAttackRespSynthBytes', + 'attack_logged_req_header_bytes' => 'setAttackLoggedReqHeaderBytes', + 'attack_logged_req_body_bytes' => 'setAttackLoggedReqBodyBytes', + 'attack_blocked_req_header_bytes' => 'setAttackBlockedReqHeaderBytes', + 'attack_blocked_req_body_bytes' => 'setAttackBlockedReqBodyBytes', + 'attack_passed_req_header_bytes' => 'setAttackPassedReqHeaderBytes', + 'attack_passed_req_body_bytes' => 'setAttackPassedReqBodyBytes', + 'shield_resp_header_bytes' => 'setShieldRespHeaderBytes', + 'shield_resp_body_bytes' => 'setShieldRespBodyBytes', + 'otfp_resp_header_bytes' => 'setOtfpRespHeaderBytes', + 'otfp_resp_body_bytes' => 'setOtfpRespBodyBytes', + 'otfp_shield_resp_header_bytes' => 'setOtfpShieldRespHeaderBytes', + 'otfp_shield_resp_body_bytes' => 'setOtfpShieldRespBodyBytes', + 'otfp_shield_time' => 'setOtfpShieldTime', + 'otfp_deliver_time' => 'setOtfpDeliverTime', + 'imgopto_resp_header_bytes' => 'setImgoptoRespHeaderBytes', + 'imgopto_resp_body_bytes' => 'setImgoptoRespBodyBytes', + 'imgopto_shield_resp_header_bytes' => 'setImgoptoShieldRespHeaderBytes', + 'imgopto_shield_resp_body_bytes' => 'setImgoptoShieldRespBodyBytes', + 'status_1xx' => 'setStatus1xx', + 'status_2xx' => 'setStatus2xx', + 'status_3xx' => 'setStatus3xx', + 'status_4xx' => 'setStatus4xx', + 'status_5xx' => 'setStatus5xx', + 'status_200' => 'setStatus200', + 'status_204' => 'setStatus204', + 'status_206' => 'setStatus206', + 'status_301' => 'setStatus301', + 'status_302' => 'setStatus302', + 'status_304' => 'setStatus304', + 'status_400' => 'setStatus400', + 'status_401' => 'setStatus401', + 'status_403' => 'setStatus403', + 'status_404' => 'setStatus404', + 'status_406' => 'setStatus406', + 'status_416' => 'setStatus416', + 'status_429' => 'setStatus429', + 'status_500' => 'setStatus500', + 'status_501' => 'setStatus501', + 'status_502' => 'setStatus502', + 'status_503' => 'setStatus503', + 'status_504' => 'setStatus504', + 'status_505' => 'setStatus505', + 'uncacheable' => 'setUncacheable', + 'pass_time' => 'setPassTime', + 'tls' => 'setTls', + 'tls_v10' => 'setTlsV10', + 'tls_v11' => 'setTlsV11', + 'tls_v12' => 'setTlsV12', + 'tls_v13' => 'setTlsV13', + 'object_size_1k' => 'setObjectSize1k', + 'object_size_10k' => 'setObjectSize10k', + 'object_size_100k' => 'setObjectSize100k', + 'object_size_1m' => 'setObjectSize1m', + 'object_size_10m' => 'setObjectSize10m', + 'object_size_100m' => 'setObjectSize100m', + 'object_size_1g' => 'setObjectSize1g', + 'object_size_other' => 'setObjectSizeOther', + 'recv_sub_time' => 'setRecvSubTime', + 'recv_sub_count' => 'setRecvSubCount', + 'hash_sub_time' => 'setHashSubTime', + 'hash_sub_count' => 'setHashSubCount', + 'miss_sub_time' => 'setMissSubTime', + 'miss_sub_count' => 'setMissSubCount', + 'fetch_sub_time' => 'setFetchSubTime', + 'fetch_sub_count' => 'setFetchSubCount', + 'pass_sub_time' => 'setPassSubTime', + 'pass_sub_count' => 'setPassSubCount', + 'pipe_sub_time' => 'setPipeSubTime', + 'pipe_sub_count' => 'setPipeSubCount', + 'deliver_sub_time' => 'setDeliverSubTime', + 'deliver_sub_count' => 'setDeliverSubCount', + 'error_sub_time' => 'setErrorSubTime', + 'error_sub_count' => 'setErrorSubCount', + 'hit_sub_time' => 'setHitSubTime', + 'hit_sub_count' => 'setHitSubCount', + 'prehash_sub_time' => 'setPrehashSubTime', + 'prehash_sub_count' => 'setPrehashSubCount', + 'predeliver_sub_time' => 'setPredeliverSubTime', + 'predeliver_sub_count' => 'setPredeliverSubCount', + 'hit_resp_body_bytes' => 'setHitRespBodyBytes', + 'miss_resp_body_bytes' => 'setMissRespBodyBytes', + 'pass_resp_body_bytes' => 'setPassRespBodyBytes', + 'compute_req_header_bytes' => 'setComputeReqHeaderBytes', + 'compute_req_body_bytes' => 'setComputeReqBodyBytes', + 'compute_resp_header_bytes' => 'setComputeRespHeaderBytes', + 'compute_resp_body_bytes' => 'setComputeRespBodyBytes', + 'imgvideo' => 'setImgvideo', + 'imgvideo_frames' => 'setImgvideoFrames', + 'imgvideo_resp_header_bytes' => 'setImgvideoRespHeaderBytes', + 'imgvideo_resp_body_bytes' => 'setImgvideoRespBodyBytes', + 'imgvideo_shield' => 'setImgvideoShield', + 'imgvideo_shield_frames' => 'setImgvideoShieldFrames', + 'imgvideo_shield_resp_header_bytes' => 'setImgvideoShieldRespHeaderBytes', + 'imgvideo_shield_resp_body_bytes' => 'setImgvideoShieldRespBodyBytes', + 'log_bytes' => 'setLogBytes', + 'edge_requests' => 'setEdgeRequests', + 'edge_resp_header_bytes' => 'setEdgeRespHeaderBytes', + 'edge_resp_body_bytes' => 'setEdgeRespBodyBytes', + 'origin_revalidations' => 'setOriginRevalidations', + 'origin_fetches' => 'setOriginFetches', + 'origin_fetch_header_bytes' => 'setOriginFetchHeaderBytes', + 'origin_fetch_body_bytes' => 'setOriginFetchBodyBytes', + 'origin_fetch_resp_header_bytes' => 'setOriginFetchRespHeaderBytes', + 'origin_fetch_resp_body_bytes' => 'setOriginFetchRespBodyBytes', + 'shield_revalidations' => 'setShieldRevalidations', + 'shield_fetches' => 'setShieldFetches', + 'shield_fetch_header_bytes' => 'setShieldFetchHeaderBytes', + 'shield_fetch_body_bytes' => 'setShieldFetchBodyBytes', + 'shield_fetch_resp_header_bytes' => 'setShieldFetchRespHeaderBytes', + 'shield_fetch_resp_body_bytes' => 'setShieldFetchRespBodyBytes', + 'segblock_origin_fetches' => 'setSegblockOriginFetches', + 'segblock_shield_fetches' => 'setSegblockShieldFetches', + 'compute_resp_status_1xx' => 'setComputeRespStatus1xx', + 'compute_resp_status_2xx' => 'setComputeRespStatus2xx', + 'compute_resp_status_3xx' => 'setComputeRespStatus3xx', + 'compute_resp_status_4xx' => 'setComputeRespStatus4xx', + 'compute_resp_status_5xx' => 'setComputeRespStatus5xx', + 'edge_hit_requests' => 'setEdgeHitRequests', + 'edge_miss_requests' => 'setEdgeMissRequests', + 'compute_bereq_header_bytes' => 'setComputeBereqHeaderBytes', + 'compute_bereq_body_bytes' => 'setComputeBereqBodyBytes', + 'compute_beresp_header_bytes' => 'setComputeBerespHeaderBytes', + 'compute_beresp_body_bytes' => 'setComputeBerespBodyBytes', + 'origin_cache_fetches' => 'setOriginCacheFetches', + 'shield_cache_fetches' => 'setShieldCacheFetches', + 'compute_bereqs' => 'setComputeBereqs', + 'compute_bereq_errors' => 'setComputeBereqErrors', + 'compute_resource_limit_exceeded' => 'setComputeResourceLimitExceeded', + 'compute_heap_limit_exceeded' => 'setComputeHeapLimitExceeded', + 'compute_stack_limit_exceeded' => 'setComputeStackLimitExceeded', + 'compute_globals_limit_exceeded' => 'setComputeGlobalsLimitExceeded', + 'compute_guest_errors' => 'setComputeGuestErrors', + 'compute_runtime_errors' => 'setComputeRuntimeErrors', + 'edge_hit_resp_body_bytes' => 'setEdgeHitRespBodyBytes', + 'edge_hit_resp_header_bytes' => 'setEdgeHitRespHeaderBytes', + 'edge_miss_resp_body_bytes' => 'setEdgeMissRespBodyBytes', + 'edge_miss_resp_header_bytes' => 'setEdgeMissRespHeaderBytes', + 'origin_cache_fetch_resp_body_bytes' => 'setOriginCacheFetchRespBodyBytes', + 'origin_cache_fetch_resp_header_bytes' => 'setOriginCacheFetchRespHeaderBytes', + 'shield_hit_requests' => 'setShieldHitRequests', + 'shield_miss_requests' => 'setShieldMissRequests', + 'shield_hit_resp_header_bytes' => 'setShieldHitRespHeaderBytes', + 'shield_hit_resp_body_bytes' => 'setShieldHitRespBodyBytes', + 'shield_miss_resp_header_bytes' => 'setShieldMissRespHeaderBytes', + 'shield_miss_resp_body_bytes' => 'setShieldMissRespBodyBytes', + 'websocket_req_header_bytes' => 'setWebsocketReqHeaderBytes', + 'websocket_req_body_bytes' => 'setWebsocketReqBodyBytes', + 'websocket_resp_header_bytes' => 'setWebsocketRespHeaderBytes', + 'websocket_bereq_header_bytes' => 'setWebsocketBereqHeaderBytes', + 'websocket_bereq_body_bytes' => 'setWebsocketBereqBodyBytes', + 'websocket_beresp_header_bytes' => 'setWebsocketBerespHeaderBytes', + 'websocket_beresp_body_bytes' => 'setWebsocketBerespBodyBytes', + 'websocket_conn_time_ms' => 'setWebsocketConnTimeMs', + 'websocket_resp_body_bytes' => 'setWebsocketRespBodyBytes', + 'fanout_recv_publishes' => 'setFanoutRecvPublishes', + 'fanout_send_publishes' => 'setFanoutSendPublishes', + 'kv_store_class_a_operations' => 'setKvStoreClassAOperations', + 'kv_store_class_b_operations' => 'setKvStoreClassBOperations', + 'object_store_class_a_operations' => 'setObjectStoreClassAOperations', + 'object_store_class_b_operations' => 'setObjectStoreClassBOperations', + 'fanout_req_header_bytes' => 'setFanoutReqHeaderBytes', + 'fanout_req_body_bytes' => 'setFanoutReqBodyBytes', + 'fanout_resp_header_bytes' => 'setFanoutRespHeaderBytes', + 'fanout_resp_body_bytes' => 'setFanoutRespBodyBytes', + 'fanout_bereq_header_bytes' => 'setFanoutBereqHeaderBytes', + 'fanout_bereq_body_bytes' => 'setFanoutBereqBodyBytes', + 'fanout_beresp_header_bytes' => 'setFanoutBerespHeaderBytes', + 'fanout_beresp_body_bytes' => 'setFanoutBerespBodyBytes', + 'fanout_conn_time_ms' => 'setFanoutConnTimeMs', + 'ddos_action_limit_streams_connections' => 'setDdosActionLimitStreamsConnections', + 'ddos_action_limit_streams_requests' => 'setDdosActionLimitStreamsRequests', + 'ddos_action_tarpit_accept' => 'setDdosActionTarpitAccept', + 'ddos_action_tarpit' => 'setDdosActionTarpit', + 'ddos_action_close' => 'setDdosActionClose', + 'ddos_action_blackhole' => 'setDdosActionBlackhole' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'requests' => 'getRequests', + 'logging' => 'getLogging', + 'log' => 'getLog', + 'resp_header_bytes' => 'getRespHeaderBytes', + 'header_size' => 'getHeaderSize', + 'resp_body_bytes' => 'getRespBodyBytes', + 'body_size' => 'getBodySize', + 'hits' => 'getHits', + 'miss' => 'getMiss', + 'pass' => 'getPass', + 'synth' => 'getSynth', + 'errors' => 'getErrors', + 'hits_time' => 'getHitsTime', + 'miss_time' => 'getMissTime', + 'miss_histogram' => 'getMissHistogram', + 'compute_requests' => 'getComputeRequests', + 'compute_execution_time_ms' => 'getComputeExecutionTimeMs', + 'compute_ram_used' => 'getComputeRamUsed', + 'compute_request_time_ms' => 'getComputeRequestTimeMs', + 'compute_request_time_billed_ms' => 'getComputeRequestTimeBilledMs', + 'shield' => 'getShield', + 'ipv6' => 'getIpv6', + 'imgopto' => 'getImgopto', + 'imgopto_shield' => 'getImgoptoShield', + 'imgopto_transforms' => 'getImgoptoTransforms', + 'otfp' => 'getOtfp', + 'otfp_shield' => 'getOtfpShield', + 'otfp_manifests' => 'getOtfpManifests', + 'video' => 'getVideo', + 'pci' => 'getPci', + 'http2' => 'getHttp2', + 'http3' => 'getHttp3', + 'restarts' => 'getRestarts', + 'req_header_bytes' => 'getReqHeaderBytes', + 'req_body_bytes' => 'getReqBodyBytes', + 'bereq_header_bytes' => 'getBereqHeaderBytes', + 'bereq_body_bytes' => 'getBereqBodyBytes', + 'waf_blocked' => 'getWafBlocked', + 'waf_logged' => 'getWafLogged', + 'waf_passed' => 'getWafPassed', + 'attack_req_header_bytes' => 'getAttackReqHeaderBytes', + 'attack_req_body_bytes' => 'getAttackReqBodyBytes', + 'attack_resp_synth_bytes' => 'getAttackRespSynthBytes', + 'attack_logged_req_header_bytes' => 'getAttackLoggedReqHeaderBytes', + 'attack_logged_req_body_bytes' => 'getAttackLoggedReqBodyBytes', + 'attack_blocked_req_header_bytes' => 'getAttackBlockedReqHeaderBytes', + 'attack_blocked_req_body_bytes' => 'getAttackBlockedReqBodyBytes', + 'attack_passed_req_header_bytes' => 'getAttackPassedReqHeaderBytes', + 'attack_passed_req_body_bytes' => 'getAttackPassedReqBodyBytes', + 'shield_resp_header_bytes' => 'getShieldRespHeaderBytes', + 'shield_resp_body_bytes' => 'getShieldRespBodyBytes', + 'otfp_resp_header_bytes' => 'getOtfpRespHeaderBytes', + 'otfp_resp_body_bytes' => 'getOtfpRespBodyBytes', + 'otfp_shield_resp_header_bytes' => 'getOtfpShieldRespHeaderBytes', + 'otfp_shield_resp_body_bytes' => 'getOtfpShieldRespBodyBytes', + 'otfp_shield_time' => 'getOtfpShieldTime', + 'otfp_deliver_time' => 'getOtfpDeliverTime', + 'imgopto_resp_header_bytes' => 'getImgoptoRespHeaderBytes', + 'imgopto_resp_body_bytes' => 'getImgoptoRespBodyBytes', + 'imgopto_shield_resp_header_bytes' => 'getImgoptoShieldRespHeaderBytes', + 'imgopto_shield_resp_body_bytes' => 'getImgoptoShieldRespBodyBytes', + 'status_1xx' => 'getStatus1xx', + 'status_2xx' => 'getStatus2xx', + 'status_3xx' => 'getStatus3xx', + 'status_4xx' => 'getStatus4xx', + 'status_5xx' => 'getStatus5xx', + 'status_200' => 'getStatus200', + 'status_204' => 'getStatus204', + 'status_206' => 'getStatus206', + 'status_301' => 'getStatus301', + 'status_302' => 'getStatus302', + 'status_304' => 'getStatus304', + 'status_400' => 'getStatus400', + 'status_401' => 'getStatus401', + 'status_403' => 'getStatus403', + 'status_404' => 'getStatus404', + 'status_406' => 'getStatus406', + 'status_416' => 'getStatus416', + 'status_429' => 'getStatus429', + 'status_500' => 'getStatus500', + 'status_501' => 'getStatus501', + 'status_502' => 'getStatus502', + 'status_503' => 'getStatus503', + 'status_504' => 'getStatus504', + 'status_505' => 'getStatus505', + 'uncacheable' => 'getUncacheable', + 'pass_time' => 'getPassTime', + 'tls' => 'getTls', + 'tls_v10' => 'getTlsV10', + 'tls_v11' => 'getTlsV11', + 'tls_v12' => 'getTlsV12', + 'tls_v13' => 'getTlsV13', + 'object_size_1k' => 'getObjectSize1k', + 'object_size_10k' => 'getObjectSize10k', + 'object_size_100k' => 'getObjectSize100k', + 'object_size_1m' => 'getObjectSize1m', + 'object_size_10m' => 'getObjectSize10m', + 'object_size_100m' => 'getObjectSize100m', + 'object_size_1g' => 'getObjectSize1g', + 'object_size_other' => 'getObjectSizeOther', + 'recv_sub_time' => 'getRecvSubTime', + 'recv_sub_count' => 'getRecvSubCount', + 'hash_sub_time' => 'getHashSubTime', + 'hash_sub_count' => 'getHashSubCount', + 'miss_sub_time' => 'getMissSubTime', + 'miss_sub_count' => 'getMissSubCount', + 'fetch_sub_time' => 'getFetchSubTime', + 'fetch_sub_count' => 'getFetchSubCount', + 'pass_sub_time' => 'getPassSubTime', + 'pass_sub_count' => 'getPassSubCount', + 'pipe_sub_time' => 'getPipeSubTime', + 'pipe_sub_count' => 'getPipeSubCount', + 'deliver_sub_time' => 'getDeliverSubTime', + 'deliver_sub_count' => 'getDeliverSubCount', + 'error_sub_time' => 'getErrorSubTime', + 'error_sub_count' => 'getErrorSubCount', + 'hit_sub_time' => 'getHitSubTime', + 'hit_sub_count' => 'getHitSubCount', + 'prehash_sub_time' => 'getPrehashSubTime', + 'prehash_sub_count' => 'getPrehashSubCount', + 'predeliver_sub_time' => 'getPredeliverSubTime', + 'predeliver_sub_count' => 'getPredeliverSubCount', + 'hit_resp_body_bytes' => 'getHitRespBodyBytes', + 'miss_resp_body_bytes' => 'getMissRespBodyBytes', + 'pass_resp_body_bytes' => 'getPassRespBodyBytes', + 'compute_req_header_bytes' => 'getComputeReqHeaderBytes', + 'compute_req_body_bytes' => 'getComputeReqBodyBytes', + 'compute_resp_header_bytes' => 'getComputeRespHeaderBytes', + 'compute_resp_body_bytes' => 'getComputeRespBodyBytes', + 'imgvideo' => 'getImgvideo', + 'imgvideo_frames' => 'getImgvideoFrames', + 'imgvideo_resp_header_bytes' => 'getImgvideoRespHeaderBytes', + 'imgvideo_resp_body_bytes' => 'getImgvideoRespBodyBytes', + 'imgvideo_shield' => 'getImgvideoShield', + 'imgvideo_shield_frames' => 'getImgvideoShieldFrames', + 'imgvideo_shield_resp_header_bytes' => 'getImgvideoShieldRespHeaderBytes', + 'imgvideo_shield_resp_body_bytes' => 'getImgvideoShieldRespBodyBytes', + 'log_bytes' => 'getLogBytes', + 'edge_requests' => 'getEdgeRequests', + 'edge_resp_header_bytes' => 'getEdgeRespHeaderBytes', + 'edge_resp_body_bytes' => 'getEdgeRespBodyBytes', + 'origin_revalidations' => 'getOriginRevalidations', + 'origin_fetches' => 'getOriginFetches', + 'origin_fetch_header_bytes' => 'getOriginFetchHeaderBytes', + 'origin_fetch_body_bytes' => 'getOriginFetchBodyBytes', + 'origin_fetch_resp_header_bytes' => 'getOriginFetchRespHeaderBytes', + 'origin_fetch_resp_body_bytes' => 'getOriginFetchRespBodyBytes', + 'shield_revalidations' => 'getShieldRevalidations', + 'shield_fetches' => 'getShieldFetches', + 'shield_fetch_header_bytes' => 'getShieldFetchHeaderBytes', + 'shield_fetch_body_bytes' => 'getShieldFetchBodyBytes', + 'shield_fetch_resp_header_bytes' => 'getShieldFetchRespHeaderBytes', + 'shield_fetch_resp_body_bytes' => 'getShieldFetchRespBodyBytes', + 'segblock_origin_fetches' => 'getSegblockOriginFetches', + 'segblock_shield_fetches' => 'getSegblockShieldFetches', + 'compute_resp_status_1xx' => 'getComputeRespStatus1xx', + 'compute_resp_status_2xx' => 'getComputeRespStatus2xx', + 'compute_resp_status_3xx' => 'getComputeRespStatus3xx', + 'compute_resp_status_4xx' => 'getComputeRespStatus4xx', + 'compute_resp_status_5xx' => 'getComputeRespStatus5xx', + 'edge_hit_requests' => 'getEdgeHitRequests', + 'edge_miss_requests' => 'getEdgeMissRequests', + 'compute_bereq_header_bytes' => 'getComputeBereqHeaderBytes', + 'compute_bereq_body_bytes' => 'getComputeBereqBodyBytes', + 'compute_beresp_header_bytes' => 'getComputeBerespHeaderBytes', + 'compute_beresp_body_bytes' => 'getComputeBerespBodyBytes', + 'origin_cache_fetches' => 'getOriginCacheFetches', + 'shield_cache_fetches' => 'getShieldCacheFetches', + 'compute_bereqs' => 'getComputeBereqs', + 'compute_bereq_errors' => 'getComputeBereqErrors', + 'compute_resource_limit_exceeded' => 'getComputeResourceLimitExceeded', + 'compute_heap_limit_exceeded' => 'getComputeHeapLimitExceeded', + 'compute_stack_limit_exceeded' => 'getComputeStackLimitExceeded', + 'compute_globals_limit_exceeded' => 'getComputeGlobalsLimitExceeded', + 'compute_guest_errors' => 'getComputeGuestErrors', + 'compute_runtime_errors' => 'getComputeRuntimeErrors', + 'edge_hit_resp_body_bytes' => 'getEdgeHitRespBodyBytes', + 'edge_hit_resp_header_bytes' => 'getEdgeHitRespHeaderBytes', + 'edge_miss_resp_body_bytes' => 'getEdgeMissRespBodyBytes', + 'edge_miss_resp_header_bytes' => 'getEdgeMissRespHeaderBytes', + 'origin_cache_fetch_resp_body_bytes' => 'getOriginCacheFetchRespBodyBytes', + 'origin_cache_fetch_resp_header_bytes' => 'getOriginCacheFetchRespHeaderBytes', + 'shield_hit_requests' => 'getShieldHitRequests', + 'shield_miss_requests' => 'getShieldMissRequests', + 'shield_hit_resp_header_bytes' => 'getShieldHitRespHeaderBytes', + 'shield_hit_resp_body_bytes' => 'getShieldHitRespBodyBytes', + 'shield_miss_resp_header_bytes' => 'getShieldMissRespHeaderBytes', + 'shield_miss_resp_body_bytes' => 'getShieldMissRespBodyBytes', + 'websocket_req_header_bytes' => 'getWebsocketReqHeaderBytes', + 'websocket_req_body_bytes' => 'getWebsocketReqBodyBytes', + 'websocket_resp_header_bytes' => 'getWebsocketRespHeaderBytes', + 'websocket_bereq_header_bytes' => 'getWebsocketBereqHeaderBytes', + 'websocket_bereq_body_bytes' => 'getWebsocketBereqBodyBytes', + 'websocket_beresp_header_bytes' => 'getWebsocketBerespHeaderBytes', + 'websocket_beresp_body_bytes' => 'getWebsocketBerespBodyBytes', + 'websocket_conn_time_ms' => 'getWebsocketConnTimeMs', + 'websocket_resp_body_bytes' => 'getWebsocketRespBodyBytes', + 'fanout_recv_publishes' => 'getFanoutRecvPublishes', + 'fanout_send_publishes' => 'getFanoutSendPublishes', + 'kv_store_class_a_operations' => 'getKvStoreClassAOperations', + 'kv_store_class_b_operations' => 'getKvStoreClassBOperations', + 'object_store_class_a_operations' => 'getObjectStoreClassAOperations', + 'object_store_class_b_operations' => 'getObjectStoreClassBOperations', + 'fanout_req_header_bytes' => 'getFanoutReqHeaderBytes', + 'fanout_req_body_bytes' => 'getFanoutReqBodyBytes', + 'fanout_resp_header_bytes' => 'getFanoutRespHeaderBytes', + 'fanout_resp_body_bytes' => 'getFanoutRespBodyBytes', + 'fanout_bereq_header_bytes' => 'getFanoutBereqHeaderBytes', + 'fanout_bereq_body_bytes' => 'getFanoutBereqBodyBytes', + 'fanout_beresp_header_bytes' => 'getFanoutBerespHeaderBytes', + 'fanout_beresp_body_bytes' => 'getFanoutBerespBodyBytes', + 'fanout_conn_time_ms' => 'getFanoutConnTimeMs', + 'ddos_action_limit_streams_connections' => 'getDdosActionLimitStreamsConnections', + 'ddos_action_limit_streams_requests' => 'getDdosActionLimitStreamsRequests', + 'ddos_action_tarpit_accept' => 'getDdosActionTarpitAccept', + 'ddos_action_tarpit' => 'getDdosActionTarpit', + 'ddos_action_close' => 'getDdosActionClose', + 'ddos_action_blackhole' => 'getDdosActionBlackhole' + ]; + + /** + * 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['requests'] = $data['requests'] ?? null; + $this->container['logging'] = $data['logging'] ?? null; + $this->container['log'] = $data['log'] ?? null; + $this->container['resp_header_bytes'] = $data['resp_header_bytes'] ?? null; + $this->container['header_size'] = $data['header_size'] ?? null; + $this->container['resp_body_bytes'] = $data['resp_body_bytes'] ?? null; + $this->container['body_size'] = $data['body_size'] ?? null; + $this->container['hits'] = $data['hits'] ?? null; + $this->container['miss'] = $data['miss'] ?? null; + $this->container['pass'] = $data['pass'] ?? null; + $this->container['synth'] = $data['synth'] ?? null; + $this->container['errors'] = $data['errors'] ?? null; + $this->container['hits_time'] = $data['hits_time'] ?? null; + $this->container['miss_time'] = $data['miss_time'] ?? null; + $this->container['miss_histogram'] = $data['miss_histogram'] ?? null; + $this->container['compute_requests'] = $data['compute_requests'] ?? null; + $this->container['compute_execution_time_ms'] = $data['compute_execution_time_ms'] ?? null; + $this->container['compute_ram_used'] = $data['compute_ram_used'] ?? null; + $this->container['compute_request_time_ms'] = $data['compute_request_time_ms'] ?? null; + $this->container['compute_request_time_billed_ms'] = $data['compute_request_time_billed_ms'] ?? null; + $this->container['shield'] = $data['shield'] ?? null; + $this->container['ipv6'] = $data['ipv6'] ?? null; + $this->container['imgopto'] = $data['imgopto'] ?? null; + $this->container['imgopto_shield'] = $data['imgopto_shield'] ?? null; + $this->container['imgopto_transforms'] = $data['imgopto_transforms'] ?? null; + $this->container['otfp'] = $data['otfp'] ?? null; + $this->container['otfp_shield'] = $data['otfp_shield'] ?? null; + $this->container['otfp_manifests'] = $data['otfp_manifests'] ?? null; + $this->container['video'] = $data['video'] ?? null; + $this->container['pci'] = $data['pci'] ?? null; + $this->container['http2'] = $data['http2'] ?? null; + $this->container['http3'] = $data['http3'] ?? null; + $this->container['restarts'] = $data['restarts'] ?? null; + $this->container['req_header_bytes'] = $data['req_header_bytes'] ?? null; + $this->container['req_body_bytes'] = $data['req_body_bytes'] ?? null; + $this->container['bereq_header_bytes'] = $data['bereq_header_bytes'] ?? null; + $this->container['bereq_body_bytes'] = $data['bereq_body_bytes'] ?? null; + $this->container['waf_blocked'] = $data['waf_blocked'] ?? null; + $this->container['waf_logged'] = $data['waf_logged'] ?? null; + $this->container['waf_passed'] = $data['waf_passed'] ?? null; + $this->container['attack_req_header_bytes'] = $data['attack_req_header_bytes'] ?? null; + $this->container['attack_req_body_bytes'] = $data['attack_req_body_bytes'] ?? null; + $this->container['attack_resp_synth_bytes'] = $data['attack_resp_synth_bytes'] ?? null; + $this->container['attack_logged_req_header_bytes'] = $data['attack_logged_req_header_bytes'] ?? null; + $this->container['attack_logged_req_body_bytes'] = $data['attack_logged_req_body_bytes'] ?? null; + $this->container['attack_blocked_req_header_bytes'] = $data['attack_blocked_req_header_bytes'] ?? null; + $this->container['attack_blocked_req_body_bytes'] = $data['attack_blocked_req_body_bytes'] ?? null; + $this->container['attack_passed_req_header_bytes'] = $data['attack_passed_req_header_bytes'] ?? null; + $this->container['attack_passed_req_body_bytes'] = $data['attack_passed_req_body_bytes'] ?? null; + $this->container['shield_resp_header_bytes'] = $data['shield_resp_header_bytes'] ?? null; + $this->container['shield_resp_body_bytes'] = $data['shield_resp_body_bytes'] ?? null; + $this->container['otfp_resp_header_bytes'] = $data['otfp_resp_header_bytes'] ?? null; + $this->container['otfp_resp_body_bytes'] = $data['otfp_resp_body_bytes'] ?? null; + $this->container['otfp_shield_resp_header_bytes'] = $data['otfp_shield_resp_header_bytes'] ?? null; + $this->container['otfp_shield_resp_body_bytes'] = $data['otfp_shield_resp_body_bytes'] ?? null; + $this->container['otfp_shield_time'] = $data['otfp_shield_time'] ?? null; + $this->container['otfp_deliver_time'] = $data['otfp_deliver_time'] ?? null; + $this->container['imgopto_resp_header_bytes'] = $data['imgopto_resp_header_bytes'] ?? null; + $this->container['imgopto_resp_body_bytes'] = $data['imgopto_resp_body_bytes'] ?? null; + $this->container['imgopto_shield_resp_header_bytes'] = $data['imgopto_shield_resp_header_bytes'] ?? null; + $this->container['imgopto_shield_resp_body_bytes'] = $data['imgopto_shield_resp_body_bytes'] ?? null; + $this->container['status_1xx'] = $data['status_1xx'] ?? null; + $this->container['status_2xx'] = $data['status_2xx'] ?? null; + $this->container['status_3xx'] = $data['status_3xx'] ?? null; + $this->container['status_4xx'] = $data['status_4xx'] ?? null; + $this->container['status_5xx'] = $data['status_5xx'] ?? null; + $this->container['status_200'] = $data['status_200'] ?? null; + $this->container['status_204'] = $data['status_204'] ?? null; + $this->container['status_206'] = $data['status_206'] ?? null; + $this->container['status_301'] = $data['status_301'] ?? null; + $this->container['status_302'] = $data['status_302'] ?? null; + $this->container['status_304'] = $data['status_304'] ?? null; + $this->container['status_400'] = $data['status_400'] ?? null; + $this->container['status_401'] = $data['status_401'] ?? null; + $this->container['status_403'] = $data['status_403'] ?? null; + $this->container['status_404'] = $data['status_404'] ?? null; + $this->container['status_406'] = $data['status_406'] ?? null; + $this->container['status_416'] = $data['status_416'] ?? null; + $this->container['status_429'] = $data['status_429'] ?? null; + $this->container['status_500'] = $data['status_500'] ?? null; + $this->container['status_501'] = $data['status_501'] ?? null; + $this->container['status_502'] = $data['status_502'] ?? null; + $this->container['status_503'] = $data['status_503'] ?? null; + $this->container['status_504'] = $data['status_504'] ?? null; + $this->container['status_505'] = $data['status_505'] ?? null; + $this->container['uncacheable'] = $data['uncacheable'] ?? null; + $this->container['pass_time'] = $data['pass_time'] ?? null; + $this->container['tls'] = $data['tls'] ?? null; + $this->container['tls_v10'] = $data['tls_v10'] ?? null; + $this->container['tls_v11'] = $data['tls_v11'] ?? null; + $this->container['tls_v12'] = $data['tls_v12'] ?? null; + $this->container['tls_v13'] = $data['tls_v13'] ?? null; + $this->container['object_size_1k'] = $data['object_size_1k'] ?? null; + $this->container['object_size_10k'] = $data['object_size_10k'] ?? null; + $this->container['object_size_100k'] = $data['object_size_100k'] ?? null; + $this->container['object_size_1m'] = $data['object_size_1m'] ?? null; + $this->container['object_size_10m'] = $data['object_size_10m'] ?? null; + $this->container['object_size_100m'] = $data['object_size_100m'] ?? null; + $this->container['object_size_1g'] = $data['object_size_1g'] ?? null; + $this->container['object_size_other'] = $data['object_size_other'] ?? null; + $this->container['recv_sub_time'] = $data['recv_sub_time'] ?? null; + $this->container['recv_sub_count'] = $data['recv_sub_count'] ?? null; + $this->container['hash_sub_time'] = $data['hash_sub_time'] ?? null; + $this->container['hash_sub_count'] = $data['hash_sub_count'] ?? null; + $this->container['miss_sub_time'] = $data['miss_sub_time'] ?? null; + $this->container['miss_sub_count'] = $data['miss_sub_count'] ?? null; + $this->container['fetch_sub_time'] = $data['fetch_sub_time'] ?? null; + $this->container['fetch_sub_count'] = $data['fetch_sub_count'] ?? null; + $this->container['pass_sub_time'] = $data['pass_sub_time'] ?? null; + $this->container['pass_sub_count'] = $data['pass_sub_count'] ?? null; + $this->container['pipe_sub_time'] = $data['pipe_sub_time'] ?? null; + $this->container['pipe_sub_count'] = $data['pipe_sub_count'] ?? null; + $this->container['deliver_sub_time'] = $data['deliver_sub_time'] ?? null; + $this->container['deliver_sub_count'] = $data['deliver_sub_count'] ?? null; + $this->container['error_sub_time'] = $data['error_sub_time'] ?? null; + $this->container['error_sub_count'] = $data['error_sub_count'] ?? null; + $this->container['hit_sub_time'] = $data['hit_sub_time'] ?? null; + $this->container['hit_sub_count'] = $data['hit_sub_count'] ?? null; + $this->container['prehash_sub_time'] = $data['prehash_sub_time'] ?? null; + $this->container['prehash_sub_count'] = $data['prehash_sub_count'] ?? null; + $this->container['predeliver_sub_time'] = $data['predeliver_sub_time'] ?? null; + $this->container['predeliver_sub_count'] = $data['predeliver_sub_count'] ?? null; + $this->container['hit_resp_body_bytes'] = $data['hit_resp_body_bytes'] ?? null; + $this->container['miss_resp_body_bytes'] = $data['miss_resp_body_bytes'] ?? null; + $this->container['pass_resp_body_bytes'] = $data['pass_resp_body_bytes'] ?? null; + $this->container['compute_req_header_bytes'] = $data['compute_req_header_bytes'] ?? null; + $this->container['compute_req_body_bytes'] = $data['compute_req_body_bytes'] ?? null; + $this->container['compute_resp_header_bytes'] = $data['compute_resp_header_bytes'] ?? null; + $this->container['compute_resp_body_bytes'] = $data['compute_resp_body_bytes'] ?? null; + $this->container['imgvideo'] = $data['imgvideo'] ?? null; + $this->container['imgvideo_frames'] = $data['imgvideo_frames'] ?? null; + $this->container['imgvideo_resp_header_bytes'] = $data['imgvideo_resp_header_bytes'] ?? null; + $this->container['imgvideo_resp_body_bytes'] = $data['imgvideo_resp_body_bytes'] ?? null; + $this->container['imgvideo_shield'] = $data['imgvideo_shield'] ?? null; + $this->container['imgvideo_shield_frames'] = $data['imgvideo_shield_frames'] ?? null; + $this->container['imgvideo_shield_resp_header_bytes'] = $data['imgvideo_shield_resp_header_bytes'] ?? null; + $this->container['imgvideo_shield_resp_body_bytes'] = $data['imgvideo_shield_resp_body_bytes'] ?? null; + $this->container['log_bytes'] = $data['log_bytes'] ?? null; + $this->container['edge_requests'] = $data['edge_requests'] ?? null; + $this->container['edge_resp_header_bytes'] = $data['edge_resp_header_bytes'] ?? null; + $this->container['edge_resp_body_bytes'] = $data['edge_resp_body_bytes'] ?? null; + $this->container['origin_revalidations'] = $data['origin_revalidations'] ?? null; + $this->container['origin_fetches'] = $data['origin_fetches'] ?? null; + $this->container['origin_fetch_header_bytes'] = $data['origin_fetch_header_bytes'] ?? null; + $this->container['origin_fetch_body_bytes'] = $data['origin_fetch_body_bytes'] ?? null; + $this->container['origin_fetch_resp_header_bytes'] = $data['origin_fetch_resp_header_bytes'] ?? null; + $this->container['origin_fetch_resp_body_bytes'] = $data['origin_fetch_resp_body_bytes'] ?? null; + $this->container['shield_revalidations'] = $data['shield_revalidations'] ?? null; + $this->container['shield_fetches'] = $data['shield_fetches'] ?? null; + $this->container['shield_fetch_header_bytes'] = $data['shield_fetch_header_bytes'] ?? null; + $this->container['shield_fetch_body_bytes'] = $data['shield_fetch_body_bytes'] ?? null; + $this->container['shield_fetch_resp_header_bytes'] = $data['shield_fetch_resp_header_bytes'] ?? null; + $this->container['shield_fetch_resp_body_bytes'] = $data['shield_fetch_resp_body_bytes'] ?? null; + $this->container['segblock_origin_fetches'] = $data['segblock_origin_fetches'] ?? null; + $this->container['segblock_shield_fetches'] = $data['segblock_shield_fetches'] ?? null; + $this->container['compute_resp_status_1xx'] = $data['compute_resp_status_1xx'] ?? null; + $this->container['compute_resp_status_2xx'] = $data['compute_resp_status_2xx'] ?? null; + $this->container['compute_resp_status_3xx'] = $data['compute_resp_status_3xx'] ?? null; + $this->container['compute_resp_status_4xx'] = $data['compute_resp_status_4xx'] ?? null; + $this->container['compute_resp_status_5xx'] = $data['compute_resp_status_5xx'] ?? null; + $this->container['edge_hit_requests'] = $data['edge_hit_requests'] ?? null; + $this->container['edge_miss_requests'] = $data['edge_miss_requests'] ?? null; + $this->container['compute_bereq_header_bytes'] = $data['compute_bereq_header_bytes'] ?? null; + $this->container['compute_bereq_body_bytes'] = $data['compute_bereq_body_bytes'] ?? null; + $this->container['compute_beresp_header_bytes'] = $data['compute_beresp_header_bytes'] ?? null; + $this->container['compute_beresp_body_bytes'] = $data['compute_beresp_body_bytes'] ?? null; + $this->container['origin_cache_fetches'] = $data['origin_cache_fetches'] ?? null; + $this->container['shield_cache_fetches'] = $data['shield_cache_fetches'] ?? null; + $this->container['compute_bereqs'] = $data['compute_bereqs'] ?? null; + $this->container['compute_bereq_errors'] = $data['compute_bereq_errors'] ?? null; + $this->container['compute_resource_limit_exceeded'] = $data['compute_resource_limit_exceeded'] ?? null; + $this->container['compute_heap_limit_exceeded'] = $data['compute_heap_limit_exceeded'] ?? null; + $this->container['compute_stack_limit_exceeded'] = $data['compute_stack_limit_exceeded'] ?? null; + $this->container['compute_globals_limit_exceeded'] = $data['compute_globals_limit_exceeded'] ?? null; + $this->container['compute_guest_errors'] = $data['compute_guest_errors'] ?? null; + $this->container['compute_runtime_errors'] = $data['compute_runtime_errors'] ?? null; + $this->container['edge_hit_resp_body_bytes'] = $data['edge_hit_resp_body_bytes'] ?? null; + $this->container['edge_hit_resp_header_bytes'] = $data['edge_hit_resp_header_bytes'] ?? null; + $this->container['edge_miss_resp_body_bytes'] = $data['edge_miss_resp_body_bytes'] ?? null; + $this->container['edge_miss_resp_header_bytes'] = $data['edge_miss_resp_header_bytes'] ?? null; + $this->container['origin_cache_fetch_resp_body_bytes'] = $data['origin_cache_fetch_resp_body_bytes'] ?? null; + $this->container['origin_cache_fetch_resp_header_bytes'] = $data['origin_cache_fetch_resp_header_bytes'] ?? null; + $this->container['shield_hit_requests'] = $data['shield_hit_requests'] ?? null; + $this->container['shield_miss_requests'] = $data['shield_miss_requests'] ?? null; + $this->container['shield_hit_resp_header_bytes'] = $data['shield_hit_resp_header_bytes'] ?? null; + $this->container['shield_hit_resp_body_bytes'] = $data['shield_hit_resp_body_bytes'] ?? null; + $this->container['shield_miss_resp_header_bytes'] = $data['shield_miss_resp_header_bytes'] ?? null; + $this->container['shield_miss_resp_body_bytes'] = $data['shield_miss_resp_body_bytes'] ?? null; + $this->container['websocket_req_header_bytes'] = $data['websocket_req_header_bytes'] ?? null; + $this->container['websocket_req_body_bytes'] = $data['websocket_req_body_bytes'] ?? null; + $this->container['websocket_resp_header_bytes'] = $data['websocket_resp_header_bytes'] ?? null; + $this->container['websocket_bereq_header_bytes'] = $data['websocket_bereq_header_bytes'] ?? null; + $this->container['websocket_bereq_body_bytes'] = $data['websocket_bereq_body_bytes'] ?? null; + $this->container['websocket_beresp_header_bytes'] = $data['websocket_beresp_header_bytes'] ?? null; + $this->container['websocket_beresp_body_bytes'] = $data['websocket_beresp_body_bytes'] ?? null; + $this->container['websocket_conn_time_ms'] = $data['websocket_conn_time_ms'] ?? null; + $this->container['websocket_resp_body_bytes'] = $data['websocket_resp_body_bytes'] ?? null; + $this->container['fanout_recv_publishes'] = $data['fanout_recv_publishes'] ?? null; + $this->container['fanout_send_publishes'] = $data['fanout_send_publishes'] ?? null; + $this->container['kv_store_class_a_operations'] = $data['kv_store_class_a_operations'] ?? null; + $this->container['kv_store_class_b_operations'] = $data['kv_store_class_b_operations'] ?? null; + $this->container['object_store_class_a_operations'] = $data['object_store_class_a_operations'] ?? null; + $this->container['object_store_class_b_operations'] = $data['object_store_class_b_operations'] ?? null; + $this->container['fanout_req_header_bytes'] = $data['fanout_req_header_bytes'] ?? null; + $this->container['fanout_req_body_bytes'] = $data['fanout_req_body_bytes'] ?? null; + $this->container['fanout_resp_header_bytes'] = $data['fanout_resp_header_bytes'] ?? null; + $this->container['fanout_resp_body_bytes'] = $data['fanout_resp_body_bytes'] ?? null; + $this->container['fanout_bereq_header_bytes'] = $data['fanout_bereq_header_bytes'] ?? null; + $this->container['fanout_bereq_body_bytes'] = $data['fanout_bereq_body_bytes'] ?? null; + $this->container['fanout_beresp_header_bytes'] = $data['fanout_beresp_header_bytes'] ?? null; + $this->container['fanout_beresp_body_bytes'] = $data['fanout_beresp_body_bytes'] ?? null; + $this->container['fanout_conn_time_ms'] = $data['fanout_conn_time_ms'] ?? null; + $this->container['ddos_action_limit_streams_connections'] = $data['ddos_action_limit_streams_connections'] ?? null; + $this->container['ddos_action_limit_streams_requests'] = $data['ddos_action_limit_streams_requests'] ?? null; + $this->container['ddos_action_tarpit_accept'] = $data['ddos_action_tarpit_accept'] ?? null; + $this->container['ddos_action_tarpit'] = $data['ddos_action_tarpit'] ?? null; + $this->container['ddos_action_close'] = $data['ddos_action_close'] ?? null; + $this->container['ddos_action_blackhole'] = $data['ddos_action_blackhole'] ?? 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 requests + * + * @return int|null + */ + public function getRequests() + { + return $this->container['requests']; + } + + /** + * Sets requests + * + * @param int|null $requests Number of requests processed. + * + * @return self + */ + public function setRequests($requests) + { + $this->container['requests'] = $requests; + + return $this; + } + + /** + * Gets logging + * + * @return int|null + */ + public function getLogging() + { + return $this->container['logging']; + } + + /** + * Sets logging + * + * @param int|null $logging Number of log lines sent (alias for `log`). + * + * @return self + */ + public function setLogging($logging) + { + $this->container['logging'] = $logging; + + return $this; + } + + /** + * Gets log + * + * @return int|null + */ + public function getLog() + { + return $this->container['log']; + } + + /** + * Sets log + * + * @param int|null $log Number of log lines sent. + * + * @return self + */ + public function setLog($log) + { + $this->container['log'] = $log; + + return $this; + } + + /** + * Gets resp_header_bytes + * + * @return int|null + */ + public function getRespHeaderBytes() + { + return $this->container['resp_header_bytes']; + } + + /** + * Sets resp_header_bytes + * + * @param int|null $resp_header_bytes Total header bytes delivered (edge_resp_header_bytes + shield_resp_header_bytes). + * + * @return self + */ + public function setRespHeaderBytes($resp_header_bytes) + { + $this->container['resp_header_bytes'] = $resp_header_bytes; + + return $this; + } + + /** + * Gets header_size + * + * @return int|null + */ + public function getHeaderSize() + { + return $this->container['header_size']; + } + + /** + * Sets header_size + * + * @param int|null $header_size Total header bytes delivered (alias for resp_header_bytes). + * + * @return self + */ + public function setHeaderSize($header_size) + { + $this->container['header_size'] = $header_size; + + return $this; + } + + /** + * Gets resp_body_bytes + * + * @return int|null + */ + public function getRespBodyBytes() + { + return $this->container['resp_body_bytes']; + } + + /** + * Sets resp_body_bytes + * + * @param int|null $resp_body_bytes Total body bytes delivered (edge_resp_body_bytes + shield_resp_body_bytes). + * + * @return self + */ + public function setRespBodyBytes($resp_body_bytes) + { + $this->container['resp_body_bytes'] = $resp_body_bytes; + + return $this; + } + + /** + * Gets body_size + * + * @return int|null + */ + public function getBodySize() + { + return $this->container['body_size']; + } + + /** + * Sets body_size + * + * @param int|null $body_size Total body bytes delivered (alias for resp_body_bytes). + * + * @return self + */ + public function setBodySize($body_size) + { + $this->container['body_size'] = $body_size; + + return $this; + } + + /** + * Gets hits + * + * @return int|null + */ + public function getHits() + { + return $this->container['hits']; + } + + /** + * Sets hits + * + * @param int|null $hits Number of cache hits. + * + * @return self + */ + public function setHits($hits) + { + $this->container['hits'] = $hits; + + return $this; + } + + /** + * Gets miss + * + * @return int|null + */ + public function getMiss() + { + return $this->container['miss']; + } + + /** + * Sets miss + * + * @param int|null $miss Number of cache misses. + * + * @return self + */ + public function setMiss($miss) + { + $this->container['miss'] = $miss; + + return $this; + } + + /** + * Gets pass + * + * @return int|null + */ + public function getPass() + { + return $this->container['pass']; + } + + /** + * Sets pass + * + * @param int|null $pass Number of requests that passed through the CDN without being cached. + * + * @return self + */ + public function setPass($pass) + { + $this->container['pass'] = $pass; + + return $this; + } + + /** + * Gets synth + * + * @return int|null + */ + public function getSynth() + { + return $this->container['synth']; + } + + /** + * Sets synth + * + * @param int|null $synth Number of requests that returned a synthetic response (i.e., response objects created with the `synthetic` VCL statement). + * + * @return self + */ + public function setSynth($synth) + { + $this->container['synth'] = $synth; + + return $this; + } + + /** + * Gets errors + * + * @return int|null + */ + public function getErrors() + { + return $this->container['errors']; + } + + /** + * Sets errors + * + * @param int|null $errors Number of cache errors. + * + * @return self + */ + public function setErrors($errors) + { + $this->container['errors'] = $errors; + + return $this; + } + + /** + * Gets hits_time + * + * @return float|null + */ + public function getHitsTime() + { + return $this->container['hits_time']; + } + + /** + * Sets hits_time + * + * @param float|null $hits_time Total amount of time spent processing cache hits (in seconds). + * + * @return self + */ + public function setHitsTime($hits_time) + { + $this->container['hits_time'] = $hits_time; + + return $this; + } + + /** + * Gets miss_time + * + * @return float|null + */ + public function getMissTime() + { + return $this->container['miss_time']; + } + + /** + * Sets miss_time + * + * @param float|null $miss_time Total amount of time spent processing cache misses (in seconds). + * + * @return self + */ + public function setMissTime($miss_time) + { + $this->container['miss_time'] = $miss_time; + + return $this; + } + + /** + * Gets miss_histogram + * + * @return array|null + */ + public function getMissHistogram() + { + return $this->container['miss_histogram']; + } + + /** + * Sets miss_histogram + * + * @param array|null $miss_histogram A histogram. Each key represents the upper bound of a span of 10 milliseconds and the values represent the number of requests to origin during that 10ms period. Any origin request that takes more than 60 seconds to return will be in the 60000 bucket. + * + * @return self + */ + public function setMissHistogram($miss_histogram) + { + $this->container['miss_histogram'] = $miss_histogram; + + return $this; + } + + /** + * Gets compute_requests + * + * @return int|null + */ + public function getComputeRequests() + { + return $this->container['compute_requests']; + } + + /** + * Sets compute_requests + * + * @param int|null $compute_requests The total number of requests that were received for your service by Fastly. + * + * @return self + */ + public function setComputeRequests($compute_requests) + { + $this->container['compute_requests'] = $compute_requests; + + return $this; + } + + /** + * Gets compute_execution_time_ms + * + * @return float|null + */ + public function getComputeExecutionTimeMs() + { + return $this->container['compute_execution_time_ms']; + } + + /** + * Sets compute_execution_time_ms + * + * @param float|null $compute_execution_time_ms The amount of active CPU time used to process your requests (in milliseconds). + * + * @return self + */ + public function setComputeExecutionTimeMs($compute_execution_time_ms) + { + $this->container['compute_execution_time_ms'] = $compute_execution_time_ms; + + return $this; + } + + /** + * Gets compute_ram_used + * + * @return int|null + */ + public function getComputeRamUsed() + { + return $this->container['compute_ram_used']; + } + + /** + * Sets compute_ram_used + * + * @param int|null $compute_ram_used The amount of RAM used for your service by Fastly (in bytes). + * + * @return self + */ + public function setComputeRamUsed($compute_ram_used) + { + $this->container['compute_ram_used'] = $compute_ram_used; + + return $this; + } + + /** + * Gets compute_request_time_ms + * + * @return float|null + */ + public function getComputeRequestTimeMs() + { + return $this->container['compute_request_time_ms']; + } + + /** + * Sets compute_request_time_ms + * + * @param float|null $compute_request_time_ms The total, actual amount of time used to process your requests, including active CPU time (in milliseconds). + * + * @return self + */ + public function setComputeRequestTimeMs($compute_request_time_ms) + { + $this->container['compute_request_time_ms'] = $compute_request_time_ms; + + return $this; + } + + /** + * Gets compute_request_time_billed_ms + * + * @return float|null + */ + public function getComputeRequestTimeBilledMs() + { + return $this->container['compute_request_time_billed_ms']; + } + + /** + * Sets compute_request_time_billed_ms + * + * @param float|null $compute_request_time_billed_ms The total amount of request processing time you will be billed for, measured in 50 millisecond increments. + * + * @return self + */ + public function setComputeRequestTimeBilledMs($compute_request_time_billed_ms) + { + $this->container['compute_request_time_billed_ms'] = $compute_request_time_billed_ms; + + return $this; + } + + /** + * Gets shield + * + * @return int|null + */ + public function getShield() + { + return $this->container['shield']; + } + + /** + * Sets shield + * + * @param int|null $shield Number of requests from edge to the shield POP. + * + * @return self + */ + public function setShield($shield) + { + $this->container['shield'] = $shield; + + return $this; + } + + /** + * Gets ipv6 + * + * @return int|null + */ + public function getIpv6() + { + return $this->container['ipv6']; + } + + /** + * Sets ipv6 + * + * @param int|null $ipv6 Number of requests that were received over IPv6. + * + * @return self + */ + public function setIpv6($ipv6) + { + $this->container['ipv6'] = $ipv6; + + return $this; + } + + /** + * Gets imgopto + * + * @return int|null + */ + public function getImgopto() + { + return $this->container['imgopto']; + } + + /** + * Sets imgopto + * + * @param int|null $imgopto Number of responses that came from the Fastly Image Optimizer service. If the service receives 10 requests for an image, this stat will be 10 regardless of how many times the image was transformed. + * + * @return self + */ + public function setImgopto($imgopto) + { + $this->container['imgopto'] = $imgopto; + + return $this; + } + + /** + * Gets imgopto_shield + * + * @return int|null + */ + public function getImgoptoShield() + { + return $this->container['imgopto_shield']; + } + + /** + * Sets imgopto_shield + * + * @param int|null $imgopto_shield Number of responses that came from the Fastly Image Optimizer service via a shield. + * + * @return self + */ + public function setImgoptoShield($imgopto_shield) + { + $this->container['imgopto_shield'] = $imgopto_shield; + + return $this; + } + + /** + * Gets imgopto_transforms + * + * @return int|null + */ + public function getImgoptoTransforms() + { + return $this->container['imgopto_transforms']; + } + + /** + * Sets imgopto_transforms + * + * @param int|null $imgopto_transforms Number of transforms performed by the Fastly Image Optimizer service. + * + * @return self + */ + public function setImgoptoTransforms($imgopto_transforms) + { + $this->container['imgopto_transforms'] = $imgopto_transforms; + + return $this; + } + + /** + * Gets otfp + * + * @return int|null + */ + public function getOtfp() + { + return $this->container['otfp']; + } + + /** + * Sets otfp + * + * @param int|null $otfp Number of responses that came from the Fastly On-the-Fly Packaging service for video-on-demand. + * + * @return self + */ + public function setOtfp($otfp) + { + $this->container['otfp'] = $otfp; + + return $this; + } + + /** + * Gets otfp_shield + * + * @return int|null + */ + public function getOtfpShield() + { + return $this->container['otfp_shield']; + } + + /** + * Sets otfp_shield + * + * @param int|null $otfp_shield Number of responses that came from the Fastly On-the-Fly Packaging service for video-on-demand via a shield. + * + * @return self + */ + public function setOtfpShield($otfp_shield) + { + $this->container['otfp_shield'] = $otfp_shield; + + return $this; + } + + /** + * Gets otfp_manifests + * + * @return int|null + */ + public function getOtfpManifests() + { + return $this->container['otfp_manifests']; + } + + /** + * Sets otfp_manifests + * + * @param int|null $otfp_manifests Number of responses that were manifest files from the Fastly On-the-Fly Packaging service for video-on-demand. + * + * @return self + */ + public function setOtfpManifests($otfp_manifests) + { + $this->container['otfp_manifests'] = $otfp_manifests; + + return $this; + } + + /** + * Gets video + * + * @return int|null + */ + public function getVideo() + { + return $this->container['video']; + } + + /** + * Sets video + * + * @param int|null $video Number of responses with the video segment or video manifest MIME type (i.e., application/x-mpegurl, application/vnd.apple.mpegurl, application/f4m, application/dash+xml, application/vnd.ms-sstr+xml, ideo/mp2t, audio/aac, video/f4f, video/x-flv, video/mp4, audio/mp4). + * + * @return self + */ + public function setVideo($video) + { + $this->container['video'] = $video; + + return $this; + } + + /** + * Gets pci + * + * @return int|null + */ + public function getPci() + { + return $this->container['pci']; + } + + /** + * Sets pci + * + * @param int|null $pci Number of responses with the PCI flag turned on. + * + * @return self + */ + public function setPci($pci) + { + $this->container['pci'] = $pci; + + return $this; + } + + /** + * Gets http2 + * + * @return int|null + */ + public function getHttp2() + { + return $this->container['http2']; + } + + /** + * Sets http2 + * + * @param int|null $http2 Number of requests received over HTTP/2. + * + * @return self + */ + public function setHttp2($http2) + { + $this->container['http2'] = $http2; + + return $this; + } + + /** + * Gets http3 + * + * @return int|null + */ + public function getHttp3() + { + return $this->container['http3']; + } + + /** + * Sets http3 + * + * @param int|null $http3 Number of requests received over HTTP/3. + * + * @return self + */ + public function setHttp3($http3) + { + $this->container['http3'] = $http3; + + return $this; + } + + /** + * Gets restarts + * + * @return int|null + */ + public function getRestarts() + { + return $this->container['restarts']; + } + + /** + * Sets restarts + * + * @param int|null $restarts Number of restarts performed. + * + * @return self + */ + public function setRestarts($restarts) + { + $this->container['restarts'] = $restarts; + + return $this; + } + + /** + * Gets req_header_bytes + * + * @return int|null + */ + public function getReqHeaderBytes() + { + return $this->container['req_header_bytes']; + } + + /** + * Sets req_header_bytes + * + * @param int|null $req_header_bytes Total header bytes received. + * + * @return self + */ + public function setReqHeaderBytes($req_header_bytes) + { + $this->container['req_header_bytes'] = $req_header_bytes; + + return $this; + } + + /** + * Gets req_body_bytes + * + * @return int|null + */ + public function getReqBodyBytes() + { + return $this->container['req_body_bytes']; + } + + /** + * Sets req_body_bytes + * + * @param int|null $req_body_bytes Total body bytes received. + * + * @return self + */ + public function setReqBodyBytes($req_body_bytes) + { + $this->container['req_body_bytes'] = $req_body_bytes; + + return $this; + } + + /** + * Gets bereq_header_bytes + * + * @return int|null + */ + public function getBereqHeaderBytes() + { + return $this->container['bereq_header_bytes']; + } + + /** + * Sets bereq_header_bytes + * + * @param int|null $bereq_header_bytes Total header bytes sent to origin. + * + * @return self + */ + public function setBereqHeaderBytes($bereq_header_bytes) + { + $this->container['bereq_header_bytes'] = $bereq_header_bytes; + + return $this; + } + + /** + * Gets bereq_body_bytes + * + * @return int|null + */ + public function getBereqBodyBytes() + { + return $this->container['bereq_body_bytes']; + } + + /** + * Sets bereq_body_bytes + * + * @param int|null $bereq_body_bytes Total body bytes sent to origin. + * + * @return self + */ + public function setBereqBodyBytes($bereq_body_bytes) + { + $this->container['bereq_body_bytes'] = $bereq_body_bytes; + + return $this; + } + + /** + * Gets waf_blocked + * + * @return int|null + */ + public function getWafBlocked() + { + return $this->container['waf_blocked']; + } + + /** + * Sets waf_blocked + * + * @param int|null $waf_blocked Number of requests that triggered a WAF rule and were blocked. + * + * @return self + */ + public function setWafBlocked($waf_blocked) + { + $this->container['waf_blocked'] = $waf_blocked; + + return $this; + } + + /** + * Gets waf_logged + * + * @return int|null + */ + public function getWafLogged() + { + return $this->container['waf_logged']; + } + + /** + * Sets waf_logged + * + * @param int|null $waf_logged Number of requests that triggered a WAF rule and were logged. + * + * @return self + */ + public function setWafLogged($waf_logged) + { + $this->container['waf_logged'] = $waf_logged; + + return $this; + } + + /** + * Gets waf_passed + * + * @return int|null + */ + public function getWafPassed() + { + return $this->container['waf_passed']; + } + + /** + * Sets waf_passed + * + * @param int|null $waf_passed Number of requests that triggered a WAF rule and were passed. + * + * @return self + */ + public function setWafPassed($waf_passed) + { + $this->container['waf_passed'] = $waf_passed; + + return $this; + } + + /** + * Gets attack_req_header_bytes + * + * @return int|null + */ + public function getAttackReqHeaderBytes() + { + return $this->container['attack_req_header_bytes']; + } + + /** + * Sets attack_req_header_bytes + * + * @param int|null $attack_req_header_bytes Total header bytes received from requests that triggered a WAF rule. + * + * @return self + */ + public function setAttackReqHeaderBytes($attack_req_header_bytes) + { + $this->container['attack_req_header_bytes'] = $attack_req_header_bytes; + + return $this; + } + + /** + * Gets attack_req_body_bytes + * + * @return int|null + */ + public function getAttackReqBodyBytes() + { + return $this->container['attack_req_body_bytes']; + } + + /** + * Sets attack_req_body_bytes + * + * @param int|null $attack_req_body_bytes Total body bytes received from requests that triggered a WAF rule. + * + * @return self + */ + public function setAttackReqBodyBytes($attack_req_body_bytes) + { + $this->container['attack_req_body_bytes'] = $attack_req_body_bytes; + + return $this; + } + + /** + * Gets attack_resp_synth_bytes + * + * @return int|null + */ + public function getAttackRespSynthBytes() + { + return $this->container['attack_resp_synth_bytes']; + } + + /** + * Sets attack_resp_synth_bytes + * + * @param int|null $attack_resp_synth_bytes Total bytes delivered for requests that triggered a WAF rule and returned a synthetic response. + * + * @return self + */ + public function setAttackRespSynthBytes($attack_resp_synth_bytes) + { + $this->container['attack_resp_synth_bytes'] = $attack_resp_synth_bytes; + + return $this; + } + + /** + * Gets attack_logged_req_header_bytes + * + * @return int|null + */ + public function getAttackLoggedReqHeaderBytes() + { + return $this->container['attack_logged_req_header_bytes']; + } + + /** + * Sets attack_logged_req_header_bytes + * + * @param int|null $attack_logged_req_header_bytes Total header bytes received from requests that triggered a WAF rule that was logged. + * + * @return self + */ + public function setAttackLoggedReqHeaderBytes($attack_logged_req_header_bytes) + { + $this->container['attack_logged_req_header_bytes'] = $attack_logged_req_header_bytes; + + return $this; + } + + /** + * Gets attack_logged_req_body_bytes + * + * @return int|null + */ + public function getAttackLoggedReqBodyBytes() + { + return $this->container['attack_logged_req_body_bytes']; + } + + /** + * Sets attack_logged_req_body_bytes + * + * @param int|null $attack_logged_req_body_bytes Total body bytes received from requests that triggered a WAF rule that was logged. + * + * @return self + */ + public function setAttackLoggedReqBodyBytes($attack_logged_req_body_bytes) + { + $this->container['attack_logged_req_body_bytes'] = $attack_logged_req_body_bytes; + + return $this; + } + + /** + * Gets attack_blocked_req_header_bytes + * + * @return int|null + */ + public function getAttackBlockedReqHeaderBytes() + { + return $this->container['attack_blocked_req_header_bytes']; + } + + /** + * Sets attack_blocked_req_header_bytes + * + * @param int|null $attack_blocked_req_header_bytes Total header bytes received from requests that triggered a WAF rule that was blocked. + * + * @return self + */ + public function setAttackBlockedReqHeaderBytes($attack_blocked_req_header_bytes) + { + $this->container['attack_blocked_req_header_bytes'] = $attack_blocked_req_header_bytes; + + return $this; + } + + /** + * Gets attack_blocked_req_body_bytes + * + * @return int|null + */ + public function getAttackBlockedReqBodyBytes() + { + return $this->container['attack_blocked_req_body_bytes']; + } + + /** + * Sets attack_blocked_req_body_bytes + * + * @param int|null $attack_blocked_req_body_bytes Total body bytes received from requests that triggered a WAF rule that was blocked. + * + * @return self + */ + public function setAttackBlockedReqBodyBytes($attack_blocked_req_body_bytes) + { + $this->container['attack_blocked_req_body_bytes'] = $attack_blocked_req_body_bytes; + + return $this; + } + + /** + * Gets attack_passed_req_header_bytes + * + * @return int|null + */ + public function getAttackPassedReqHeaderBytes() + { + return $this->container['attack_passed_req_header_bytes']; + } + + /** + * Sets attack_passed_req_header_bytes + * + * @param int|null $attack_passed_req_header_bytes Total header bytes received from requests that triggered a WAF rule that was passed. + * + * @return self + */ + public function setAttackPassedReqHeaderBytes($attack_passed_req_header_bytes) + { + $this->container['attack_passed_req_header_bytes'] = $attack_passed_req_header_bytes; + + return $this; + } + + /** + * Gets attack_passed_req_body_bytes + * + * @return int|null + */ + public function getAttackPassedReqBodyBytes() + { + return $this->container['attack_passed_req_body_bytes']; + } + + /** + * Sets attack_passed_req_body_bytes + * + * @param int|null $attack_passed_req_body_bytes Total body bytes received from requests that triggered a WAF rule that was passed. + * + * @return self + */ + public function setAttackPassedReqBodyBytes($attack_passed_req_body_bytes) + { + $this->container['attack_passed_req_body_bytes'] = $attack_passed_req_body_bytes; + + return $this; + } + + /** + * Gets shield_resp_header_bytes + * + * @return int|null + */ + public function getShieldRespHeaderBytes() + { + return $this->container['shield_resp_header_bytes']; + } + + /** + * Sets shield_resp_header_bytes + * + * @param int|null $shield_resp_header_bytes Total header bytes delivered via a shield. + * + * @return self + */ + public function setShieldRespHeaderBytes($shield_resp_header_bytes) + { + $this->container['shield_resp_header_bytes'] = $shield_resp_header_bytes; + + return $this; + } + + /** + * Gets shield_resp_body_bytes + * + * @return int|null + */ + public function getShieldRespBodyBytes() + { + return $this->container['shield_resp_body_bytes']; + } + + /** + * Sets shield_resp_body_bytes + * + * @param int|null $shield_resp_body_bytes Total body bytes delivered via a shield. + * + * @return self + */ + public function setShieldRespBodyBytes($shield_resp_body_bytes) + { + $this->container['shield_resp_body_bytes'] = $shield_resp_body_bytes; + + return $this; + } + + /** + * Gets otfp_resp_header_bytes + * + * @return int|null + */ + public function getOtfpRespHeaderBytes() + { + return $this->container['otfp_resp_header_bytes']; + } + + /** + * Sets otfp_resp_header_bytes + * + * @param int|null $otfp_resp_header_bytes Total header bytes delivered from the Fastly On-the-Fly Packaging service for video-on-demand. + * + * @return self + */ + public function setOtfpRespHeaderBytes($otfp_resp_header_bytes) + { + $this->container['otfp_resp_header_bytes'] = $otfp_resp_header_bytes; + + return $this; + } + + /** + * Gets otfp_resp_body_bytes + * + * @return int|null + */ + public function getOtfpRespBodyBytes() + { + return $this->container['otfp_resp_body_bytes']; + } + + /** + * Sets otfp_resp_body_bytes + * + * @param int|null $otfp_resp_body_bytes Total body bytes delivered from the Fastly On-the-Fly Packaging service for video-on-demand. + * + * @return self + */ + public function setOtfpRespBodyBytes($otfp_resp_body_bytes) + { + $this->container['otfp_resp_body_bytes'] = $otfp_resp_body_bytes; + + return $this; + } + + /** + * Gets otfp_shield_resp_header_bytes + * + * @return int|null + */ + public function getOtfpShieldRespHeaderBytes() + { + return $this->container['otfp_shield_resp_header_bytes']; + } + + /** + * Sets otfp_shield_resp_header_bytes + * + * @param int|null $otfp_shield_resp_header_bytes Total header bytes delivered via a shield for the Fastly On-the-Fly Packaging service for video-on-demand. + * + * @return self + */ + public function setOtfpShieldRespHeaderBytes($otfp_shield_resp_header_bytes) + { + $this->container['otfp_shield_resp_header_bytes'] = $otfp_shield_resp_header_bytes; + + return $this; + } + + /** + * Gets otfp_shield_resp_body_bytes + * + * @return int|null + */ + public function getOtfpShieldRespBodyBytes() + { + return $this->container['otfp_shield_resp_body_bytes']; + } + + /** + * Sets otfp_shield_resp_body_bytes + * + * @param int|null $otfp_shield_resp_body_bytes Total body bytes delivered via a shield for the Fastly On-the-Fly Packaging service for video-on-demand. + * + * @return self + */ + public function setOtfpShieldRespBodyBytes($otfp_shield_resp_body_bytes) + { + $this->container['otfp_shield_resp_body_bytes'] = $otfp_shield_resp_body_bytes; + + return $this; + } + + /** + * Gets otfp_shield_time + * + * @return float|null + */ + public function getOtfpShieldTime() + { + return $this->container['otfp_shield_time']; + } + + /** + * Sets otfp_shield_time + * + * @param float|null $otfp_shield_time Total amount of time spent delivering a response via a shield from the Fastly On-the-Fly Packaging service for video-on-demand (in seconds). + * + * @return self + */ + public function setOtfpShieldTime($otfp_shield_time) + { + $this->container['otfp_shield_time'] = $otfp_shield_time; + + return $this; + } + + /** + * Gets otfp_deliver_time + * + * @return float|null + */ + public function getOtfpDeliverTime() + { + return $this->container['otfp_deliver_time']; + } + + /** + * Sets otfp_deliver_time + * + * @param float|null $otfp_deliver_time Total amount of time spent delivering a response from the Fastly On-the-Fly Packaging service for video-on-demand (in seconds). + * + * @return self + */ + public function setOtfpDeliverTime($otfp_deliver_time) + { + $this->container['otfp_deliver_time'] = $otfp_deliver_time; + + return $this; + } + + /** + * Gets imgopto_resp_header_bytes + * + * @return int|null + */ + public function getImgoptoRespHeaderBytes() + { + return $this->container['imgopto_resp_header_bytes']; + } + + /** + * Sets imgopto_resp_header_bytes + * + * @param int|null $imgopto_resp_header_bytes Total header bytes delivered from the Fastly Image Optimizer service, including shield traffic. + * + * @return self + */ + public function setImgoptoRespHeaderBytes($imgopto_resp_header_bytes) + { + $this->container['imgopto_resp_header_bytes'] = $imgopto_resp_header_bytes; + + return $this; + } + + /** + * Gets imgopto_resp_body_bytes + * + * @return int|null + */ + public function getImgoptoRespBodyBytes() + { + return $this->container['imgopto_resp_body_bytes']; + } + + /** + * Sets imgopto_resp_body_bytes + * + * @param int|null $imgopto_resp_body_bytes Total body bytes delivered from the Fastly Image Optimizer service, including shield traffic. + * + * @return self + */ + public function setImgoptoRespBodyBytes($imgopto_resp_body_bytes) + { + $this->container['imgopto_resp_body_bytes'] = $imgopto_resp_body_bytes; + + return $this; + } + + /** + * Gets imgopto_shield_resp_header_bytes + * + * @return int|null + */ + public function getImgoptoShieldRespHeaderBytes() + { + return $this->container['imgopto_shield_resp_header_bytes']; + } + + /** + * Sets imgopto_shield_resp_header_bytes + * + * @param int|null $imgopto_shield_resp_header_bytes Total header bytes delivered via a shield from the Fastly Image Optimizer service. + * + * @return self + */ + public function setImgoptoShieldRespHeaderBytes($imgopto_shield_resp_header_bytes) + { + $this->container['imgopto_shield_resp_header_bytes'] = $imgopto_shield_resp_header_bytes; + + return $this; + } + + /** + * Gets imgopto_shield_resp_body_bytes + * + * @return int|null + */ + public function getImgoptoShieldRespBodyBytes() + { + return $this->container['imgopto_shield_resp_body_bytes']; + } + + /** + * Sets imgopto_shield_resp_body_bytes + * + * @param int|null $imgopto_shield_resp_body_bytes Total body bytes delivered via a shield from the Fastly Image Optimizer service. + * + * @return self + */ + public function setImgoptoShieldRespBodyBytes($imgopto_shield_resp_body_bytes) + { + $this->container['imgopto_shield_resp_body_bytes'] = $imgopto_shield_resp_body_bytes; + + return $this; + } + + /** + * Gets status_1xx + * + * @return int|null + */ + public function getStatus1xx() + { + return $this->container['status_1xx']; + } + + /** + * Sets status_1xx + * + * @param int|null $status_1xx Number of \"Informational\" category status codes delivered. + * + * @return self + */ + public function setStatus1xx($status_1xx) + { + $this->container['status_1xx'] = $status_1xx; + + return $this; + } + + /** + * Gets status_2xx + * + * @return int|null + */ + public function getStatus2xx() + { + return $this->container['status_2xx']; + } + + /** + * Sets status_2xx + * + * @param int|null $status_2xx Number of \"Success\" status codes delivered. + * + * @return self + */ + public function setStatus2xx($status_2xx) + { + $this->container['status_2xx'] = $status_2xx; + + return $this; + } + + /** + * Gets status_3xx + * + * @return int|null + */ + public function getStatus3xx() + { + return $this->container['status_3xx']; + } + + /** + * Sets status_3xx + * + * @param int|null $status_3xx Number of \"Redirection\" codes delivered. + * + * @return self + */ + public function setStatus3xx($status_3xx) + { + $this->container['status_3xx'] = $status_3xx; + + return $this; + } + + /** + * Gets status_4xx + * + * @return int|null + */ + public function getStatus4xx() + { + return $this->container['status_4xx']; + } + + /** + * Sets status_4xx + * + * @param int|null $status_4xx Number of \"Client Error\" codes delivered. + * + * @return self + */ + public function setStatus4xx($status_4xx) + { + $this->container['status_4xx'] = $status_4xx; + + return $this; + } + + /** + * Gets status_5xx + * + * @return int|null + */ + public function getStatus5xx() + { + return $this->container['status_5xx']; + } + + /** + * Sets status_5xx + * + * @param int|null $status_5xx Number of \"Server Error\" codes delivered. + * + * @return self + */ + public function setStatus5xx($status_5xx) + { + $this->container['status_5xx'] = $status_5xx; + + return $this; + } + + /** + * Gets status_200 + * + * @return int|null + */ + public function getStatus200() + { + return $this->container['status_200']; + } + + /** + * Sets status_200 + * + * @param int|null $status_200 Number of responses sent with status code 200 (Success). + * + * @return self + */ + public function setStatus200($status_200) + { + $this->container['status_200'] = $status_200; + + return $this; + } + + /** + * Gets status_204 + * + * @return int|null + */ + public function getStatus204() + { + return $this->container['status_204']; + } + + /** + * Sets status_204 + * + * @param int|null $status_204 Number of responses sent with status code 204 (No Content). + * + * @return self + */ + public function setStatus204($status_204) + { + $this->container['status_204'] = $status_204; + + return $this; + } + + /** + * Gets status_206 + * + * @return int|null + */ + public function getStatus206() + { + return $this->container['status_206']; + } + + /** + * Sets status_206 + * + * @param int|null $status_206 Number of responses sent with status code 206 (Partial Content). + * + * @return self + */ + public function setStatus206($status_206) + { + $this->container['status_206'] = $status_206; + + return $this; + } + + /** + * Gets status_301 + * + * @return int|null + */ + public function getStatus301() + { + return $this->container['status_301']; + } + + /** + * Sets status_301 + * + * @param int|null $status_301 Number of responses sent with status code 301 (Moved Permanently). + * + * @return self + */ + public function setStatus301($status_301) + { + $this->container['status_301'] = $status_301; + + return $this; + } + + /** + * Gets status_302 + * + * @return int|null + */ + public function getStatus302() + { + return $this->container['status_302']; + } + + /** + * Sets status_302 + * + * @param int|null $status_302 Number of responses sent with status code 302 (Found). + * + * @return self + */ + public function setStatus302($status_302) + { + $this->container['status_302'] = $status_302; + + return $this; + } + + /** + * Gets status_304 + * + * @return int|null + */ + public function getStatus304() + { + return $this->container['status_304']; + } + + /** + * Sets status_304 + * + * @param int|null $status_304 Number of responses sent with status code 304 (Not Modified). + * + * @return self + */ + public function setStatus304($status_304) + { + $this->container['status_304'] = $status_304; + + return $this; + } + + /** + * Gets status_400 + * + * @return int|null + */ + public function getStatus400() + { + return $this->container['status_400']; + } + + /** + * Sets status_400 + * + * @param int|null $status_400 Number of responses sent with status code 400 (Bad Request). + * + * @return self + */ + public function setStatus400($status_400) + { + $this->container['status_400'] = $status_400; + + return $this; + } + + /** + * Gets status_401 + * + * @return int|null + */ + public function getStatus401() + { + return $this->container['status_401']; + } + + /** + * Sets status_401 + * + * @param int|null $status_401 Number of responses sent with status code 401 (Unauthorized). + * + * @return self + */ + public function setStatus401($status_401) + { + $this->container['status_401'] = $status_401; + + return $this; + } + + /** + * Gets status_403 + * + * @return int|null + */ + public function getStatus403() + { + return $this->container['status_403']; + } + + /** + * Sets status_403 + * + * @param int|null $status_403 Number of responses sent with status code 403 (Forbidden). + * + * @return self + */ + public function setStatus403($status_403) + { + $this->container['status_403'] = $status_403; + + return $this; + } + + /** + * Gets status_404 + * + * @return int|null + */ + public function getStatus404() + { + return $this->container['status_404']; + } + + /** + * Sets status_404 + * + * @param int|null $status_404 Number of responses sent with status code 404 (Not Found). + * + * @return self + */ + public function setStatus404($status_404) + { + $this->container['status_404'] = $status_404; + + return $this; + } + + /** + * Gets status_406 + * + * @return int|null + */ + public function getStatus406() + { + return $this->container['status_406']; + } + + /** + * Sets status_406 + * + * @param int|null $status_406 Number of responses sent with status code 406 (Not Acceptable). + * + * @return self + */ + public function setStatus406($status_406) + { + $this->container['status_406'] = $status_406; + + return $this; + } + + /** + * Gets status_416 + * + * @return int|null + */ + public function getStatus416() + { + return $this->container['status_416']; + } + + /** + * Sets status_416 + * + * @param int|null $status_416 Number of responses sent with status code 416 (Range Not Satisfiable). + * + * @return self + */ + public function setStatus416($status_416) + { + $this->container['status_416'] = $status_416; + + return $this; + } + + /** + * Gets status_429 + * + * @return int|null + */ + public function getStatus429() + { + return $this->container['status_429']; + } + + /** + * Sets status_429 + * + * @param int|null $status_429 Number of responses sent with status code 429 (Too Many Requests). + * + * @return self + */ + public function setStatus429($status_429) + { + $this->container['status_429'] = $status_429; + + return $this; + } + + /** + * Gets status_500 + * + * @return int|null + */ + public function getStatus500() + { + return $this->container['status_500']; + } + + /** + * Sets status_500 + * + * @param int|null $status_500 Number of responses sent with status code 500 (Internal Server Error). + * + * @return self + */ + public function setStatus500($status_500) + { + $this->container['status_500'] = $status_500; + + return $this; + } + + /** + * Gets status_501 + * + * @return int|null + */ + public function getStatus501() + { + return $this->container['status_501']; + } + + /** + * Sets status_501 + * + * @param int|null $status_501 Number of responses sent with status code 501 (Not Implemented). + * + * @return self + */ + public function setStatus501($status_501) + { + $this->container['status_501'] = $status_501; + + return $this; + } + + /** + * Gets status_502 + * + * @return int|null + */ + public function getStatus502() + { + return $this->container['status_502']; + } + + /** + * Sets status_502 + * + * @param int|null $status_502 Number of responses sent with status code 502 (Bad Gateway). + * + * @return self + */ + public function setStatus502($status_502) + { + $this->container['status_502'] = $status_502; + + return $this; + } + + /** + * Gets status_503 + * + * @return int|null + */ + public function getStatus503() + { + return $this->container['status_503']; + } + + /** + * Sets status_503 + * + * @param int|null $status_503 Number of responses sent with status code 503 (Service Unavailable). + * + * @return self + */ + public function setStatus503($status_503) + { + $this->container['status_503'] = $status_503; + + return $this; + } + + /** + * Gets status_504 + * + * @return int|null + */ + public function getStatus504() + { + return $this->container['status_504']; + } + + /** + * Sets status_504 + * + * @param int|null $status_504 Number of responses sent with status code 504 (Gateway Timeout). + * + * @return self + */ + public function setStatus504($status_504) + { + $this->container['status_504'] = $status_504; + + return $this; + } + + /** + * Gets status_505 + * + * @return int|null + */ + public function getStatus505() + { + return $this->container['status_505']; + } + + /** + * Sets status_505 + * + * @param int|null $status_505 Number of responses sent with status code 505 (HTTP Version Not Supported). + * + * @return self + */ + public function setStatus505($status_505) + { + $this->container['status_505'] = $status_505; + + return $this; + } + + /** + * Gets uncacheable + * + * @return int|null + */ + public function getUncacheable() + { + return $this->container['uncacheable']; + } + + /** + * Sets uncacheable + * + * @param int|null $uncacheable Number of requests that were designated uncachable. + * + * @return self + */ + public function setUncacheable($uncacheable) + { + $this->container['uncacheable'] = $uncacheable; + + return $this; + } + + /** + * Gets pass_time + * + * @return float|null + */ + public function getPassTime() + { + return $this->container['pass_time']; + } + + /** + * Sets pass_time + * + * @param float|null $pass_time Total amount of time spent processing cache passes (in seconds). + * + * @return self + */ + public function setPassTime($pass_time) + { + $this->container['pass_time'] = $pass_time; + + return $this; + } + + /** + * Gets tls + * + * @return int|null + */ + public function getTls() + { + return $this->container['tls']; + } + + /** + * Sets tls + * + * @param int|null $tls Number of requests that were received over TLS. + * + * @return self + */ + public function setTls($tls) + { + $this->container['tls'] = $tls; + + return $this; + } + + /** + * Gets tls_v10 + * + * @return int|null + */ + public function getTlsV10() + { + return $this->container['tls_v10']; + } + + /** + * Sets tls_v10 + * + * @param int|null $tls_v10 Number of requests received over TLS 1.0. + * + * @return self + */ + public function setTlsV10($tls_v10) + { + $this->container['tls_v10'] = $tls_v10; + + return $this; + } + + /** + * Gets tls_v11 + * + * @return int|null + */ + public function getTlsV11() + { + return $this->container['tls_v11']; + } + + /** + * Sets tls_v11 + * + * @param int|null $tls_v11 Number of requests received over TLS 1.1. + * + * @return self + */ + public function setTlsV11($tls_v11) + { + $this->container['tls_v11'] = $tls_v11; + + return $this; + } + + /** + * Gets tls_v12 + * + * @return int|null + */ + public function getTlsV12() + { + return $this->container['tls_v12']; + } + + /** + * Sets tls_v12 + * + * @param int|null $tls_v12 Number of requests received over TLS 1.2. + * + * @return self + */ + public function setTlsV12($tls_v12) + { + $this->container['tls_v12'] = $tls_v12; + + return $this; + } + + /** + * Gets tls_v13 + * + * @return int|null + */ + public function getTlsV13() + { + return $this->container['tls_v13']; + } + + /** + * Sets tls_v13 + * + * @param int|null $tls_v13 Number of requests received over TLS 1.3. + * + * @return self + */ + public function setTlsV13($tls_v13) + { + $this->container['tls_v13'] = $tls_v13; + + return $this; + } + + /** + * Gets object_size_1k + * + * @return int|null + */ + public function getObjectSize1k() + { + return $this->container['object_size_1k']; + } + + /** + * Sets object_size_1k + * + * @param int|null $object_size_1k Number of objects served that were under 1KB in size. + * + * @return self + */ + public function setObjectSize1k($object_size_1k) + { + $this->container['object_size_1k'] = $object_size_1k; + + return $this; + } + + /** + * Gets object_size_10k + * + * @return int|null + */ + public function getObjectSize10k() + { + return $this->container['object_size_10k']; + } + + /** + * Sets object_size_10k + * + * @param int|null $object_size_10k Number of objects served that were between 1KB and 10KB in size. + * + * @return self + */ + public function setObjectSize10k($object_size_10k) + { + $this->container['object_size_10k'] = $object_size_10k; + + return $this; + } + + /** + * Gets object_size_100k + * + * @return int|null + */ + public function getObjectSize100k() + { + return $this->container['object_size_100k']; + } + + /** + * Sets object_size_100k + * + * @param int|null $object_size_100k Number of objects served that were between 10KB and 100KB in size. + * + * @return self + */ + public function setObjectSize100k($object_size_100k) + { + $this->container['object_size_100k'] = $object_size_100k; + + return $this; + } + + /** + * Gets object_size_1m + * + * @return int|null + */ + public function getObjectSize1m() + { + return $this->container['object_size_1m']; + } + + /** + * Sets object_size_1m + * + * @param int|null $object_size_1m Number of objects served that were between 100KB and 1MB in size. + * + * @return self + */ + public function setObjectSize1m($object_size_1m) + { + $this->container['object_size_1m'] = $object_size_1m; + + return $this; + } + + /** + * Gets object_size_10m + * + * @return int|null + */ + public function getObjectSize10m() + { + return $this->container['object_size_10m']; + } + + /** + * Sets object_size_10m + * + * @param int|null $object_size_10m Number of objects served that were between 1MB and 10MB in size. + * + * @return self + */ + public function setObjectSize10m($object_size_10m) + { + $this->container['object_size_10m'] = $object_size_10m; + + return $this; + } + + /** + * Gets object_size_100m + * + * @return int|null + */ + public function getObjectSize100m() + { + return $this->container['object_size_100m']; + } + + /** + * Sets object_size_100m + * + * @param int|null $object_size_100m Number of objects served that were between 10MB and 100MB in size. + * + * @return self + */ + public function setObjectSize100m($object_size_100m) + { + $this->container['object_size_100m'] = $object_size_100m; + + return $this; + } + + /** + * Gets object_size_1g + * + * @return int|null + */ + public function getObjectSize1g() + { + return $this->container['object_size_1g']; + } + + /** + * Sets object_size_1g + * + * @param int|null $object_size_1g Number of objects served that were between 100MB and 1GB in size. + * + * @return self + */ + public function setObjectSize1g($object_size_1g) + { + $this->container['object_size_1g'] = $object_size_1g; + + return $this; + } + + /** + * Gets object_size_other + * + * @return int|null + */ + public function getObjectSizeOther() + { + return $this->container['object_size_other']; + } + + /** + * Sets object_size_other + * + * @param int|null $object_size_other Number of objects served that were larger than 1GB in size. + * + * @return self + */ + public function setObjectSizeOther($object_size_other) + { + $this->container['object_size_other'] = $object_size_other; + + return $this; + } + + /** + * Gets recv_sub_time + * + * @return float|null + */ + public function getRecvSubTime() + { + return $this->container['recv_sub_time']; + } + + /** + * Sets recv_sub_time + * + * @param float|null $recv_sub_time Time spent inside the `vcl_recv` Varnish subroutine (in nanoseconds). + * + * @return self + */ + public function setRecvSubTime($recv_sub_time) + { + $this->container['recv_sub_time'] = $recv_sub_time; + + return $this; + } + + /** + * Gets recv_sub_count + * + * @return int|null + */ + public function getRecvSubCount() + { + return $this->container['recv_sub_count']; + } + + /** + * Sets recv_sub_count + * + * @param int|null $recv_sub_count Number of executions of the `vcl_recv` Varnish subroutine. + * + * @return self + */ + public function setRecvSubCount($recv_sub_count) + { + $this->container['recv_sub_count'] = $recv_sub_count; + + return $this; + } + + /** + * Gets hash_sub_time + * + * @return float|null + */ + public function getHashSubTime() + { + return $this->container['hash_sub_time']; + } + + /** + * Sets hash_sub_time + * + * @param float|null $hash_sub_time Time spent inside the `vcl_hash` Varnish subroutine (in nanoseconds). + * + * @return self + */ + public function setHashSubTime($hash_sub_time) + { + $this->container['hash_sub_time'] = $hash_sub_time; + + return $this; + } + + /** + * Gets hash_sub_count + * + * @return int|null + */ + public function getHashSubCount() + { + return $this->container['hash_sub_count']; + } + + /** + * Sets hash_sub_count + * + * @param int|null $hash_sub_count Number of executions of the `vcl_hash` Varnish subroutine. + * + * @return self + */ + public function setHashSubCount($hash_sub_count) + { + $this->container['hash_sub_count'] = $hash_sub_count; + + return $this; + } + + /** + * Gets miss_sub_time + * + * @return float|null + */ + public function getMissSubTime() + { + return $this->container['miss_sub_time']; + } + + /** + * Sets miss_sub_time + * + * @param float|null $miss_sub_time Time spent inside the `vcl_miss` Varnish subroutine (in nanoseconds). + * + * @return self + */ + public function setMissSubTime($miss_sub_time) + { + $this->container['miss_sub_time'] = $miss_sub_time; + + return $this; + } + + /** + * Gets miss_sub_count + * + * @return int|null + */ + public function getMissSubCount() + { + return $this->container['miss_sub_count']; + } + + /** + * Sets miss_sub_count + * + * @param int|null $miss_sub_count Number of executions of the `vcl_miss` Varnish subroutine. + * + * @return self + */ + public function setMissSubCount($miss_sub_count) + { + $this->container['miss_sub_count'] = $miss_sub_count; + + return $this; + } + + /** + * Gets fetch_sub_time + * + * @return float|null + */ + public function getFetchSubTime() + { + return $this->container['fetch_sub_time']; + } + + /** + * Sets fetch_sub_time + * + * @param float|null $fetch_sub_time Time spent inside the `vcl_fetch` Varnish subroutine (in nanoseconds). + * + * @return self + */ + public function setFetchSubTime($fetch_sub_time) + { + $this->container['fetch_sub_time'] = $fetch_sub_time; + + return $this; + } + + /** + * Gets fetch_sub_count + * + * @return int|null + */ + public function getFetchSubCount() + { + return $this->container['fetch_sub_count']; + } + + /** + * Sets fetch_sub_count + * + * @param int|null $fetch_sub_count Number of executions of the `vcl_fetch` Varnish subroutine. + * + * @return self + */ + public function setFetchSubCount($fetch_sub_count) + { + $this->container['fetch_sub_count'] = $fetch_sub_count; + + return $this; + } + + /** + * Gets pass_sub_time + * + * @return float|null + */ + public function getPassSubTime() + { + return $this->container['pass_sub_time']; + } + + /** + * Sets pass_sub_time + * + * @param float|null $pass_sub_time Time spent inside the `vcl_pass` Varnish subroutine (in nanoseconds). + * + * @return self + */ + public function setPassSubTime($pass_sub_time) + { + $this->container['pass_sub_time'] = $pass_sub_time; + + return $this; + } + + /** + * Gets pass_sub_count + * + * @return int|null + */ + public function getPassSubCount() + { + return $this->container['pass_sub_count']; + } + + /** + * Sets pass_sub_count + * + * @param int|null $pass_sub_count Number of executions of the `vcl_pass` Varnish subroutine. + * + * @return self + */ + public function setPassSubCount($pass_sub_count) + { + $this->container['pass_sub_count'] = $pass_sub_count; + + return $this; + } + + /** + * Gets pipe_sub_time + * + * @return float|null + */ + public function getPipeSubTime() + { + return $this->container['pipe_sub_time']; + } + + /** + * Sets pipe_sub_time + * + * @param float|null $pipe_sub_time Time spent inside the `vcl_pipe` Varnish subroutine (in nanoseconds). + * + * @return self + */ + public function setPipeSubTime($pipe_sub_time) + { + $this->container['pipe_sub_time'] = $pipe_sub_time; + + return $this; + } + + /** + * Gets pipe_sub_count + * + * @return int|null + */ + public function getPipeSubCount() + { + return $this->container['pipe_sub_count']; + } + + /** + * Sets pipe_sub_count + * + * @param int|null $pipe_sub_count Number of executions of the `vcl_pipe` Varnish subroutine. + * + * @return self + */ + public function setPipeSubCount($pipe_sub_count) + { + $this->container['pipe_sub_count'] = $pipe_sub_count; + + return $this; + } + + /** + * Gets deliver_sub_time + * + * @return float|null + */ + public function getDeliverSubTime() + { + return $this->container['deliver_sub_time']; + } + + /** + * Sets deliver_sub_time + * + * @param float|null $deliver_sub_time Time spent inside the `vcl_deliver` Varnish subroutine (in nanoseconds). + * + * @return self + */ + public function setDeliverSubTime($deliver_sub_time) + { + $this->container['deliver_sub_time'] = $deliver_sub_time; + + return $this; + } + + /** + * Gets deliver_sub_count + * + * @return int|null + */ + public function getDeliverSubCount() + { + return $this->container['deliver_sub_count']; + } + + /** + * Sets deliver_sub_count + * + * @param int|null $deliver_sub_count Number of executions of the `vcl_deliver` Varnish subroutine. + * + * @return self + */ + public function setDeliverSubCount($deliver_sub_count) + { + $this->container['deliver_sub_count'] = $deliver_sub_count; + + return $this; + } + + /** + * Gets error_sub_time + * + * @return float|null + */ + public function getErrorSubTime() + { + return $this->container['error_sub_time']; + } + + /** + * Sets error_sub_time + * + * @param float|null $error_sub_time Time spent inside the `vcl_error` Varnish subroutine (in nanoseconds). + * + * @return self + */ + public function setErrorSubTime($error_sub_time) + { + $this->container['error_sub_time'] = $error_sub_time; + + return $this; + } + + /** + * Gets error_sub_count + * + * @return int|null + */ + public function getErrorSubCount() + { + return $this->container['error_sub_count']; + } + + /** + * Sets error_sub_count + * + * @param int|null $error_sub_count Number of executions of the `vcl_error` Varnish subroutine. + * + * @return self + */ + public function setErrorSubCount($error_sub_count) + { + $this->container['error_sub_count'] = $error_sub_count; + + return $this; + } + + /** + * Gets hit_sub_time + * + * @return float|null + */ + public function getHitSubTime() + { + return $this->container['hit_sub_time']; + } + + /** + * Sets hit_sub_time + * + * @param float|null $hit_sub_time Time spent inside the `vcl_hit` Varnish subroutine (in nanoseconds). + * + * @return self + */ + public function setHitSubTime($hit_sub_time) + { + $this->container['hit_sub_time'] = $hit_sub_time; + + return $this; + } + + /** + * Gets hit_sub_count + * + * @return int|null + */ + public function getHitSubCount() + { + return $this->container['hit_sub_count']; + } + + /** + * Sets hit_sub_count + * + * @param int|null $hit_sub_count Number of executions of the `vcl_hit` Varnish subroutine. + * + * @return self + */ + public function setHitSubCount($hit_sub_count) + { + $this->container['hit_sub_count'] = $hit_sub_count; + + return $this; + } + + /** + * Gets prehash_sub_time + * + * @return float|null + */ + public function getPrehashSubTime() + { + return $this->container['prehash_sub_time']; + } + + /** + * Sets prehash_sub_time + * + * @param float|null $prehash_sub_time Time spent inside the `vcl_prehash` Varnish subroutine (in nanoseconds). + * + * @return self + */ + public function setPrehashSubTime($prehash_sub_time) + { + $this->container['prehash_sub_time'] = $prehash_sub_time; + + return $this; + } + + /** + * Gets prehash_sub_count + * + * @return int|null + */ + public function getPrehashSubCount() + { + return $this->container['prehash_sub_count']; + } + + /** + * Sets prehash_sub_count + * + * @param int|null $prehash_sub_count Number of executions of the `vcl_prehash` Varnish subroutine. + * + * @return self + */ + public function setPrehashSubCount($prehash_sub_count) + { + $this->container['prehash_sub_count'] = $prehash_sub_count; + + return $this; + } + + /** + * Gets predeliver_sub_time + * + * @return float|null + */ + public function getPredeliverSubTime() + { + return $this->container['predeliver_sub_time']; + } + + /** + * Sets predeliver_sub_time + * + * @param float|null $predeliver_sub_time Time spent inside the `vcl_predeliver` Varnish subroutine (in nanoseconds). + * + * @return self + */ + public function setPredeliverSubTime($predeliver_sub_time) + { + $this->container['predeliver_sub_time'] = $predeliver_sub_time; + + return $this; + } + + /** + * Gets predeliver_sub_count + * + * @return int|null + */ + public function getPredeliverSubCount() + { + return $this->container['predeliver_sub_count']; + } + + /** + * Sets predeliver_sub_count + * + * @param int|null $predeliver_sub_count Number of executions of the `vcl_predeliver` Varnish subroutine. + * + * @return self + */ + public function setPredeliverSubCount($predeliver_sub_count) + { + $this->container['predeliver_sub_count'] = $predeliver_sub_count; + + return $this; + } + + /** + * Gets hit_resp_body_bytes + * + * @return int|null + */ + public function getHitRespBodyBytes() + { + return $this->container['hit_resp_body_bytes']; + } + + /** + * Sets hit_resp_body_bytes + * + * @param int|null $hit_resp_body_bytes Total body bytes delivered for cache hits. + * + * @return self + */ + public function setHitRespBodyBytes($hit_resp_body_bytes) + { + $this->container['hit_resp_body_bytes'] = $hit_resp_body_bytes; + + return $this; + } + + /** + * Gets miss_resp_body_bytes + * + * @return int|null + */ + public function getMissRespBodyBytes() + { + return $this->container['miss_resp_body_bytes']; + } + + /** + * Sets miss_resp_body_bytes + * + * @param int|null $miss_resp_body_bytes Total body bytes delivered for cache misses. + * + * @return self + */ + public function setMissRespBodyBytes($miss_resp_body_bytes) + { + $this->container['miss_resp_body_bytes'] = $miss_resp_body_bytes; + + return $this; + } + + /** + * Gets pass_resp_body_bytes + * + * @return int|null + */ + public function getPassRespBodyBytes() + { + return $this->container['pass_resp_body_bytes']; + } + + /** + * Sets pass_resp_body_bytes + * + * @param int|null $pass_resp_body_bytes Total body bytes delivered for cache passes. + * + * @return self + */ + public function setPassRespBodyBytes($pass_resp_body_bytes) + { + $this->container['pass_resp_body_bytes'] = $pass_resp_body_bytes; + + return $this; + } + + /** + * Gets compute_req_header_bytes + * + * @return int|null + */ + public function getComputeReqHeaderBytes() + { + return $this->container['compute_req_header_bytes']; + } + + /** + * Sets compute_req_header_bytes + * + * @param int|null $compute_req_header_bytes Total header bytes received by Compute@Edge. + * + * @return self + */ + public function setComputeReqHeaderBytes($compute_req_header_bytes) + { + $this->container['compute_req_header_bytes'] = $compute_req_header_bytes; + + return $this; + } + + /** + * Gets compute_req_body_bytes + * + * @return int|null + */ + public function getComputeReqBodyBytes() + { + return $this->container['compute_req_body_bytes']; + } + + /** + * Sets compute_req_body_bytes + * + * @param int|null $compute_req_body_bytes Total body bytes received by Compute@Edge. + * + * @return self + */ + public function setComputeReqBodyBytes($compute_req_body_bytes) + { + $this->container['compute_req_body_bytes'] = $compute_req_body_bytes; + + return $this; + } + + /** + * Gets compute_resp_header_bytes + * + * @return int|null + */ + public function getComputeRespHeaderBytes() + { + return $this->container['compute_resp_header_bytes']; + } + + /** + * Sets compute_resp_header_bytes + * + * @param int|null $compute_resp_header_bytes Total header bytes sent from Compute@Edge to end user. + * + * @return self + */ + public function setComputeRespHeaderBytes($compute_resp_header_bytes) + { + $this->container['compute_resp_header_bytes'] = $compute_resp_header_bytes; + + return $this; + } + + /** + * Gets compute_resp_body_bytes + * + * @return int|null + */ + public function getComputeRespBodyBytes() + { + return $this->container['compute_resp_body_bytes']; + } + + /** + * Sets compute_resp_body_bytes + * + * @param int|null $compute_resp_body_bytes Total body bytes sent from Compute@Edge to end user. + * + * @return self + */ + public function setComputeRespBodyBytes($compute_resp_body_bytes) + { + $this->container['compute_resp_body_bytes'] = $compute_resp_body_bytes; + + return $this; + } + + /** + * Gets imgvideo + * + * @return int|null + */ + public function getImgvideo() + { + return $this->container['imgvideo']; + } + + /** + * Sets imgvideo + * + * @param int|null $imgvideo Number of video responses that came from the Fastly Image Optimizer service. + * + * @return self + */ + public function setImgvideo($imgvideo) + { + $this->container['imgvideo'] = $imgvideo; + + return $this; + } + + /** + * Gets imgvideo_frames + * + * @return int|null + */ + public function getImgvideoFrames() + { + return $this->container['imgvideo_frames']; + } + + /** + * Sets imgvideo_frames + * + * @param int|null $imgvideo_frames Number of video frames that came from the Fastly Image Optimizer service. A video frame is an individual image within a sequence of video. + * + * @return self + */ + public function setImgvideoFrames($imgvideo_frames) + { + $this->container['imgvideo_frames'] = $imgvideo_frames; + + return $this; + } + + /** + * Gets imgvideo_resp_header_bytes + * + * @return int|null + */ + public function getImgvideoRespHeaderBytes() + { + return $this->container['imgvideo_resp_header_bytes']; + } + + /** + * Sets imgvideo_resp_header_bytes + * + * @param int|null $imgvideo_resp_header_bytes Total header bytes of video delivered from the Fastly Image Optimizer service. + * + * @return self + */ + public function setImgvideoRespHeaderBytes($imgvideo_resp_header_bytes) + { + $this->container['imgvideo_resp_header_bytes'] = $imgvideo_resp_header_bytes; + + return $this; + } + + /** + * Gets imgvideo_resp_body_bytes + * + * @return int|null + */ + public function getImgvideoRespBodyBytes() + { + return $this->container['imgvideo_resp_body_bytes']; + } + + /** + * Sets imgvideo_resp_body_bytes + * + * @param int|null $imgvideo_resp_body_bytes Total body bytes of video delivered from the Fastly Image Optimizer service. + * + * @return self + */ + public function setImgvideoRespBodyBytes($imgvideo_resp_body_bytes) + { + $this->container['imgvideo_resp_body_bytes'] = $imgvideo_resp_body_bytes; + + return $this; + } + + /** + * Gets imgvideo_shield + * + * @return int|null + */ + public function getImgvideoShield() + { + return $this->container['imgvideo_shield']; + } + + /** + * Sets imgvideo_shield + * + * @param int|null $imgvideo_shield Number of video responses delivered via a shield that came from the Fastly Image Optimizer service. + * + * @return self + */ + public function setImgvideoShield($imgvideo_shield) + { + $this->container['imgvideo_shield'] = $imgvideo_shield; + + return $this; + } + + /** + * Gets imgvideo_shield_frames + * + * @return int|null + */ + public function getImgvideoShieldFrames() + { + return $this->container['imgvideo_shield_frames']; + } + + /** + * Sets imgvideo_shield_frames + * + * @param int|null $imgvideo_shield_frames Number of video frames delivered via a shield that came from the Fastly Image Optimizer service. A video frame is an individual image within a sequence of video. + * + * @return self + */ + public function setImgvideoShieldFrames($imgvideo_shield_frames) + { + $this->container['imgvideo_shield_frames'] = $imgvideo_shield_frames; + + return $this; + } + + /** + * Gets imgvideo_shield_resp_header_bytes + * + * @return int|null + */ + public function getImgvideoShieldRespHeaderBytes() + { + return $this->container['imgvideo_shield_resp_header_bytes']; + } + + /** + * Sets imgvideo_shield_resp_header_bytes + * + * @param int|null $imgvideo_shield_resp_header_bytes Total header bytes of video delivered via a shield from the Fastly Image Optimizer service. + * + * @return self + */ + public function setImgvideoShieldRespHeaderBytes($imgvideo_shield_resp_header_bytes) + { + $this->container['imgvideo_shield_resp_header_bytes'] = $imgvideo_shield_resp_header_bytes; + + return $this; + } + + /** + * Gets imgvideo_shield_resp_body_bytes + * + * @return int|null + */ + public function getImgvideoShieldRespBodyBytes() + { + return $this->container['imgvideo_shield_resp_body_bytes']; + } + + /** + * Sets imgvideo_shield_resp_body_bytes + * + * @param int|null $imgvideo_shield_resp_body_bytes Total body bytes of video delivered via a shield from the Fastly Image Optimizer service. + * + * @return self + */ + public function setImgvideoShieldRespBodyBytes($imgvideo_shield_resp_body_bytes) + { + $this->container['imgvideo_shield_resp_body_bytes'] = $imgvideo_shield_resp_body_bytes; + + return $this; + } + + /** + * Gets log_bytes + * + * @return int|null + */ + public function getLogBytes() + { + return $this->container['log_bytes']; + } + + /** + * Sets log_bytes + * + * @param int|null $log_bytes Total log bytes sent. + * + * @return self + */ + public function setLogBytes($log_bytes) + { + $this->container['log_bytes'] = $log_bytes; + + return $this; + } + + /** + * Gets edge_requests + * + * @return int|null + */ + public function getEdgeRequests() + { + return $this->container['edge_requests']; + } + + /** + * Sets edge_requests + * + * @param int|null $edge_requests Number of requests sent by end users to Fastly. + * + * @return self + */ + public function setEdgeRequests($edge_requests) + { + $this->container['edge_requests'] = $edge_requests; + + return $this; + } + + /** + * Gets edge_resp_header_bytes + * + * @return int|null + */ + public function getEdgeRespHeaderBytes() + { + return $this->container['edge_resp_header_bytes']; + } + + /** + * Sets edge_resp_header_bytes + * + * @param int|null $edge_resp_header_bytes Total header bytes delivered from Fastly to the end user. + * + * @return self + */ + public function setEdgeRespHeaderBytes($edge_resp_header_bytes) + { + $this->container['edge_resp_header_bytes'] = $edge_resp_header_bytes; + + return $this; + } + + /** + * Gets edge_resp_body_bytes + * + * @return int|null + */ + public function getEdgeRespBodyBytes() + { + return $this->container['edge_resp_body_bytes']; + } + + /** + * Sets edge_resp_body_bytes + * + * @param int|null $edge_resp_body_bytes Total body bytes delivered from Fastly to the end user. + * + * @return self + */ + public function setEdgeRespBodyBytes($edge_resp_body_bytes) + { + $this->container['edge_resp_body_bytes'] = $edge_resp_body_bytes; + + return $this; + } + + /** + * Gets origin_revalidations + * + * @return int|null + */ + public function getOriginRevalidations() + { + return $this->container['origin_revalidations']; + } + + /** + * Sets origin_revalidations + * + * @param int|null $origin_revalidations Number of responses received from origin with a `304` status code in response to an `If-Modified-Since` or `If-None-Match` request. Under regular scenarios, a revalidation will imply a cache hit. However, if using Fastly Image Optimizer or segmented caching this may result in a cache miss. + * + * @return self + */ + public function setOriginRevalidations($origin_revalidations) + { + $this->container['origin_revalidations'] = $origin_revalidations; + + return $this; + } + + /** + * Gets origin_fetches + * + * @return int|null + */ + public function getOriginFetches() + { + return $this->container['origin_fetches']; + } + + /** + * Sets origin_fetches + * + * @param int|null $origin_fetches Number of requests sent to origin. + * + * @return self + */ + public function setOriginFetches($origin_fetches) + { + $this->container['origin_fetches'] = $origin_fetches; + + return $this; + } + + /** + * Gets origin_fetch_header_bytes + * + * @return int|null + */ + public function getOriginFetchHeaderBytes() + { + return $this->container['origin_fetch_header_bytes']; + } + + /** + * Sets origin_fetch_header_bytes + * + * @param int|null $origin_fetch_header_bytes Total request header bytes sent to origin. + * + * @return self + */ + public function setOriginFetchHeaderBytes($origin_fetch_header_bytes) + { + $this->container['origin_fetch_header_bytes'] = $origin_fetch_header_bytes; + + return $this; + } + + /** + * Gets origin_fetch_body_bytes + * + * @return int|null + */ + public function getOriginFetchBodyBytes() + { + return $this->container['origin_fetch_body_bytes']; + } + + /** + * Sets origin_fetch_body_bytes + * + * @param int|null $origin_fetch_body_bytes Total request body bytes sent to origin. + * + * @return self + */ + public function setOriginFetchBodyBytes($origin_fetch_body_bytes) + { + $this->container['origin_fetch_body_bytes'] = $origin_fetch_body_bytes; + + return $this; + } + + /** + * Gets origin_fetch_resp_header_bytes + * + * @return int|null + */ + public function getOriginFetchRespHeaderBytes() + { + return $this->container['origin_fetch_resp_header_bytes']; + } + + /** + * Sets origin_fetch_resp_header_bytes + * + * @param int|null $origin_fetch_resp_header_bytes Total header bytes received from origin. + * + * @return self + */ + public function setOriginFetchRespHeaderBytes($origin_fetch_resp_header_bytes) + { + $this->container['origin_fetch_resp_header_bytes'] = $origin_fetch_resp_header_bytes; + + return $this; + } + + /** + * Gets origin_fetch_resp_body_bytes + * + * @return int|null + */ + public function getOriginFetchRespBodyBytes() + { + return $this->container['origin_fetch_resp_body_bytes']; + } + + /** + * Sets origin_fetch_resp_body_bytes + * + * @param int|null $origin_fetch_resp_body_bytes Total body bytes received from origin. + * + * @return self + */ + public function setOriginFetchRespBodyBytes($origin_fetch_resp_body_bytes) + { + $this->container['origin_fetch_resp_body_bytes'] = $origin_fetch_resp_body_bytes; + + return $this; + } + + /** + * Gets shield_revalidations + * + * @return int|null + */ + public function getShieldRevalidations() + { + return $this->container['shield_revalidations']; + } + + /** + * Sets shield_revalidations + * + * @param int|null $shield_revalidations Number of responses received from origin with a `304` status code, in response to an `If-Modified-Since` or `If-None-Match` request to a shield. Under regular scenarios, a revalidation will imply a cache hit. However, if using segmented caching this may result in a cache miss. + * + * @return self + */ + public function setShieldRevalidations($shield_revalidations) + { + $this->container['shield_revalidations'] = $shield_revalidations; + + return $this; + } + + /** + * Gets shield_fetches + * + * @return int|null + */ + public function getShieldFetches() + { + return $this->container['shield_fetches']; + } + + /** + * Sets shield_fetches + * + * @param int|null $shield_fetches Number of requests made from one Fastly POP to another, as part of shielding. + * + * @return self + */ + public function setShieldFetches($shield_fetches) + { + $this->container['shield_fetches'] = $shield_fetches; + + return $this; + } + + /** + * Gets shield_fetch_header_bytes + * + * @return int|null + */ + public function getShieldFetchHeaderBytes() + { + return $this->container['shield_fetch_header_bytes']; + } + + /** + * Sets shield_fetch_header_bytes + * + * @param int|null $shield_fetch_header_bytes Total request header bytes sent to a shield. + * + * @return self + */ + public function setShieldFetchHeaderBytes($shield_fetch_header_bytes) + { + $this->container['shield_fetch_header_bytes'] = $shield_fetch_header_bytes; + + return $this; + } + + /** + * Gets shield_fetch_body_bytes + * + * @return int|null + */ + public function getShieldFetchBodyBytes() + { + return $this->container['shield_fetch_body_bytes']; + } + + /** + * Sets shield_fetch_body_bytes + * + * @param int|null $shield_fetch_body_bytes Total request body bytes sent to a shield. + * + * @return self + */ + public function setShieldFetchBodyBytes($shield_fetch_body_bytes) + { + $this->container['shield_fetch_body_bytes'] = $shield_fetch_body_bytes; + + return $this; + } + + /** + * Gets shield_fetch_resp_header_bytes + * + * @return int|null + */ + public function getShieldFetchRespHeaderBytes() + { + return $this->container['shield_fetch_resp_header_bytes']; + } + + /** + * Sets shield_fetch_resp_header_bytes + * + * @param int|null $shield_fetch_resp_header_bytes Total response header bytes sent from a shield to the edge. + * + * @return self + */ + public function setShieldFetchRespHeaderBytes($shield_fetch_resp_header_bytes) + { + $this->container['shield_fetch_resp_header_bytes'] = $shield_fetch_resp_header_bytes; + + return $this; + } + + /** + * Gets shield_fetch_resp_body_bytes + * + * @return int|null + */ + public function getShieldFetchRespBodyBytes() + { + return $this->container['shield_fetch_resp_body_bytes']; + } + + /** + * Sets shield_fetch_resp_body_bytes + * + * @param int|null $shield_fetch_resp_body_bytes Total response body bytes sent from a shield to the edge. + * + * @return self + */ + public function setShieldFetchRespBodyBytes($shield_fetch_resp_body_bytes) + { + $this->container['shield_fetch_resp_body_bytes'] = $shield_fetch_resp_body_bytes; + + return $this; + } + + /** + * Gets segblock_origin_fetches + * + * @return int|null + */ + public function getSegblockOriginFetches() + { + return $this->container['segblock_origin_fetches']; + } + + /** + * Sets segblock_origin_fetches + * + * @param int|null $segblock_origin_fetches Number of `Range` requests to origin for segments of resources when using segmented caching. + * + * @return self + */ + public function setSegblockOriginFetches($segblock_origin_fetches) + { + $this->container['segblock_origin_fetches'] = $segblock_origin_fetches; + + return $this; + } + + /** + * Gets segblock_shield_fetches + * + * @return int|null + */ + public function getSegblockShieldFetches() + { + return $this->container['segblock_shield_fetches']; + } + + /** + * Sets segblock_shield_fetches + * + * @param int|null $segblock_shield_fetches Number of `Range` requests to a shield for segments of resources when using segmented caching. + * + * @return self + */ + public function setSegblockShieldFetches($segblock_shield_fetches) + { + $this->container['segblock_shield_fetches'] = $segblock_shield_fetches; + + return $this; + } + + /** + * Gets compute_resp_status_1xx + * + * @return int|null + */ + public function getComputeRespStatus1xx() + { + return $this->container['compute_resp_status_1xx']; + } + + /** + * Sets compute_resp_status_1xx + * + * @param int|null $compute_resp_status_1xx Number of \"Informational\" category status codes delivered by Compute@Edge. + * + * @return self + */ + public function setComputeRespStatus1xx($compute_resp_status_1xx) + { + $this->container['compute_resp_status_1xx'] = $compute_resp_status_1xx; + + return $this; + } + + /** + * Gets compute_resp_status_2xx + * + * @return int|null + */ + public function getComputeRespStatus2xx() + { + return $this->container['compute_resp_status_2xx']; + } + + /** + * Sets compute_resp_status_2xx + * + * @param int|null $compute_resp_status_2xx Number of \"Success\" category status codes delivered by Compute@Edge. + * + * @return self + */ + public function setComputeRespStatus2xx($compute_resp_status_2xx) + { + $this->container['compute_resp_status_2xx'] = $compute_resp_status_2xx; + + return $this; + } + + /** + * Gets compute_resp_status_3xx + * + * @return int|null + */ + public function getComputeRespStatus3xx() + { + return $this->container['compute_resp_status_3xx']; + } + + /** + * Sets compute_resp_status_3xx + * + * @param int|null $compute_resp_status_3xx Number of \"Redirection\" category status codes delivered by Compute@Edge. + * + * @return self + */ + public function setComputeRespStatus3xx($compute_resp_status_3xx) + { + $this->container['compute_resp_status_3xx'] = $compute_resp_status_3xx; + + return $this; + } + + /** + * Gets compute_resp_status_4xx + * + * @return int|null + */ + public function getComputeRespStatus4xx() + { + return $this->container['compute_resp_status_4xx']; + } + + /** + * Sets compute_resp_status_4xx + * + * @param int|null $compute_resp_status_4xx Number of \"Client Error\" category status codes delivered by Compute@Edge. + * + * @return self + */ + public function setComputeRespStatus4xx($compute_resp_status_4xx) + { + $this->container['compute_resp_status_4xx'] = $compute_resp_status_4xx; + + return $this; + } + + /** + * Gets compute_resp_status_5xx + * + * @return int|null + */ + public function getComputeRespStatus5xx() + { + return $this->container['compute_resp_status_5xx']; + } + + /** + * Sets compute_resp_status_5xx + * + * @param int|null $compute_resp_status_5xx Number of \"Server Error\" category status codes delivered by Compute@Edge. + * + * @return self + */ + public function setComputeRespStatus5xx($compute_resp_status_5xx) + { + $this->container['compute_resp_status_5xx'] = $compute_resp_status_5xx; + + return $this; + } + + /** + * Gets edge_hit_requests + * + * @return int|null + */ + public function getEdgeHitRequests() + { + return $this->container['edge_hit_requests']; + } + + /** + * Sets edge_hit_requests + * + * @param int|null $edge_hit_requests Number of requests sent by end users to Fastly that resulted in a hit at the edge. + * + * @return self + */ + public function setEdgeHitRequests($edge_hit_requests) + { + $this->container['edge_hit_requests'] = $edge_hit_requests; + + return $this; + } + + /** + * Gets edge_miss_requests + * + * @return int|null + */ + public function getEdgeMissRequests() + { + return $this->container['edge_miss_requests']; + } + + /** + * Sets edge_miss_requests + * + * @param int|null $edge_miss_requests Number of requests sent by end users to Fastly that resulted in a miss at the edge. + * + * @return self + */ + public function setEdgeMissRequests($edge_miss_requests) + { + $this->container['edge_miss_requests'] = $edge_miss_requests; + + return $this; + } + + /** + * Gets compute_bereq_header_bytes + * + * @return int|null + */ + public function getComputeBereqHeaderBytes() + { + return $this->container['compute_bereq_header_bytes']; + } + + /** + * Sets compute_bereq_header_bytes + * + * @param int|null $compute_bereq_header_bytes Total header bytes sent to backends (origins) by Compute@Edge. + * + * @return self + */ + public function setComputeBereqHeaderBytes($compute_bereq_header_bytes) + { + $this->container['compute_bereq_header_bytes'] = $compute_bereq_header_bytes; + + return $this; + } + + /** + * Gets compute_bereq_body_bytes + * + * @return int|null + */ + public function getComputeBereqBodyBytes() + { + return $this->container['compute_bereq_body_bytes']; + } + + /** + * Sets compute_bereq_body_bytes + * + * @param int|null $compute_bereq_body_bytes Total body bytes sent to backends (origins) by Compute@Edge. + * + * @return self + */ + public function setComputeBereqBodyBytes($compute_bereq_body_bytes) + { + $this->container['compute_bereq_body_bytes'] = $compute_bereq_body_bytes; + + return $this; + } + + /** + * Gets compute_beresp_header_bytes + * + * @return int|null + */ + public function getComputeBerespHeaderBytes() + { + return $this->container['compute_beresp_header_bytes']; + } + + /** + * Sets compute_beresp_header_bytes + * + * @param int|null $compute_beresp_header_bytes Total header bytes received from backends (origins) by Compute@Edge. + * + * @return self + */ + public function setComputeBerespHeaderBytes($compute_beresp_header_bytes) + { + $this->container['compute_beresp_header_bytes'] = $compute_beresp_header_bytes; + + return $this; + } + + /** + * Gets compute_beresp_body_bytes + * + * @return int|null + */ + public function getComputeBerespBodyBytes() + { + return $this->container['compute_beresp_body_bytes']; + } + + /** + * Sets compute_beresp_body_bytes + * + * @param int|null $compute_beresp_body_bytes Total body bytes received from backends (origins) by Compute@Edge. + * + * @return self + */ + public function setComputeBerespBodyBytes($compute_beresp_body_bytes) + { + $this->container['compute_beresp_body_bytes'] = $compute_beresp_body_bytes; + + return $this; + } + + /** + * Gets origin_cache_fetches + * + * @return int|null + */ + public function getOriginCacheFetches() + { + return $this->container['origin_cache_fetches']; + } + + /** + * Sets origin_cache_fetches + * + * @param int|null $origin_cache_fetches The total number of completed requests made to backends (origins) that returned cacheable content. + * + * @return self + */ + public function setOriginCacheFetches($origin_cache_fetches) + { + $this->container['origin_cache_fetches'] = $origin_cache_fetches; + + return $this; + } + + /** + * Gets shield_cache_fetches + * + * @return int|null + */ + public function getShieldCacheFetches() + { + return $this->container['shield_cache_fetches']; + } + + /** + * Sets shield_cache_fetches + * + * @param int|null $shield_cache_fetches The total number of completed requests made to shields that returned cacheable content. + * + * @return self + */ + public function setShieldCacheFetches($shield_cache_fetches) + { + $this->container['shield_cache_fetches'] = $shield_cache_fetches; + + return $this; + } + + /** + * Gets compute_bereqs + * + * @return int|null + */ + public function getComputeBereqs() + { + return $this->container['compute_bereqs']; + } + + /** + * Sets compute_bereqs + * + * @param int|null $compute_bereqs Number of backend requests started. + * + * @return self + */ + public function setComputeBereqs($compute_bereqs) + { + $this->container['compute_bereqs'] = $compute_bereqs; + + return $this; + } + + /** + * Gets compute_bereq_errors + * + * @return int|null + */ + public function getComputeBereqErrors() + { + return $this->container['compute_bereq_errors']; + } + + /** + * Sets compute_bereq_errors + * + * @param int|null $compute_bereq_errors Number of backend request errors, including timeouts. + * + * @return self + */ + public function setComputeBereqErrors($compute_bereq_errors) + { + $this->container['compute_bereq_errors'] = $compute_bereq_errors; + + return $this; + } + + /** + * Gets compute_resource_limit_exceeded + * + * @return int|null + */ + public function getComputeResourceLimitExceeded() + { + return $this->container['compute_resource_limit_exceeded']; + } + + /** + * Sets compute_resource_limit_exceeded + * + * @param int|null $compute_resource_limit_exceeded Number of times a guest exceeded its resource limit, includes heap, stack, globals, and code execution timeout. + * + * @return self + */ + public function setComputeResourceLimitExceeded($compute_resource_limit_exceeded) + { + $this->container['compute_resource_limit_exceeded'] = $compute_resource_limit_exceeded; + + return $this; + } + + /** + * Gets compute_heap_limit_exceeded + * + * @return int|null + */ + public function getComputeHeapLimitExceeded() + { + return $this->container['compute_heap_limit_exceeded']; + } + + /** + * Sets compute_heap_limit_exceeded + * + * @param int|null $compute_heap_limit_exceeded Number of times a guest exceeded its heap limit. + * + * @return self + */ + public function setComputeHeapLimitExceeded($compute_heap_limit_exceeded) + { + $this->container['compute_heap_limit_exceeded'] = $compute_heap_limit_exceeded; + + return $this; + } + + /** + * Gets compute_stack_limit_exceeded + * + * @return int|null + */ + public function getComputeStackLimitExceeded() + { + return $this->container['compute_stack_limit_exceeded']; + } + + /** + * Sets compute_stack_limit_exceeded + * + * @param int|null $compute_stack_limit_exceeded Number of times a guest exceeded its stack limit. + * + * @return self + */ + public function setComputeStackLimitExceeded($compute_stack_limit_exceeded) + { + $this->container['compute_stack_limit_exceeded'] = $compute_stack_limit_exceeded; + + return $this; + } + + /** + * Gets compute_globals_limit_exceeded + * + * @return int|null + */ + public function getComputeGlobalsLimitExceeded() + { + return $this->container['compute_globals_limit_exceeded']; + } + + /** + * Sets compute_globals_limit_exceeded + * + * @param int|null $compute_globals_limit_exceeded Number of times a guest exceeded its globals limit. + * + * @return self + */ + public function setComputeGlobalsLimitExceeded($compute_globals_limit_exceeded) + { + $this->container['compute_globals_limit_exceeded'] = $compute_globals_limit_exceeded; + + return $this; + } + + /** + * Gets compute_guest_errors + * + * @return int|null + */ + public function getComputeGuestErrors() + { + return $this->container['compute_guest_errors']; + } + + /** + * Sets compute_guest_errors + * + * @param int|null $compute_guest_errors Number of times a service experienced a guest code error. + * + * @return self + */ + public function setComputeGuestErrors($compute_guest_errors) + { + $this->container['compute_guest_errors'] = $compute_guest_errors; + + return $this; + } + + /** + * Gets compute_runtime_errors + * + * @return int|null + */ + public function getComputeRuntimeErrors() + { + return $this->container['compute_runtime_errors']; + } + + /** + * Sets compute_runtime_errors + * + * @param int|null $compute_runtime_errors Number of times a service experienced a guest runtime error. + * + * @return self + */ + public function setComputeRuntimeErrors($compute_runtime_errors) + { + $this->container['compute_runtime_errors'] = $compute_runtime_errors; + + return $this; + } + + /** + * Gets edge_hit_resp_body_bytes + * + * @return int|null + */ + public function getEdgeHitRespBodyBytes() + { + return $this->container['edge_hit_resp_body_bytes']; + } + + /** + * Sets edge_hit_resp_body_bytes + * + * @param int|null $edge_hit_resp_body_bytes Body bytes delivered for edge hits. + * + * @return self + */ + public function setEdgeHitRespBodyBytes($edge_hit_resp_body_bytes) + { + $this->container['edge_hit_resp_body_bytes'] = $edge_hit_resp_body_bytes; + + return $this; + } + + /** + * Gets edge_hit_resp_header_bytes + * + * @return int|null + */ + public function getEdgeHitRespHeaderBytes() + { + return $this->container['edge_hit_resp_header_bytes']; + } + + /** + * Sets edge_hit_resp_header_bytes + * + * @param int|null $edge_hit_resp_header_bytes Header bytes delivered for edge hits. + * + * @return self + */ + public function setEdgeHitRespHeaderBytes($edge_hit_resp_header_bytes) + { + $this->container['edge_hit_resp_header_bytes'] = $edge_hit_resp_header_bytes; + + return $this; + } + + /** + * Gets edge_miss_resp_body_bytes + * + * @return int|null + */ + public function getEdgeMissRespBodyBytes() + { + return $this->container['edge_miss_resp_body_bytes']; + } + + /** + * Sets edge_miss_resp_body_bytes + * + * @param int|null $edge_miss_resp_body_bytes Body bytes delivered for edge misses. + * + * @return self + */ + public function setEdgeMissRespBodyBytes($edge_miss_resp_body_bytes) + { + $this->container['edge_miss_resp_body_bytes'] = $edge_miss_resp_body_bytes; + + return $this; + } + + /** + * Gets edge_miss_resp_header_bytes + * + * @return int|null + */ + public function getEdgeMissRespHeaderBytes() + { + return $this->container['edge_miss_resp_header_bytes']; + } + + /** + * Sets edge_miss_resp_header_bytes + * + * @param int|null $edge_miss_resp_header_bytes Header bytes delivered for edge misses. + * + * @return self + */ + public function setEdgeMissRespHeaderBytes($edge_miss_resp_header_bytes) + { + $this->container['edge_miss_resp_header_bytes'] = $edge_miss_resp_header_bytes; + + return $this; + } + + /** + * Gets origin_cache_fetch_resp_body_bytes + * + * @return int|null + */ + public function getOriginCacheFetchRespBodyBytes() + { + return $this->container['origin_cache_fetch_resp_body_bytes']; + } + + /** + * Sets origin_cache_fetch_resp_body_bytes + * + * @param int|null $origin_cache_fetch_resp_body_bytes Body bytes received from origin for cacheable content. + * + * @return self + */ + public function setOriginCacheFetchRespBodyBytes($origin_cache_fetch_resp_body_bytes) + { + $this->container['origin_cache_fetch_resp_body_bytes'] = $origin_cache_fetch_resp_body_bytes; + + return $this; + } + + /** + * Gets origin_cache_fetch_resp_header_bytes + * + * @return int|null + */ + public function getOriginCacheFetchRespHeaderBytes() + { + return $this->container['origin_cache_fetch_resp_header_bytes']; + } + + /** + * Sets origin_cache_fetch_resp_header_bytes + * + * @param int|null $origin_cache_fetch_resp_header_bytes Header bytes received from an origin for cacheable content. + * + * @return self + */ + public function setOriginCacheFetchRespHeaderBytes($origin_cache_fetch_resp_header_bytes) + { + $this->container['origin_cache_fetch_resp_header_bytes'] = $origin_cache_fetch_resp_header_bytes; + + return $this; + } + + /** + * Gets shield_hit_requests + * + * @return int|null + */ + public function getShieldHitRequests() + { + return $this->container['shield_hit_requests']; + } + + /** + * Sets shield_hit_requests + * + * @param int|null $shield_hit_requests Number of requests that resulted in a hit at a shield. + * + * @return self + */ + public function setShieldHitRequests($shield_hit_requests) + { + $this->container['shield_hit_requests'] = $shield_hit_requests; + + return $this; + } + + /** + * Gets shield_miss_requests + * + * @return int|null + */ + public function getShieldMissRequests() + { + return $this->container['shield_miss_requests']; + } + + /** + * Sets shield_miss_requests + * + * @param int|null $shield_miss_requests Number of requests that resulted in a miss at a shield. + * + * @return self + */ + public function setShieldMissRequests($shield_miss_requests) + { + $this->container['shield_miss_requests'] = $shield_miss_requests; + + return $this; + } + + /** + * Gets shield_hit_resp_header_bytes + * + * @return int|null + */ + public function getShieldHitRespHeaderBytes() + { + return $this->container['shield_hit_resp_header_bytes']; + } + + /** + * Sets shield_hit_resp_header_bytes + * + * @param int|null $shield_hit_resp_header_bytes Header bytes delivered for shield hits. + * + * @return self + */ + public function setShieldHitRespHeaderBytes($shield_hit_resp_header_bytes) + { + $this->container['shield_hit_resp_header_bytes'] = $shield_hit_resp_header_bytes; + + return $this; + } + + /** + * Gets shield_hit_resp_body_bytes + * + * @return int|null + */ + public function getShieldHitRespBodyBytes() + { + return $this->container['shield_hit_resp_body_bytes']; + } + + /** + * Sets shield_hit_resp_body_bytes + * + * @param int|null $shield_hit_resp_body_bytes Body bytes delivered for shield hits. + * + * @return self + */ + public function setShieldHitRespBodyBytes($shield_hit_resp_body_bytes) + { + $this->container['shield_hit_resp_body_bytes'] = $shield_hit_resp_body_bytes; + + return $this; + } + + /** + * Gets shield_miss_resp_header_bytes + * + * @return int|null + */ + public function getShieldMissRespHeaderBytes() + { + return $this->container['shield_miss_resp_header_bytes']; + } + + /** + * Sets shield_miss_resp_header_bytes + * + * @param int|null $shield_miss_resp_header_bytes Header bytes delivered for shield misses. + * + * @return self + */ + public function setShieldMissRespHeaderBytes($shield_miss_resp_header_bytes) + { + $this->container['shield_miss_resp_header_bytes'] = $shield_miss_resp_header_bytes; + + return $this; + } + + /** + * Gets shield_miss_resp_body_bytes + * + * @return int|null + */ + public function getShieldMissRespBodyBytes() + { + return $this->container['shield_miss_resp_body_bytes']; + } + + /** + * Sets shield_miss_resp_body_bytes + * + * @param int|null $shield_miss_resp_body_bytes Body bytes delivered for shield misses. + * + * @return self + */ + public function setShieldMissRespBodyBytes($shield_miss_resp_body_bytes) + { + $this->container['shield_miss_resp_body_bytes'] = $shield_miss_resp_body_bytes; + + return $this; + } + + /** + * Gets websocket_req_header_bytes + * + * @return int|null + */ + public function getWebsocketReqHeaderBytes() + { + return $this->container['websocket_req_header_bytes']; + } + + /** + * Sets websocket_req_header_bytes + * + * @param int|null $websocket_req_header_bytes Total header bytes received from end users over passthrough WebSocket connections. + * + * @return self + */ + public function setWebsocketReqHeaderBytes($websocket_req_header_bytes) + { + $this->container['websocket_req_header_bytes'] = $websocket_req_header_bytes; + + return $this; + } + + /** + * Gets websocket_req_body_bytes + * + * @return int|null + */ + public function getWebsocketReqBodyBytes() + { + return $this->container['websocket_req_body_bytes']; + } + + /** + * Sets websocket_req_body_bytes + * + * @param int|null $websocket_req_body_bytes Total message content bytes received from end users over passthrough WebSocket connections. + * + * @return self + */ + public function setWebsocketReqBodyBytes($websocket_req_body_bytes) + { + $this->container['websocket_req_body_bytes'] = $websocket_req_body_bytes; + + return $this; + } + + /** + * Gets websocket_resp_header_bytes + * + * @return int|null + */ + public function getWebsocketRespHeaderBytes() + { + return $this->container['websocket_resp_header_bytes']; + } + + /** + * Sets websocket_resp_header_bytes + * + * @param int|null $websocket_resp_header_bytes Total header bytes sent to end users over passthrough WebSocket connections. + * + * @return self + */ + public function setWebsocketRespHeaderBytes($websocket_resp_header_bytes) + { + $this->container['websocket_resp_header_bytes'] = $websocket_resp_header_bytes; + + return $this; + } + + /** + * Gets websocket_bereq_header_bytes + * + * @return int|null + */ + public function getWebsocketBereqHeaderBytes() + { + return $this->container['websocket_bereq_header_bytes']; + } + + /** + * Sets websocket_bereq_header_bytes + * + * @param int|null $websocket_bereq_header_bytes Total header bytes sent to backends over passthrough WebSocket connections. + * + * @return self + */ + public function setWebsocketBereqHeaderBytes($websocket_bereq_header_bytes) + { + $this->container['websocket_bereq_header_bytes'] = $websocket_bereq_header_bytes; + + return $this; + } + + /** + * Gets websocket_bereq_body_bytes + * + * @return int|null + */ + public function getWebsocketBereqBodyBytes() + { + return $this->container['websocket_bereq_body_bytes']; + } + + /** + * Sets websocket_bereq_body_bytes + * + * @param int|null $websocket_bereq_body_bytes Total message content bytes sent to backends over passthrough WebSocket connections. + * + * @return self + */ + public function setWebsocketBereqBodyBytes($websocket_bereq_body_bytes) + { + $this->container['websocket_bereq_body_bytes'] = $websocket_bereq_body_bytes; + + return $this; + } + + /** + * Gets websocket_beresp_header_bytes + * + * @return int|null + */ + public function getWebsocketBerespHeaderBytes() + { + return $this->container['websocket_beresp_header_bytes']; + } + + /** + * Sets websocket_beresp_header_bytes + * + * @param int|null $websocket_beresp_header_bytes Total header bytes received from backends over passthrough WebSocket connections. + * + * @return self + */ + public function setWebsocketBerespHeaderBytes($websocket_beresp_header_bytes) + { + $this->container['websocket_beresp_header_bytes'] = $websocket_beresp_header_bytes; + + return $this; + } + + /** + * Gets websocket_beresp_body_bytes + * + * @return int|null + */ + public function getWebsocketBerespBodyBytes() + { + return $this->container['websocket_beresp_body_bytes']; + } + + /** + * Sets websocket_beresp_body_bytes + * + * @param int|null $websocket_beresp_body_bytes Total message content bytes received from backends over passthrough WebSocket connections. + * + * @return self + */ + public function setWebsocketBerespBodyBytes($websocket_beresp_body_bytes) + { + $this->container['websocket_beresp_body_bytes'] = $websocket_beresp_body_bytes; + + return $this; + } + + /** + * Gets websocket_conn_time_ms + * + * @return int|null + */ + public function getWebsocketConnTimeMs() + { + return $this->container['websocket_conn_time_ms']; + } + + /** + * Sets websocket_conn_time_ms + * + * @param int|null $websocket_conn_time_ms Total duration of passthrough WebSocket connections with end users. + * + * @return self + */ + public function setWebsocketConnTimeMs($websocket_conn_time_ms) + { + $this->container['websocket_conn_time_ms'] = $websocket_conn_time_ms; + + return $this; + } + + /** + * Gets websocket_resp_body_bytes + * + * @return int|null + */ + public function getWebsocketRespBodyBytes() + { + return $this->container['websocket_resp_body_bytes']; + } + + /** + * Sets websocket_resp_body_bytes + * + * @param int|null $websocket_resp_body_bytes Total message content bytes sent to end users over passthrough WebSocket connections. + * + * @return self + */ + public function setWebsocketRespBodyBytes($websocket_resp_body_bytes) + { + $this->container['websocket_resp_body_bytes'] = $websocket_resp_body_bytes; + + return $this; + } + + /** + * Gets fanout_recv_publishes + * + * @return int|null + */ + public function getFanoutRecvPublishes() + { + return $this->container['fanout_recv_publishes']; + } + + /** + * Sets fanout_recv_publishes + * + * @param int|null $fanout_recv_publishes Total published messages received from the publish API endpoint. + * + * @return self + */ + public function setFanoutRecvPublishes($fanout_recv_publishes) + { + $this->container['fanout_recv_publishes'] = $fanout_recv_publishes; + + return $this; + } + + /** + * Gets fanout_send_publishes + * + * @return int|null + */ + public function getFanoutSendPublishes() + { + return $this->container['fanout_send_publishes']; + } + + /** + * Sets fanout_send_publishes + * + * @param int|null $fanout_send_publishes Total published messages sent to end users. + * + * @return self + */ + public function setFanoutSendPublishes($fanout_send_publishes) + { + $this->container['fanout_send_publishes'] = $fanout_send_publishes; + + return $this; + } + + /** + * Gets kv_store_class_a_operations + * + * @return int|null + */ + public function getKvStoreClassAOperations() + { + return $this->container['kv_store_class_a_operations']; + } + + /** + * Sets kv_store_class_a_operations + * + * @param int|null $kv_store_class_a_operations The total number of class a operations for the KV store. + * + * @return self + */ + public function setKvStoreClassAOperations($kv_store_class_a_operations) + { + $this->container['kv_store_class_a_operations'] = $kv_store_class_a_operations; + + return $this; + } + + /** + * Gets kv_store_class_b_operations + * + * @return int|null + */ + public function getKvStoreClassBOperations() + { + return $this->container['kv_store_class_b_operations']; + } + + /** + * Sets kv_store_class_b_operations + * + * @param int|null $kv_store_class_b_operations The total number of class b operations for the KV store. + * + * @return self + */ + public function setKvStoreClassBOperations($kv_store_class_b_operations) + { + $this->container['kv_store_class_b_operations'] = $kv_store_class_b_operations; + + return $this; + } + + /** + * Gets object_store_class_a_operations + * + * @return int|null + * @deprecated + */ + public function getObjectStoreClassAOperations() + { + return $this->container['object_store_class_a_operations']; + } + + /** + * Sets object_store_class_a_operations + * + * @param int|null $object_store_class_a_operations Use kv_store_class_a_operations. + * + * @return self + * @deprecated + */ + public function setObjectStoreClassAOperations($object_store_class_a_operations) + { + $this->container['object_store_class_a_operations'] = $object_store_class_a_operations; + + return $this; + } + + /** + * Gets object_store_class_b_operations + * + * @return int|null + * @deprecated + */ + public function getObjectStoreClassBOperations() + { + return $this->container['object_store_class_b_operations']; + } + + /** + * Sets object_store_class_b_operations + * + * @param int|null $object_store_class_b_operations Use kv_store_class_b_operations. + * + * @return self + * @deprecated + */ + public function setObjectStoreClassBOperations($object_store_class_b_operations) + { + $this->container['object_store_class_b_operations'] = $object_store_class_b_operations; + + return $this; + } + + /** + * Gets fanout_req_header_bytes + * + * @return int|null + */ + public function getFanoutReqHeaderBytes() + { + return $this->container['fanout_req_header_bytes']; + } + + /** + * Sets fanout_req_header_bytes + * + * @param int|null $fanout_req_header_bytes Total header bytes received from end users over Fanout connections. + * + * @return self + */ + public function setFanoutReqHeaderBytes($fanout_req_header_bytes) + { + $this->container['fanout_req_header_bytes'] = $fanout_req_header_bytes; + + return $this; + } + + /** + * Gets fanout_req_body_bytes + * + * @return int|null + */ + public function getFanoutReqBodyBytes() + { + return $this->container['fanout_req_body_bytes']; + } + + /** + * Sets fanout_req_body_bytes + * + * @param int|null $fanout_req_body_bytes Total body or message content bytes received from end users over Fanout connections. + * + * @return self + */ + public function setFanoutReqBodyBytes($fanout_req_body_bytes) + { + $this->container['fanout_req_body_bytes'] = $fanout_req_body_bytes; + + return $this; + } + + /** + * Gets fanout_resp_header_bytes + * + * @return int|null + */ + public function getFanoutRespHeaderBytes() + { + return $this->container['fanout_resp_header_bytes']; + } + + /** + * Sets fanout_resp_header_bytes + * + * @param int|null $fanout_resp_header_bytes Total header bytes sent to end users over Fanout connections. + * + * @return self + */ + public function setFanoutRespHeaderBytes($fanout_resp_header_bytes) + { + $this->container['fanout_resp_header_bytes'] = $fanout_resp_header_bytes; + + return $this; + } + + /** + * Gets fanout_resp_body_bytes + * + * @return int|null + */ + public function getFanoutRespBodyBytes() + { + return $this->container['fanout_resp_body_bytes']; + } + + /** + * Sets fanout_resp_body_bytes + * + * @param int|null $fanout_resp_body_bytes Total body or message content bytes sent to end users over Fanout connections, excluding published message content. + * + * @return self + */ + public function setFanoutRespBodyBytes($fanout_resp_body_bytes) + { + $this->container['fanout_resp_body_bytes'] = $fanout_resp_body_bytes; + + return $this; + } + + /** + * Gets fanout_bereq_header_bytes + * + * @return int|null + */ + public function getFanoutBereqHeaderBytes() + { + return $this->container['fanout_bereq_header_bytes']; + } + + /** + * Sets fanout_bereq_header_bytes + * + * @param int|null $fanout_bereq_header_bytes Total header bytes sent to backends over Fanout connections. + * + * @return self + */ + public function setFanoutBereqHeaderBytes($fanout_bereq_header_bytes) + { + $this->container['fanout_bereq_header_bytes'] = $fanout_bereq_header_bytes; + + return $this; + } + + /** + * Gets fanout_bereq_body_bytes + * + * @return int|null + */ + public function getFanoutBereqBodyBytes() + { + return $this->container['fanout_bereq_body_bytes']; + } + + /** + * Sets fanout_bereq_body_bytes + * + * @param int|null $fanout_bereq_body_bytes Total body or message content bytes sent to backends over Fanout connections. + * + * @return self + */ + public function setFanoutBereqBodyBytes($fanout_bereq_body_bytes) + { + $this->container['fanout_bereq_body_bytes'] = $fanout_bereq_body_bytes; + + return $this; + } + + /** + * Gets fanout_beresp_header_bytes + * + * @return int|null + */ + public function getFanoutBerespHeaderBytes() + { + return $this->container['fanout_beresp_header_bytes']; + } + + /** + * Sets fanout_beresp_header_bytes + * + * @param int|null $fanout_beresp_header_bytes Total header bytes received from backends over Fanout connections. + * + * @return self + */ + public function setFanoutBerespHeaderBytes($fanout_beresp_header_bytes) + { + $this->container['fanout_beresp_header_bytes'] = $fanout_beresp_header_bytes; + + return $this; + } + + /** + * Gets fanout_beresp_body_bytes + * + * @return int|null + */ + public function getFanoutBerespBodyBytes() + { + return $this->container['fanout_beresp_body_bytes']; + } + + /** + * Sets fanout_beresp_body_bytes + * + * @param int|null $fanout_beresp_body_bytes Total body or message content bytes received from backends over Fanout connections. + * + * @return self + */ + public function setFanoutBerespBodyBytes($fanout_beresp_body_bytes) + { + $this->container['fanout_beresp_body_bytes'] = $fanout_beresp_body_bytes; + + return $this; + } + + /** + * Gets fanout_conn_time_ms + * + * @return int|null + */ + public function getFanoutConnTimeMs() + { + return $this->container['fanout_conn_time_ms']; + } + + /** + * Sets fanout_conn_time_ms + * + * @param int|null $fanout_conn_time_ms Total duration of Fanout connections with end users. + * + * @return self + */ + public function setFanoutConnTimeMs($fanout_conn_time_ms) + { + $this->container['fanout_conn_time_ms'] = $fanout_conn_time_ms; + + return $this; + } + + /** + * Gets ddos_action_limit_streams_connections + * + * @return int|null + */ + public function getDdosActionLimitStreamsConnections() + { + return $this->container['ddos_action_limit_streams_connections']; + } + + /** + * Sets ddos_action_limit_streams_connections + * + * @param int|null $ddos_action_limit_streams_connections For HTTP/2, the number of connections the limit-streams action was applied to. The limit-streams action caps the allowed number of concurrent streams in a connection. + * + * @return self + */ + public function setDdosActionLimitStreamsConnections($ddos_action_limit_streams_connections) + { + $this->container['ddos_action_limit_streams_connections'] = $ddos_action_limit_streams_connections; + + return $this; + } + + /** + * Gets ddos_action_limit_streams_requests + * + * @return int|null + */ + public function getDdosActionLimitStreamsRequests() + { + return $this->container['ddos_action_limit_streams_requests']; + } + + /** + * Sets ddos_action_limit_streams_requests + * + * @param int|null $ddos_action_limit_streams_requests For HTTP/2, the number of requests made on a connection for which the limit-streams action was taken. The limit-streams action caps the allowed number of concurrent streams in a connection. + * + * @return self + */ + public function setDdosActionLimitStreamsRequests($ddos_action_limit_streams_requests) + { + $this->container['ddos_action_limit_streams_requests'] = $ddos_action_limit_streams_requests; + + return $this; + } + + /** + * Gets ddos_action_tarpit_accept + * + * @return int|null + */ + public function getDdosActionTarpitAccept() + { + return $this->container['ddos_action_tarpit_accept']; + } + + /** + * Sets ddos_action_tarpit_accept + * + * @param int|null $ddos_action_tarpit_accept The number of times the tarpit-accept action was taken. The tarpit-accept action adds a delay when accepting future connections. + * + * @return self + */ + public function setDdosActionTarpitAccept($ddos_action_tarpit_accept) + { + $this->container['ddos_action_tarpit_accept'] = $ddos_action_tarpit_accept; + + return $this; + } + + /** + * Gets ddos_action_tarpit + * + * @return int|null + */ + public function getDdosActionTarpit() + { + return $this->container['ddos_action_tarpit']; + } + + /** + * Sets ddos_action_tarpit + * + * @param int|null $ddos_action_tarpit The number of times the tarpit action was taken. The tarpit action delays writing the response to the client. + * + * @return self + */ + public function setDdosActionTarpit($ddos_action_tarpit) + { + $this->container['ddos_action_tarpit'] = $ddos_action_tarpit; + + return $this; + } + + /** + * Gets ddos_action_close + * + * @return int|null + */ + public function getDdosActionClose() + { + return $this->container['ddos_action_close']; + } + + /** + * Sets ddos_action_close + * + * @param int|null $ddos_action_close The number of times the close action was taken. The close action aborts the connection as soon as possible. The close action takes effect either right after accept, right after the client hello, or right after the response was sent. + * + * @return self + */ + public function setDdosActionClose($ddos_action_close) + { + $this->container['ddos_action_close'] = $ddos_action_close; + + return $this; + } + + /** + * Gets ddos_action_blackhole + * + * @return int|null + */ + public function getDdosActionBlackhole() + { + return $this->container['ddos_action_blackhole']; + } + + /** + * Sets ddos_action_blackhole + * + * @param int|null $ddos_action_blackhole The number of times the blackhole action was taken. The blackhole action quietly closes a TCP connection without sending a reset. The blackhole action quietly closes a TCP connection without notifying its peer (all TCP state is dropped). + * + * @return self + */ + public function setDdosActionBlackhole($ddos_action_blackhole) + { + $this->container['ddos_action_blackhole'] = $ddos_action_blackhole; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/RealtimeEntryRecorded.php b/lib/Model/RealtimeEntryRecorded.php new file mode 100644 index 00000000..1febe492 --- /dev/null +++ b/lib/Model/RealtimeEntryRecorded.php @@ -0,0 +1,290 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RealtimeEntryRecorded implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'realtime_entry_recorded'; + + /** + * 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) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/RealtimeMeasurements.php b/lib/Model/RealtimeMeasurements.php index 894a8c42..45183b44 100644 --- a/lib/Model/RealtimeMeasurements.php +++ b/lib/Model/RealtimeMeasurements.php @@ -68,7 +68,7 @@ class RealtimeMeasurements implements ModelInterface, ArrayAccess, \JsonSerializ 'errors' => 'int', 'hits_time' => 'float', 'miss_time' => 'float', - 'miss_histogram' => 'object', + 'miss_histogram' => 'array', 'compute_requests' => 'int', 'compute_execution_time_ms' => 'float', 'compute_ram_used' => 'int', @@ -1841,7 +1841,7 @@ public function setMissTime($miss_time) /** * Gets miss_histogram * - * @return object|null + * @return array|null */ public function getMissHistogram() { @@ -1851,7 +1851,7 @@ public function getMissHistogram() /** * Sets miss_histogram * - * @param object|null $miss_histogram A histogram. Each key represents the upper bound of a span of 10 milliseconds and the values represent the number of requests to origin during that 10ms period. Any origin request that takes more than 60 seconds to return will be in the 60000 bucket. + * @param array|null $miss_histogram A histogram. Each key represents the upper bound of a span of 10 milliseconds and the values represent the number of requests to origin during that 10ms period. Any origin request that takes more than 60 seconds to return will be in the 60000 bucket. * * @return self */ diff --git a/lib/Model/RecordedTimestamp.php b/lib/Model/RecordedTimestamp.php new file mode 100644 index 00000000..93d346a0 --- /dev/null +++ b/lib/Model/RecordedTimestamp.php @@ -0,0 +1,290 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RecordedTimestamp implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'recorded_timestamp'; + + /** + * 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) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/Secret.php b/lib/Model/Secret.php new file mode 100644 index 00000000..2fa628af --- /dev/null +++ b/lib/Model/Secret.php @@ -0,0 +1,374 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class Secret implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'secret'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'name' => 'string', + 'secret' => 'string', + 'client_key' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'name' => null, + 'secret' => null, + 'client_key' => 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', + 'secret' => 'secret', + 'client_key' => 'client_key' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'secret' => 'setSecret', + 'client_key' => 'setClientKey' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'secret' => 'getSecret', + 'client_key' => 'getClientKey' + ]; + + /** + * 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['secret'] = $data['secret'] ?? null; + $this->container['client_key'] = $data['client_key'] ?? 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 for the secret. The value must contain only letters, numbers, dashes (`-`), underscores (`_`), and periods (`.`). + * + * @return self + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets secret + * + * @return string|null + */ + public function getSecret() + { + return $this->container['secret']; + } + + /** + * Sets secret + * + * @param string|null $secret A Base64-encoded string containing either the secret or the encrypted secret (when using client_key). The maximum secret size (before Base64 encoding and optional local encryption) is 64KB. + * + * @return self + */ + public function setSecret($secret) + { + $this->container['secret'] = $secret; + + return $this; + } + + /** + * Gets client_key + * + * @return string|null + */ + public function getClientKey() + { + return $this->container['client_key']; + } + + /** + * Sets client_key + * + * @param string|null $client_key The Base64-encoded string containing the client key used to encrypt the secret, if applicable. + * + * @return self + */ + public function setClientKey($client_key) + { + $this->container['client_key'] = $client_key; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/SecretResponse.php b/lib/Model/SecretResponse.php new file mode 100644 index 00000000..a8650ee2 --- /dev/null +++ b/lib/Model/SecretResponse.php @@ -0,0 +1,404 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SecretResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'secret_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'name' => 'string', + 'digest' => 'string', + 'created_at' => '\DateTime', + 'recreated' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'name' => null, + 'digest' => null, + 'created_at' => 'date-time', + 'recreated' => 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', + 'digest' => 'digest', + 'created_at' => 'created_at', + 'recreated' => 'recreated' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'digest' => 'setDigest', + 'created_at' => 'setCreatedAt', + 'recreated' => 'setRecreated' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'digest' => 'getDigest', + 'created_at' => 'getCreatedAt', + 'recreated' => 'getRecreated' + ]; + + /** + * 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['digest'] = $data['digest'] ?? null; + $this->container['created_at'] = $data['created_at'] ?? null; + $this->container['recreated'] = $data['recreated'] ?? 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 Name of the secret. + * + * @return self + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets digest + * + * @return string|null + */ + public function getDigest() + { + return $this->container['digest']; + } + + /** + * Sets digest + * + * @param string|null $digest An opaque identifier of the plaintext secret value. This can be used to determine if a secret value has changed. + * + * @return self + */ + public function setDigest($digest) + { + $this->container['digest'] = $digest; + + 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 recreated + * + * @return bool|null + */ + public function getRecreated() + { + return $this->container['recreated']; + } + + /** + * Sets recreated + * + * @param bool|null $recreated True if the secret replaced a secret with the same name. + * + * @return self + */ + public function setRecreated($recreated) + { + $this->container['recreated'] = $recreated; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/SecretStore.php b/lib/Model/SecretStore.php new file mode 100644 index 00000000..fbdd336e --- /dev/null +++ b/lib/Model/SecretStore.php @@ -0,0 +1,314 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SecretStore implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'secret_store'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + '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 = [ + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + '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['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 name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name A human-readable name for the store. The value must contain only letters, numbers, dashes (`-`), underscores (`_`), or periods (`.`). + * + * @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) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/SecretStoreResponse.php b/lib/Model/SecretStoreResponse.php new file mode 100644 index 00000000..a290c56c --- /dev/null +++ b/lib/Model/SecretStoreResponse.php @@ -0,0 +1,374 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SecretStoreResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'secret_store_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'id' => 'string', + 'name' => 'string', + 'created_at' => '\DateTime' + ]; + + /** + * 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, + 'created_at' => 'date-time' + ]; + + /** + * 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', + 'created_at' => 'created_at' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'created_at' => 'setCreatedAt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'created_at' => 'getCreatedAt' + ]; + + /** + * 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['created_at'] = $data['created_at'] ?? 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 ID of the store. + * + * @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 for the store. + * + * @return self + */ + public function setName($name) + { + $this->container['name'] = $name; + + 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; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/SigningKey.php b/lib/Model/SigningKey.php new file mode 100644 index 00000000..25b40b76 --- /dev/null +++ b/lib/Model/SigningKey.php @@ -0,0 +1,315 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SigningKey implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'signing_key'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'signing_key' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'signing_key' => 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 = [ + 'signing_key' => 'signing_key' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'signing_key' => 'setSigningKey' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'signing_key' => 'getSigningKey' + ]; + + /** + * 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['signing_key'] = $data['signing_key'] ?? 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 signing_key + * + * @return string|null + */ + public function getSigningKey() + { + return $this->container['signing_key']; + } + + /** + * Sets signing_key + * + * @param string|null $signing_key A Base64-encoded Ed25519 public key that can be used to verify signatures of client keys. + * + * @return self + */ + public function setSigningKey($signing_key) + { + $this->container['signing_key'] = $signing_key; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/SubsequentRequestTimestamp.php b/lib/Model/SubsequentRequestTimestamp.php new file mode 100644 index 00000000..18fab6bd --- /dev/null +++ b/lib/Model/SubsequentRequestTimestamp.php @@ -0,0 +1,290 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SubsequentRequestTimestamp implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'subsequent_request_timestamp'; + + /** + * 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) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/SudoGenericTokenError.php b/lib/Model/SudoGenericTokenError.php new file mode 100644 index 00000000..667d083d --- /dev/null +++ b/lib/Model/SudoGenericTokenError.php @@ -0,0 +1,314 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SudoGenericTokenError implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'sudo_generic_token_error'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'msg' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'msg' => 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 = [ + 'msg' => 'msg' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'msg' => 'setMsg' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'msg' => 'getMsg' + ]; + + /** + * 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['msg'] = $data['msg'] ?? 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 msg + * + * @return string|null + */ + public function getMsg() + { + return $this->container['msg']; + } + + /** + * Sets msg + * + * @param string|null $msg msg + * + * @return self + */ + public function setMsg($msg) + { + $this->container['msg'] = $msg; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/SudoRequest.php b/lib/Model/SudoRequest.php new file mode 100644 index 00000000..b2e075eb --- /dev/null +++ b/lib/Model/SudoRequest.php @@ -0,0 +1,380 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SudoRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'sudo_request'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'username' => 'string', + 'password' => 'string', + 'expiry_time' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'username' => null, + 'password' => null, + 'expiry_time' => 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 = [ + 'username' => 'username', + 'password' => 'password', + 'expiry_time' => 'expiry_time' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'username' => 'setUsername', + 'password' => 'setPassword', + 'expiry_time' => 'setExpiryTime' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'username' => 'getUsername', + 'password' => 'getPassword', + 'expiry_time' => 'getExpiryTime' + ]; + + /** + * 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['username'] = $data['username'] ?? null; + $this->container['password'] = $data['password'] ?? null; + $this->container['expiry_time'] = $data['expiry_time'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['username'] === null) { + $invalidProperties[] = "'username' can't be null"; + } + if ($this->container['password'] === null) { + $invalidProperties[] = "'password' 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 username + * + * @return string + */ + public function getUsername() + { + return $this->container['username']; + } + + /** + * Sets username + * + * @param string $username username + * + * @return self + */ + public function setUsername($username) + { + $this->container['username'] = $username; + + return $this; + } + + /** + * Gets password + * + * @return string + */ + public function getPassword() + { + return $this->container['password']; + } + + /** + * Sets password + * + * @param string $password password + * + * @return self + */ + public function setPassword($password) + { + $this->container['password'] = $password; + + return $this; + } + + /** + * Gets expiry_time + * + * @return string|null + */ + public function getExpiryTime() + { + return $this->container['expiry_time']; + } + + /** + * Sets expiry_time + * + * @param string|null $expiry_time expiry_time + * + * @return self + */ + public function setExpiryTime($expiry_time) + { + $this->container['expiry_time'] = $expiry_time; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/SudoResponse.php b/lib/Model/SudoResponse.php new file mode 100644 index 00000000..27cbf811 --- /dev/null +++ b/lib/Model/SudoResponse.php @@ -0,0 +1,314 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SudoResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'sudo_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'expiry_time' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'expiry_time' => 'date-time' + ]; + + /** + * 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 = [ + 'expiry_time' => 'expiry_time' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'expiry_time' => 'setExpiryTime' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'expiry_time' => 'getExpiryTime' + ]; + + /** + * 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['expiry_time'] = $data['expiry_time'] ?? 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 expiry_time + * + * @return \DateTime|null + */ + public function getExpiryTime() + { + return $this->container['expiry_time']; + } + + /** + * Sets expiry_time + * + * @param \DateTime|null $expiry_time A UTC time-stamp of when sudo access will expire. If blank, sudo access expires five minutes after the request. + * + * @return self + */ + public function setExpiryTime($expiry_time) + { + $this->container['expiry_time'] = $expiry_time; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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 new file mode 100644 index 00000000..a4074908 --- /dev/null +++ b/lib/Model/Values.php @@ -0,0 +1,2145 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class Values implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $fastlyModelName = 'values'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $fastlyTypes = [ + 'edge_requests' => 'int', + 'edge_resp_header_bytes' => 'int', + 'edge_resp_body_bytes' => 'int', + 'status_1xx' => 'int', + 'status_2xx' => 'int', + 'status_3xx' => 'int', + 'status_4xx' => 'int', + 'status_5xx' => 'int', + 'status_200' => 'int', + 'status_204' => 'int', + 'status_206' => 'int', + 'status_301' => 'int', + 'status_302' => 'int', + 'status_304' => 'int', + 'status_400' => 'int', + 'status_401' => 'int', + 'status_403' => 'int', + 'status_404' => 'int', + 'status_416' => 'int', + 'status_429' => 'int', + 'status_500' => 'int', + 'status_501' => 'int', + 'status_502' => 'int', + 'status_503' => 'int', + 'status_504' => 'int', + 'status_505' => 'int', + 'requests' => 'int', + 'resp_header_bytes' => 'int', + 'resp_body_bytes' => 'int', + 'bereq_header_bytes' => 'int', + 'bereq_body_bytes' => 'int', + 'edge_hit_requests' => 'int', + 'edge_miss_requests' => 'int', + 'origin_fetches' => 'int', + 'origin_fetch_resp_header_bytes' => 'int', + 'origin_fetch_resp_body_bytes' => 'int', + 'bandwidth' => 'int', + 'edge_hit_ratio' => 'float', + 'origin_offload' => 'float', + 'origin_status_200' => 'int', + 'origin_status_204' => 'int', + 'origin_status_206' => 'int', + 'origin_status_301' => 'int', + 'origin_status_302' => 'int', + 'origin_status_304' => 'int', + 'origin_status_400' => 'int', + 'origin_status_401' => 'int', + 'origin_status_403' => 'int', + 'origin_status_404' => 'int', + 'origin_status_416' => 'int', + 'origin_status_429' => 'int', + 'origin_status_500' => 'int', + 'origin_status_501' => 'int', + 'origin_status_502' => 'int', + 'origin_status_503' => 'int', + 'origin_status_504' => 'int', + 'origin_status_505' => 'int', + 'origin_status_1xx' => 'int', + 'origin_status_2xx' => 'int', + 'origin_status_3xx' => 'int', + 'origin_status_4xx' => 'int', + 'origin_status_5xx' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $fastlyFormats = [ + 'edge_requests' => null, + 'edge_resp_header_bytes' => null, + 'edge_resp_body_bytes' => null, + 'status_1xx' => null, + 'status_2xx' => null, + 'status_3xx' => null, + 'status_4xx' => null, + 'status_5xx' => null, + 'status_200' => null, + 'status_204' => null, + 'status_206' => null, + 'status_301' => null, + 'status_302' => null, + 'status_304' => null, + 'status_400' => null, + 'status_401' => null, + 'status_403' => null, + 'status_404' => null, + 'status_416' => null, + 'status_429' => null, + 'status_500' => null, + 'status_501' => null, + 'status_502' => null, + 'status_503' => null, + 'status_504' => null, + 'status_505' => null, + 'requests' => null, + 'resp_header_bytes' => null, + 'resp_body_bytes' => null, + 'bereq_header_bytes' => null, + 'bereq_body_bytes' => null, + 'edge_hit_requests' => null, + 'edge_miss_requests' => null, + 'origin_fetches' => null, + 'origin_fetch_resp_header_bytes' => null, + 'origin_fetch_resp_body_bytes' => null, + 'bandwidth' => null, + 'edge_hit_ratio' => null, + 'origin_offload' => null, + 'origin_status_200' => null, + 'origin_status_204' => null, + 'origin_status_206' => null, + 'origin_status_301' => null, + 'origin_status_302' => null, + 'origin_status_304' => null, + 'origin_status_400' => null, + 'origin_status_401' => null, + 'origin_status_403' => null, + 'origin_status_404' => null, + 'origin_status_416' => null, + 'origin_status_429' => null, + 'origin_status_500' => null, + 'origin_status_501' => null, + 'origin_status_502' => null, + 'origin_status_503' => null, + 'origin_status_504' => null, + 'origin_status_505' => null, + 'origin_status_1xx' => null, + 'origin_status_2xx' => null, + 'origin_status_3xx' => null, + 'origin_status_4xx' => null, + 'origin_status_5xx' => 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 = [ + 'edge_requests' => 'edge_requests', + 'edge_resp_header_bytes' => 'edge_resp_header_bytes', + 'edge_resp_body_bytes' => 'edge_resp_body_bytes', + 'status_1xx' => 'status_1xx', + 'status_2xx' => 'status_2xx', + 'status_3xx' => 'status_3xx', + 'status_4xx' => 'status_4xx', + 'status_5xx' => 'status_5xx', + 'status_200' => 'status_200', + 'status_204' => 'status_204', + 'status_206' => 'status_206', + 'status_301' => 'status_301', + 'status_302' => 'status_302', + 'status_304' => 'status_304', + 'status_400' => 'status_400', + 'status_401' => 'status_401', + 'status_403' => 'status_403', + 'status_404' => 'status_404', + 'status_416' => 'status_416', + 'status_429' => 'status_429', + 'status_500' => 'status_500', + 'status_501' => 'status_501', + 'status_502' => 'status_502', + 'status_503' => 'status_503', + 'status_504' => 'status_504', + 'status_505' => 'status_505', + 'requests' => 'requests', + 'resp_header_bytes' => 'resp_header_bytes', + 'resp_body_bytes' => 'resp_body_bytes', + 'bereq_header_bytes' => 'bereq_header_bytes', + 'bereq_body_bytes' => 'bereq_body_bytes', + 'edge_hit_requests' => 'edge_hit_requests', + 'edge_miss_requests' => 'edge_miss_requests', + 'origin_fetches' => 'origin_fetches', + 'origin_fetch_resp_header_bytes' => 'origin_fetch_resp_header_bytes', + 'origin_fetch_resp_body_bytes' => 'origin_fetch_resp_body_bytes', + 'bandwidth' => 'bandwidth', + 'edge_hit_ratio' => 'edge_hit_ratio', + 'origin_offload' => 'origin_offload', + 'origin_status_200' => 'origin_status_200', + 'origin_status_204' => 'origin_status_204', + 'origin_status_206' => 'origin_status_206', + 'origin_status_301' => 'origin_status_301', + 'origin_status_302' => 'origin_status_302', + 'origin_status_304' => 'origin_status_304', + 'origin_status_400' => 'origin_status_400', + 'origin_status_401' => 'origin_status_401', + 'origin_status_403' => 'origin_status_403', + 'origin_status_404' => 'origin_status_404', + 'origin_status_416' => 'origin_status_416', + 'origin_status_429' => 'origin_status_429', + 'origin_status_500' => 'origin_status_500', + 'origin_status_501' => 'origin_status_501', + 'origin_status_502' => 'origin_status_502', + 'origin_status_503' => 'origin_status_503', + 'origin_status_504' => 'origin_status_504', + 'origin_status_505' => 'origin_status_505', + 'origin_status_1xx' => 'origin_status_1xx', + 'origin_status_2xx' => 'origin_status_2xx', + 'origin_status_3xx' => 'origin_status_3xx', + 'origin_status_4xx' => 'origin_status_4xx', + 'origin_status_5xx' => 'origin_status_5xx' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'edge_requests' => 'setEdgeRequests', + 'edge_resp_header_bytes' => 'setEdgeRespHeaderBytes', + 'edge_resp_body_bytes' => 'setEdgeRespBodyBytes', + 'status_1xx' => 'setStatus1xx', + 'status_2xx' => 'setStatus2xx', + 'status_3xx' => 'setStatus3xx', + 'status_4xx' => 'setStatus4xx', + 'status_5xx' => 'setStatus5xx', + 'status_200' => 'setStatus200', + 'status_204' => 'setStatus204', + 'status_206' => 'setStatus206', + 'status_301' => 'setStatus301', + 'status_302' => 'setStatus302', + 'status_304' => 'setStatus304', + 'status_400' => 'setStatus400', + 'status_401' => 'setStatus401', + 'status_403' => 'setStatus403', + 'status_404' => 'setStatus404', + 'status_416' => 'setStatus416', + 'status_429' => 'setStatus429', + 'status_500' => 'setStatus500', + 'status_501' => 'setStatus501', + 'status_502' => 'setStatus502', + 'status_503' => 'setStatus503', + 'status_504' => 'setStatus504', + 'status_505' => 'setStatus505', + 'requests' => 'setRequests', + 'resp_header_bytes' => 'setRespHeaderBytes', + 'resp_body_bytes' => 'setRespBodyBytes', + 'bereq_header_bytes' => 'setBereqHeaderBytes', + 'bereq_body_bytes' => 'setBereqBodyBytes', + 'edge_hit_requests' => 'setEdgeHitRequests', + 'edge_miss_requests' => 'setEdgeMissRequests', + 'origin_fetches' => 'setOriginFetches', + 'origin_fetch_resp_header_bytes' => 'setOriginFetchRespHeaderBytes', + 'origin_fetch_resp_body_bytes' => 'setOriginFetchRespBodyBytes', + 'bandwidth' => 'setBandwidth', + 'edge_hit_ratio' => 'setEdgeHitRatio', + 'origin_offload' => 'setOriginOffload', + 'origin_status_200' => 'setOriginStatus200', + 'origin_status_204' => 'setOriginStatus204', + 'origin_status_206' => 'setOriginStatus206', + 'origin_status_301' => 'setOriginStatus301', + 'origin_status_302' => 'setOriginStatus302', + 'origin_status_304' => 'setOriginStatus304', + 'origin_status_400' => 'setOriginStatus400', + 'origin_status_401' => 'setOriginStatus401', + 'origin_status_403' => 'setOriginStatus403', + 'origin_status_404' => 'setOriginStatus404', + 'origin_status_416' => 'setOriginStatus416', + 'origin_status_429' => 'setOriginStatus429', + 'origin_status_500' => 'setOriginStatus500', + 'origin_status_501' => 'setOriginStatus501', + 'origin_status_502' => 'setOriginStatus502', + 'origin_status_503' => 'setOriginStatus503', + 'origin_status_504' => 'setOriginStatus504', + 'origin_status_505' => 'setOriginStatus505', + 'origin_status_1xx' => 'setOriginStatus1xx', + 'origin_status_2xx' => 'setOriginStatus2xx', + 'origin_status_3xx' => 'setOriginStatus3xx', + 'origin_status_4xx' => 'setOriginStatus4xx', + 'origin_status_5xx' => 'setOriginStatus5xx' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'edge_requests' => 'getEdgeRequests', + 'edge_resp_header_bytes' => 'getEdgeRespHeaderBytes', + 'edge_resp_body_bytes' => 'getEdgeRespBodyBytes', + 'status_1xx' => 'getStatus1xx', + 'status_2xx' => 'getStatus2xx', + 'status_3xx' => 'getStatus3xx', + 'status_4xx' => 'getStatus4xx', + 'status_5xx' => 'getStatus5xx', + 'status_200' => 'getStatus200', + 'status_204' => 'getStatus204', + 'status_206' => 'getStatus206', + 'status_301' => 'getStatus301', + 'status_302' => 'getStatus302', + 'status_304' => 'getStatus304', + 'status_400' => 'getStatus400', + 'status_401' => 'getStatus401', + 'status_403' => 'getStatus403', + 'status_404' => 'getStatus404', + 'status_416' => 'getStatus416', + 'status_429' => 'getStatus429', + 'status_500' => 'getStatus500', + 'status_501' => 'getStatus501', + 'status_502' => 'getStatus502', + 'status_503' => 'getStatus503', + 'status_504' => 'getStatus504', + 'status_505' => 'getStatus505', + 'requests' => 'getRequests', + 'resp_header_bytes' => 'getRespHeaderBytes', + 'resp_body_bytes' => 'getRespBodyBytes', + 'bereq_header_bytes' => 'getBereqHeaderBytes', + 'bereq_body_bytes' => 'getBereqBodyBytes', + 'edge_hit_requests' => 'getEdgeHitRequests', + 'edge_miss_requests' => 'getEdgeMissRequests', + 'origin_fetches' => 'getOriginFetches', + 'origin_fetch_resp_header_bytes' => 'getOriginFetchRespHeaderBytes', + 'origin_fetch_resp_body_bytes' => 'getOriginFetchRespBodyBytes', + 'bandwidth' => 'getBandwidth', + 'edge_hit_ratio' => 'getEdgeHitRatio', + 'origin_offload' => 'getOriginOffload', + 'origin_status_200' => 'getOriginStatus200', + 'origin_status_204' => 'getOriginStatus204', + 'origin_status_206' => 'getOriginStatus206', + 'origin_status_301' => 'getOriginStatus301', + 'origin_status_302' => 'getOriginStatus302', + 'origin_status_304' => 'getOriginStatus304', + 'origin_status_400' => 'getOriginStatus400', + 'origin_status_401' => 'getOriginStatus401', + 'origin_status_403' => 'getOriginStatus403', + 'origin_status_404' => 'getOriginStatus404', + 'origin_status_416' => 'getOriginStatus416', + 'origin_status_429' => 'getOriginStatus429', + 'origin_status_500' => 'getOriginStatus500', + 'origin_status_501' => 'getOriginStatus501', + 'origin_status_502' => 'getOriginStatus502', + 'origin_status_503' => 'getOriginStatus503', + 'origin_status_504' => 'getOriginStatus504', + 'origin_status_505' => 'getOriginStatus505', + 'origin_status_1xx' => 'getOriginStatus1xx', + 'origin_status_2xx' => 'getOriginStatus2xx', + 'origin_status_3xx' => 'getOriginStatus3xx', + 'origin_status_4xx' => 'getOriginStatus4xx', + 'origin_status_5xx' => 'getOriginStatus5xx' + ]; + + /** + * 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['edge_requests'] = $data['edge_requests'] ?? null; + $this->container['edge_resp_header_bytes'] = $data['edge_resp_header_bytes'] ?? null; + $this->container['edge_resp_body_bytes'] = $data['edge_resp_body_bytes'] ?? null; + $this->container['status_1xx'] = $data['status_1xx'] ?? null; + $this->container['status_2xx'] = $data['status_2xx'] ?? null; + $this->container['status_3xx'] = $data['status_3xx'] ?? null; + $this->container['status_4xx'] = $data['status_4xx'] ?? null; + $this->container['status_5xx'] = $data['status_5xx'] ?? null; + $this->container['status_200'] = $data['status_200'] ?? null; + $this->container['status_204'] = $data['status_204'] ?? null; + $this->container['status_206'] = $data['status_206'] ?? null; + $this->container['status_301'] = $data['status_301'] ?? null; + $this->container['status_302'] = $data['status_302'] ?? null; + $this->container['status_304'] = $data['status_304'] ?? null; + $this->container['status_400'] = $data['status_400'] ?? null; + $this->container['status_401'] = $data['status_401'] ?? null; + $this->container['status_403'] = $data['status_403'] ?? null; + $this->container['status_404'] = $data['status_404'] ?? null; + $this->container['status_416'] = $data['status_416'] ?? null; + $this->container['status_429'] = $data['status_429'] ?? null; + $this->container['status_500'] = $data['status_500'] ?? null; + $this->container['status_501'] = $data['status_501'] ?? null; + $this->container['status_502'] = $data['status_502'] ?? null; + $this->container['status_503'] = $data['status_503'] ?? null; + $this->container['status_504'] = $data['status_504'] ?? null; + $this->container['status_505'] = $data['status_505'] ?? null; + $this->container['requests'] = $data['requests'] ?? null; + $this->container['resp_header_bytes'] = $data['resp_header_bytes'] ?? null; + $this->container['resp_body_bytes'] = $data['resp_body_bytes'] ?? null; + $this->container['bereq_header_bytes'] = $data['bereq_header_bytes'] ?? null; + $this->container['bereq_body_bytes'] = $data['bereq_body_bytes'] ?? null; + $this->container['edge_hit_requests'] = $data['edge_hit_requests'] ?? null; + $this->container['edge_miss_requests'] = $data['edge_miss_requests'] ?? null; + $this->container['origin_fetches'] = $data['origin_fetches'] ?? null; + $this->container['origin_fetch_resp_header_bytes'] = $data['origin_fetch_resp_header_bytes'] ?? null; + $this->container['origin_fetch_resp_body_bytes'] = $data['origin_fetch_resp_body_bytes'] ?? null; + $this->container['bandwidth'] = $data['bandwidth'] ?? null; + $this->container['edge_hit_ratio'] = $data['edge_hit_ratio'] ?? null; + $this->container['origin_offload'] = $data['origin_offload'] ?? null; + $this->container['origin_status_200'] = $data['origin_status_200'] ?? null; + $this->container['origin_status_204'] = $data['origin_status_204'] ?? null; + $this->container['origin_status_206'] = $data['origin_status_206'] ?? null; + $this->container['origin_status_301'] = $data['origin_status_301'] ?? null; + $this->container['origin_status_302'] = $data['origin_status_302'] ?? null; + $this->container['origin_status_304'] = $data['origin_status_304'] ?? null; + $this->container['origin_status_400'] = $data['origin_status_400'] ?? null; + $this->container['origin_status_401'] = $data['origin_status_401'] ?? null; + $this->container['origin_status_403'] = $data['origin_status_403'] ?? null; + $this->container['origin_status_404'] = $data['origin_status_404'] ?? null; + $this->container['origin_status_416'] = $data['origin_status_416'] ?? null; + $this->container['origin_status_429'] = $data['origin_status_429'] ?? null; + $this->container['origin_status_500'] = $data['origin_status_500'] ?? null; + $this->container['origin_status_501'] = $data['origin_status_501'] ?? null; + $this->container['origin_status_502'] = $data['origin_status_502'] ?? null; + $this->container['origin_status_503'] = $data['origin_status_503'] ?? null; + $this->container['origin_status_504'] = $data['origin_status_504'] ?? null; + $this->container['origin_status_505'] = $data['origin_status_505'] ?? null; + $this->container['origin_status_1xx'] = $data['origin_status_1xx'] ?? null; + $this->container['origin_status_2xx'] = $data['origin_status_2xx'] ?? null; + $this->container['origin_status_3xx'] = $data['origin_status_3xx'] ?? null; + $this->container['origin_status_4xx'] = $data['origin_status_4xx'] ?? null; + $this->container['origin_status_5xx'] = $data['origin_status_5xx'] ?? 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 edge_requests + * + * @return int|null + */ + public function getEdgeRequests() + { + return $this->container['edge_requests']; + } + + /** + * Sets edge_requests + * + * @param int|null $edge_requests Number of requests sent by end users to Fastly. + * + * @return self + */ + public function setEdgeRequests($edge_requests) + { + $this->container['edge_requests'] = $edge_requests; + + return $this; + } + + /** + * Gets edge_resp_header_bytes + * + * @return int|null + */ + public function getEdgeRespHeaderBytes() + { + return $this->container['edge_resp_header_bytes']; + } + + /** + * Sets edge_resp_header_bytes + * + * @param int|null $edge_resp_header_bytes Total header bytes delivered from Fastly to the end user. + * + * @return self + */ + public function setEdgeRespHeaderBytes($edge_resp_header_bytes) + { + $this->container['edge_resp_header_bytes'] = $edge_resp_header_bytes; + + return $this; + } + + /** + * Gets edge_resp_body_bytes + * + * @return int|null + */ + public function getEdgeRespBodyBytes() + { + return $this->container['edge_resp_body_bytes']; + } + + /** + * Sets edge_resp_body_bytes + * + * @param int|null $edge_resp_body_bytes Total body bytes delivered from Fastly to the end user. + * + * @return self + */ + public function setEdgeRespBodyBytes($edge_resp_body_bytes) + { + $this->container['edge_resp_body_bytes'] = $edge_resp_body_bytes; + + return $this; + } + + /** + * Gets status_1xx + * + * @return int|null + */ + public function getStatus1xx() + { + return $this->container['status_1xx']; + } + + /** + * Sets status_1xx + * + * @param int|null $status_1xx Number of 1xx \"Informational\" category status codes delivered. + * + * @return self + */ + public function setStatus1xx($status_1xx) + { + $this->container['status_1xx'] = $status_1xx; + + return $this; + } + + /** + * Gets status_2xx + * + * @return int|null + */ + public function getStatus2xx() + { + return $this->container['status_2xx']; + } + + /** + * Sets status_2xx + * + * @param int|null $status_2xx Number of 2xx \"Success\" status codes delivered. + * + * @return self + */ + public function setStatus2xx($status_2xx) + { + $this->container['status_2xx'] = $status_2xx; + + return $this; + } + + /** + * Gets status_3xx + * + * @return int|null + */ + public function getStatus3xx() + { + return $this->container['status_3xx']; + } + + /** + * Sets status_3xx + * + * @param int|null $status_3xx Number of 3xx \"Redirection\" codes delivered. + * + * @return self + */ + public function setStatus3xx($status_3xx) + { + $this->container['status_3xx'] = $status_3xx; + + return $this; + } + + /** + * Gets status_4xx + * + * @return int|null + */ + public function getStatus4xx() + { + return $this->container['status_4xx']; + } + + /** + * Sets status_4xx + * + * @param int|null $status_4xx Number of 4xx \"Client Error\" codes delivered. + * + * @return self + */ + public function setStatus4xx($status_4xx) + { + $this->container['status_4xx'] = $status_4xx; + + return $this; + } + + /** + * Gets status_5xx + * + * @return int|null + */ + public function getStatus5xx() + { + return $this->container['status_5xx']; + } + + /** + * Sets status_5xx + * + * @param int|null $status_5xx Number of 5xx \"Server Error\" codes delivered. + * + * @return self + */ + public function setStatus5xx($status_5xx) + { + $this->container['status_5xx'] = $status_5xx; + + return $this; + } + + /** + * Gets status_200 + * + * @return int|null + */ + public function getStatus200() + { + return $this->container['status_200']; + } + + /** + * Sets status_200 + * + * @param int|null $status_200 Number of responses delivered with status code 200 (Success). + * + * @return self + */ + public function setStatus200($status_200) + { + $this->container['status_200'] = $status_200; + + return $this; + } + + /** + * Gets status_204 + * + * @return int|null + */ + public function getStatus204() + { + return $this->container['status_204']; + } + + /** + * Sets status_204 + * + * @param int|null $status_204 Number of responses delivered with status code 204 (No Content). + * + * @return self + */ + public function setStatus204($status_204) + { + $this->container['status_204'] = $status_204; + + return $this; + } + + /** + * Gets status_206 + * + * @return int|null + */ + public function getStatus206() + { + return $this->container['status_206']; + } + + /** + * Sets status_206 + * + * @param int|null $status_206 Number of responses delivered with status code 206 (Partial Content). + * + * @return self + */ + public function setStatus206($status_206) + { + $this->container['status_206'] = $status_206; + + return $this; + } + + /** + * Gets status_301 + * + * @return int|null + */ + public function getStatus301() + { + return $this->container['status_301']; + } + + /** + * Sets status_301 + * + * @param int|null $status_301 Number of responses delivered with status code 301 (Moved Permanently). + * + * @return self + */ + public function setStatus301($status_301) + { + $this->container['status_301'] = $status_301; + + return $this; + } + + /** + * Gets status_302 + * + * @return int|null + */ + public function getStatus302() + { + return $this->container['status_302']; + } + + /** + * Sets status_302 + * + * @param int|null $status_302 Number of responses delivered with status code 302 (Found). + * + * @return self + */ + public function setStatus302($status_302) + { + $this->container['status_302'] = $status_302; + + return $this; + } + + /** + * Gets status_304 + * + * @return int|null + */ + public function getStatus304() + { + return $this->container['status_304']; + } + + /** + * Sets status_304 + * + * @param int|null $status_304 Number of responses delivered with status code 304 (Not Modified). + * + * @return self + */ + public function setStatus304($status_304) + { + $this->container['status_304'] = $status_304; + + return $this; + } + + /** + * Gets status_400 + * + * @return int|null + */ + public function getStatus400() + { + return $this->container['status_400']; + } + + /** + * Sets status_400 + * + * @param int|null $status_400 Number of responses delivered with status code 400 (Bad Request). + * + * @return self + */ + public function setStatus400($status_400) + { + $this->container['status_400'] = $status_400; + + return $this; + } + + /** + * Gets status_401 + * + * @return int|null + */ + public function getStatus401() + { + return $this->container['status_401']; + } + + /** + * Sets status_401 + * + * @param int|null $status_401 Number of responses delivered with status code 401 (Unauthorized). + * + * @return self + */ + public function setStatus401($status_401) + { + $this->container['status_401'] = $status_401; + + return $this; + } + + /** + * Gets status_403 + * + * @return int|null + */ + public function getStatus403() + { + return $this->container['status_403']; + } + + /** + * Sets status_403 + * + * @param int|null $status_403 Number of responses delivered with status code 403 (Forbidden). + * + * @return self + */ + public function setStatus403($status_403) + { + $this->container['status_403'] = $status_403; + + return $this; + } + + /** + * Gets status_404 + * + * @return int|null + */ + public function getStatus404() + { + return $this->container['status_404']; + } + + /** + * Sets status_404 + * + * @param int|null $status_404 Number of responses delivered with status code 404 (Not Found). + * + * @return self + */ + public function setStatus404($status_404) + { + $this->container['status_404'] = $status_404; + + return $this; + } + + /** + * Gets status_416 + * + * @return int|null + */ + public function getStatus416() + { + return $this->container['status_416']; + } + + /** + * Sets status_416 + * + * @param int|null $status_416 Number of responses delivered with status code 416 (Range Not Satisfiable). + * + * @return self + */ + public function setStatus416($status_416) + { + $this->container['status_416'] = $status_416; + + return $this; + } + + /** + * Gets status_429 + * + * @return int|null + */ + public function getStatus429() + { + return $this->container['status_429']; + } + + /** + * Sets status_429 + * + * @param int|null $status_429 Number of responses delivered with status code 429 (Too Many Requests). + * + * @return self + */ + public function setStatus429($status_429) + { + $this->container['status_429'] = $status_429; + + return $this; + } + + /** + * Gets status_500 + * + * @return int|null + */ + public function getStatus500() + { + return $this->container['status_500']; + } + + /** + * Sets status_500 + * + * @param int|null $status_500 Number of responses delivered with status code 500 (Internal Server Error). + * + * @return self + */ + public function setStatus500($status_500) + { + $this->container['status_500'] = $status_500; + + return $this; + } + + /** + * Gets status_501 + * + * @return int|null + */ + public function getStatus501() + { + return $this->container['status_501']; + } + + /** + * Sets status_501 + * + * @param int|null $status_501 Number of responses delivered with status code 501 (Not Implemented). + * + * @return self + */ + public function setStatus501($status_501) + { + $this->container['status_501'] = $status_501; + + return $this; + } + + /** + * Gets status_502 + * + * @return int|null + */ + public function getStatus502() + { + return $this->container['status_502']; + } + + /** + * Sets status_502 + * + * @param int|null $status_502 Number of responses delivered with status code 502 (Bad Gateway). + * + * @return self + */ + public function setStatus502($status_502) + { + $this->container['status_502'] = $status_502; + + return $this; + } + + /** + * Gets status_503 + * + * @return int|null + */ + public function getStatus503() + { + return $this->container['status_503']; + } + + /** + * Sets status_503 + * + * @param int|null $status_503 Number of responses delivered with status code 503 (Service Unavailable). + * + * @return self + */ + public function setStatus503($status_503) + { + $this->container['status_503'] = $status_503; + + return $this; + } + + /** + * Gets status_504 + * + * @return int|null + */ + public function getStatus504() + { + return $this->container['status_504']; + } + + /** + * Sets status_504 + * + * @param int|null $status_504 Number of responses delivered with status code 504 (Gateway Timeout). + * + * @return self + */ + public function setStatus504($status_504) + { + $this->container['status_504'] = $status_504; + + return $this; + } + + /** + * Gets status_505 + * + * @return int|null + */ + public function getStatus505() + { + return $this->container['status_505']; + } + + /** + * Sets status_505 + * + * @param int|null $status_505 Number of responses delivered with status code 505 (HTTP Version Not Supported). + * + * @return self + */ + public function setStatus505($status_505) + { + $this->container['status_505'] = $status_505; + + return $this; + } + + /** + * Gets requests + * + * @return int|null + */ + public function getRequests() + { + return $this->container['requests']; + } + + /** + * Sets requests + * + * @param int|null $requests Number of requests processed. + * + * @return self + */ + public function setRequests($requests) + { + $this->container['requests'] = $requests; + + return $this; + } + + /** + * Gets resp_header_bytes + * + * @return int|null + */ + public function getRespHeaderBytes() + { + return $this->container['resp_header_bytes']; + } + + /** + * Sets resp_header_bytes + * + * @param int|null $resp_header_bytes Total header bytes delivered. + * + * @return self + */ + public function setRespHeaderBytes($resp_header_bytes) + { + $this->container['resp_header_bytes'] = $resp_header_bytes; + + return $this; + } + + /** + * Gets resp_body_bytes + * + * @return int|null + */ + public function getRespBodyBytes() + { + return $this->container['resp_body_bytes']; + } + + /** + * Sets resp_body_bytes + * + * @param int|null $resp_body_bytes Total body bytes delivered. + * + * @return self + */ + public function setRespBodyBytes($resp_body_bytes) + { + $this->container['resp_body_bytes'] = $resp_body_bytes; + + return $this; + } + + /** + * Gets bereq_header_bytes + * + * @return int|null + */ + public function getBereqHeaderBytes() + { + return $this->container['bereq_header_bytes']; + } + + /** + * Sets bereq_header_bytes + * + * @param int|null $bereq_header_bytes Total header bytes sent to origin. + * + * @return self + */ + public function setBereqHeaderBytes($bereq_header_bytes) + { + $this->container['bereq_header_bytes'] = $bereq_header_bytes; + + return $this; + } + + /** + * Gets bereq_body_bytes + * + * @return int|null + */ + public function getBereqBodyBytes() + { + return $this->container['bereq_body_bytes']; + } + + /** + * Sets bereq_body_bytes + * + * @param int|null $bereq_body_bytes Total body bytes sent to origin. + * + * @return self + */ + public function setBereqBodyBytes($bereq_body_bytes) + { + $this->container['bereq_body_bytes'] = $bereq_body_bytes; + + return $this; + } + + /** + * Gets edge_hit_requests + * + * @return int|null + */ + public function getEdgeHitRequests() + { + return $this->container['edge_hit_requests']; + } + + /** + * Sets edge_hit_requests + * + * @param int|null $edge_hit_requests Number of requests sent by end users to Fastly that resulted in a hit at the edge. + * + * @return self + */ + public function setEdgeHitRequests($edge_hit_requests) + { + $this->container['edge_hit_requests'] = $edge_hit_requests; + + return $this; + } + + /** + * Gets edge_miss_requests + * + * @return int|null + */ + public function getEdgeMissRequests() + { + return $this->container['edge_miss_requests']; + } + + /** + * Sets edge_miss_requests + * + * @param int|null $edge_miss_requests Number of requests sent by end users to Fastly that resulted in a miss at the edge. + * + * @return self + */ + public function setEdgeMissRequests($edge_miss_requests) + { + $this->container['edge_miss_requests'] = $edge_miss_requests; + + return $this; + } + + /** + * Gets origin_fetches + * + * @return int|null + */ + public function getOriginFetches() + { + return $this->container['origin_fetches']; + } + + /** + * Sets origin_fetches + * + * @param int|null $origin_fetches Number of requests sent to origin. + * + * @return self + */ + public function setOriginFetches($origin_fetches) + { + $this->container['origin_fetches'] = $origin_fetches; + + return $this; + } + + /** + * Gets origin_fetch_resp_header_bytes + * + * @return int|null + */ + public function getOriginFetchRespHeaderBytes() + { + return $this->container['origin_fetch_resp_header_bytes']; + } + + /** + * Sets origin_fetch_resp_header_bytes + * + * @param int|null $origin_fetch_resp_header_bytes Total header bytes received from origin. + * + * @return self + */ + public function setOriginFetchRespHeaderBytes($origin_fetch_resp_header_bytes) + { + $this->container['origin_fetch_resp_header_bytes'] = $origin_fetch_resp_header_bytes; + + return $this; + } + + /** + * Gets origin_fetch_resp_body_bytes + * + * @return int|null + */ + public function getOriginFetchRespBodyBytes() + { + return $this->container['origin_fetch_resp_body_bytes']; + } + + /** + * Sets origin_fetch_resp_body_bytes + * + * @param int|null $origin_fetch_resp_body_bytes Total body bytes received from origin. + * + * @return self + */ + public function setOriginFetchRespBodyBytes($origin_fetch_resp_body_bytes) + { + $this->container['origin_fetch_resp_body_bytes'] = $origin_fetch_resp_body_bytes; + + return $this; + } + + /** + * Gets bandwidth + * + * @return int|null + */ + public function getBandwidth() + { + return $this->container['bandwidth']; + } + + /** + * Sets bandwidth + * + * @param int|null $bandwidth Total bytes delivered (`resp_header_bytes` + `resp_body_bytes` + `bereq_header_bytes` + `bereq_body_bytes`). + * + * @return self + */ + public function setBandwidth($bandwidth) + { + $this->container['bandwidth'] = $bandwidth; + + return $this; + } + + /** + * Gets edge_hit_ratio + * + * @return float|null + */ + public function getEdgeHitRatio() + { + return $this->container['edge_hit_ratio']; + } + + /** + * Sets edge_hit_ratio + * + * @param float|null $edge_hit_ratio Ratio of cache hits to cache misses at the edge, between 0 and 1 (`edge_hit_requests` / (`edge_hit_requests` + `edge_miss_requests`)). + * + * @return self + */ + public function setEdgeHitRatio($edge_hit_ratio) + { + $this->container['edge_hit_ratio'] = $edge_hit_ratio; + + return $this; + } + + /** + * Gets origin_offload + * + * @return float|null + */ + public function getOriginOffload() + { + return $this->container['origin_offload']; + } + + /** + * 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`). + * + * @return self + */ + public function setOriginOffload($origin_offload) + { + $this->container['origin_offload'] = $origin_offload; + + return $this; + } + + /** + * Gets origin_status_200 + * + * @return int|null + */ + public function getOriginStatus200() + { + return $this->container['origin_status_200']; + } + + /** + * Sets origin_status_200 + * + * @param int|null $origin_status_200 Number of responses received from origin with status code 200 (Success). + * + * @return self + */ + public function setOriginStatus200($origin_status_200) + { + $this->container['origin_status_200'] = $origin_status_200; + + return $this; + } + + /** + * Gets origin_status_204 + * + * @return int|null + */ + public function getOriginStatus204() + { + return $this->container['origin_status_204']; + } + + /** + * Sets origin_status_204 + * + * @param int|null $origin_status_204 Number of responses received from origin with status code 204 (No Content). + * + * @return self + */ + public function setOriginStatus204($origin_status_204) + { + $this->container['origin_status_204'] = $origin_status_204; + + return $this; + } + + /** + * Gets origin_status_206 + * + * @return int|null + */ + public function getOriginStatus206() + { + return $this->container['origin_status_206']; + } + + /** + * Sets origin_status_206 + * + * @param int|null $origin_status_206 Number of responses received from origin with status code 206 (Partial Content). + * + * @return self + */ + public function setOriginStatus206($origin_status_206) + { + $this->container['origin_status_206'] = $origin_status_206; + + return $this; + } + + /** + * Gets origin_status_301 + * + * @return int|null + */ + public function getOriginStatus301() + { + return $this->container['origin_status_301']; + } + + /** + * Sets origin_status_301 + * + * @param int|null $origin_status_301 Number of responses received from origin with status code 301 (Moved Permanently). + * + * @return self + */ + public function setOriginStatus301($origin_status_301) + { + $this->container['origin_status_301'] = $origin_status_301; + + return $this; + } + + /** + * Gets origin_status_302 + * + * @return int|null + */ + public function getOriginStatus302() + { + return $this->container['origin_status_302']; + } + + /** + * Sets origin_status_302 + * + * @param int|null $origin_status_302 Number of responses received from origin with status code 302 (Found). + * + * @return self + */ + public function setOriginStatus302($origin_status_302) + { + $this->container['origin_status_302'] = $origin_status_302; + + return $this; + } + + /** + * Gets origin_status_304 + * + * @return int|null + */ + public function getOriginStatus304() + { + return $this->container['origin_status_304']; + } + + /** + * Sets origin_status_304 + * + * @param int|null $origin_status_304 Number of responses received from origin with status code 304 (Not Modified). + * + * @return self + */ + public function setOriginStatus304($origin_status_304) + { + $this->container['origin_status_304'] = $origin_status_304; + + return $this; + } + + /** + * Gets origin_status_400 + * + * @return int|null + */ + public function getOriginStatus400() + { + return $this->container['origin_status_400']; + } + + /** + * Sets origin_status_400 + * + * @param int|null $origin_status_400 Number of responses received from origin with status code 400 (Bad Request). + * + * @return self + */ + public function setOriginStatus400($origin_status_400) + { + $this->container['origin_status_400'] = $origin_status_400; + + return $this; + } + + /** + * Gets origin_status_401 + * + * @return int|null + */ + public function getOriginStatus401() + { + return $this->container['origin_status_401']; + } + + /** + * Sets origin_status_401 + * + * @param int|null $origin_status_401 Number of responses received from origin with status code 401 (Unauthorized). + * + * @return self + */ + public function setOriginStatus401($origin_status_401) + { + $this->container['origin_status_401'] = $origin_status_401; + + return $this; + } + + /** + * Gets origin_status_403 + * + * @return int|null + */ + public function getOriginStatus403() + { + return $this->container['origin_status_403']; + } + + /** + * Sets origin_status_403 + * + * @param int|null $origin_status_403 Number of responses received from origin with status code 403 (Forbidden). + * + * @return self + */ + public function setOriginStatus403($origin_status_403) + { + $this->container['origin_status_403'] = $origin_status_403; + + return $this; + } + + /** + * Gets origin_status_404 + * + * @return int|null + */ + public function getOriginStatus404() + { + return $this->container['origin_status_404']; + } + + /** + * Sets origin_status_404 + * + * @param int|null $origin_status_404 Number of responses received from origin with status code 404 (Not Found). + * + * @return self + */ + public function setOriginStatus404($origin_status_404) + { + $this->container['origin_status_404'] = $origin_status_404; + + return $this; + } + + /** + * Gets origin_status_416 + * + * @return int|null + */ + public function getOriginStatus416() + { + return $this->container['origin_status_416']; + } + + /** + * Sets origin_status_416 + * + * @param int|null $origin_status_416 Number of responses received from origin with status code 416 (Range Not Satisfiable). + * + * @return self + */ + public function setOriginStatus416($origin_status_416) + { + $this->container['origin_status_416'] = $origin_status_416; + + return $this; + } + + /** + * Gets origin_status_429 + * + * @return int|null + */ + public function getOriginStatus429() + { + return $this->container['origin_status_429']; + } + + /** + * Sets origin_status_429 + * + * @param int|null $origin_status_429 Number of responses received from origin with status code 429 (Too Many Requests). + * + * @return self + */ + public function setOriginStatus429($origin_status_429) + { + $this->container['origin_status_429'] = $origin_status_429; + + return $this; + } + + /** + * Gets origin_status_500 + * + * @return int|null + */ + public function getOriginStatus500() + { + return $this->container['origin_status_500']; + } + + /** + * Sets origin_status_500 + * + * @param int|null $origin_status_500 Number of responses received from origin with status code 500 (Internal Server Error). + * + * @return self + */ + public function setOriginStatus500($origin_status_500) + { + $this->container['origin_status_500'] = $origin_status_500; + + return $this; + } + + /** + * Gets origin_status_501 + * + * @return int|null + */ + public function getOriginStatus501() + { + return $this->container['origin_status_501']; + } + + /** + * Sets origin_status_501 + * + * @param int|null $origin_status_501 Number of responses received from origin with status code 501 (Not Implemented). + * + * @return self + */ + public function setOriginStatus501($origin_status_501) + { + $this->container['origin_status_501'] = $origin_status_501; + + return $this; + } + + /** + * Gets origin_status_502 + * + * @return int|null + */ + public function getOriginStatus502() + { + return $this->container['origin_status_502']; + } + + /** + * Sets origin_status_502 + * + * @param int|null $origin_status_502 Number of responses received from origin with status code 502 (Bad Gateway). + * + * @return self + */ + public function setOriginStatus502($origin_status_502) + { + $this->container['origin_status_502'] = $origin_status_502; + + return $this; + } + + /** + * Gets origin_status_503 + * + * @return int|null + */ + public function getOriginStatus503() + { + return $this->container['origin_status_503']; + } + + /** + * Sets origin_status_503 + * + * @param int|null $origin_status_503 Number of responses received from origin with status code 503 (Service Unavailable). + * + * @return self + */ + public function setOriginStatus503($origin_status_503) + { + $this->container['origin_status_503'] = $origin_status_503; + + return $this; + } + + /** + * Gets origin_status_504 + * + * @return int|null + */ + public function getOriginStatus504() + { + return $this->container['origin_status_504']; + } + + /** + * Sets origin_status_504 + * + * @param int|null $origin_status_504 Number of responses received from origin with status code 504 (Gateway Timeout). + * + * @return self + */ + public function setOriginStatus504($origin_status_504) + { + $this->container['origin_status_504'] = $origin_status_504; + + return $this; + } + + /** + * Gets origin_status_505 + * + * @return int|null + */ + public function getOriginStatus505() + { + return $this->container['origin_status_505']; + } + + /** + * Sets origin_status_505 + * + * @param int|null $origin_status_505 Number of responses received from origin with status code 505 (HTTP Version Not Supported). + * + * @return self + */ + public function setOriginStatus505($origin_status_505) + { + $this->container['origin_status_505'] = $origin_status_505; + + return $this; + } + + /** + * Gets origin_status_1xx + * + * @return int|null + */ + public function getOriginStatus1xx() + { + return $this->container['origin_status_1xx']; + } + + /** + * Sets origin_status_1xx + * + * @param int|null $origin_status_1xx Number of \"Informational\" category status codes received from origin. + * + * @return self + */ + public function setOriginStatus1xx($origin_status_1xx) + { + $this->container['origin_status_1xx'] = $origin_status_1xx; + + return $this; + } + + /** + * Gets origin_status_2xx + * + * @return int|null + */ + public function getOriginStatus2xx() + { + return $this->container['origin_status_2xx']; + } + + /** + * Sets origin_status_2xx + * + * @param int|null $origin_status_2xx Number of \"Success\" status codes received from origin. + * + * @return self + */ + public function setOriginStatus2xx($origin_status_2xx) + { + $this->container['origin_status_2xx'] = $origin_status_2xx; + + return $this; + } + + /** + * Gets origin_status_3xx + * + * @return int|null + */ + public function getOriginStatus3xx() + { + return $this->container['origin_status_3xx']; + } + + /** + * Sets origin_status_3xx + * + * @param int|null $origin_status_3xx Number of \"Redirection\" codes received from origin. + * + * @return self + */ + public function setOriginStatus3xx($origin_status_3xx) + { + $this->container['origin_status_3xx'] = $origin_status_3xx; + + return $this; + } + + /** + * Gets origin_status_4xx + * + * @return int|null + */ + public function getOriginStatus4xx() + { + return $this->container['origin_status_4xx']; + } + + /** + * Sets origin_status_4xx + * + * @param int|null $origin_status_4xx Number of \"Client Error\" codes received from origin. + * + * @return self + */ + public function setOriginStatus4xx($origin_status_4xx) + { + $this->container['origin_status_4xx'] = $origin_status_4xx; + + return $this; + } + + /** + * Gets origin_status_5xx + * + * @return int|null + */ + public function getOriginStatus5xx() + { + return $this->container['origin_status_5xx']; + } + + /** + * Sets origin_status_5xx + * + * @param int|null $origin_status_5xx Number of \"Server Error\" codes received from origin. + * + * @return self + */ + public function setOriginStatus5xx($origin_status_5xx) + { + $this->container['origin_status_5xx'] = $origin_status_5xx; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + 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) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + 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() + { + 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/sig.json b/sig.json index 452166f5..3f615f1e 100644 --- a/sig.json +++ b/sig.json @@ -1 +1 @@ -{"G": "1737d053", "D": "d944a1e9"} +{"G": "4b5c526d", "D": "37a4f474"}