Giter VIP home page Giter VIP logo

fastly-py's Introduction

fastly-py

A Python client library for interacting with most facets of the Fastly API.

Requirements

Python >=3.6

Installation

python3 -m pip install fastly

Usage

import fastly
from fastly.api import acl_api
from pprint import pprint

# Authorize the client with a Fastly API token.
configuration = fastly.Configuration()
configuration.api_token = 'YOUR_API_KEY'

# Enter a context with an instance of the API client
with fastly.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = acl_api.AclApi(api_client)
    service_id = "SU1Z0isxPaozGVKXdv0eY" # str
    version_id = 1 # int
    name = "test-acl" # str

    try:
        # Create a new ACL
        api_response = api_instance.create_acl(service_id, version_id, name=name)
        pprint(api_response)
    except fastly.ApiException as e:
        print("Exception when calling AclApi->create_acl: %s\n" % e)

Authorization

Note

The Fastly API requires an API token for most operations.

Set it by assigning api_token to a configuration as shown:

# Authorize the client with a Fastly API token.
configuration = fastly.Configuration()
configuration.api_token = 'YOUR_API_KEY'

Alternatively, set the FASTLY_API_TOKEN environment variable.

API Endpoints

Table of API endpoints
Class Method Description
AclApi create_acl Create a new ACL
AclApi delete_acl Delete an ACL
AclApi get_acl Describe an ACL
AclApi list_acls List ACLs
AclApi update_acl Update an ACL
AclEntryApi bulk_update_acl_entries Update multiple ACL entries
AclEntryApi create_acl_entry Create an ACL entry
AclEntryApi delete_acl_entry Delete an ACL entry
AclEntryApi get_acl_entry Describe an ACL entry
AclEntryApi list_acl_entries List ACL entries
AclEntryApi update_acl_entry Update an ACL entry
ApexRedirectApi create_apex_redirect Create an apex redirect
ApexRedirectApi delete_apex_redirect Delete an apex redirect
ApexRedirectApi get_apex_redirect Get an apex redirect
ApexRedirectApi list_apex_redirects List apex redirects
ApexRedirectApi update_apex_redirect Update an apex redirect
AutomationTokensApi create_automation_token Create Automation Token
AutomationTokensApi get_automation_token_id Retrieve an Automation Token by ID
AutomationTokensApi get_automation_tokens_id_services List Automation Token Services
AutomationTokensApi list_automation_tokens List Customer Automation Tokens
AutomationTokensApi revoke_automation_token_id Revoke an Automation Token by ID
BackendApi create_backend Create a backend
BackendApi delete_backend Delete a backend
BackendApi get_backend Describe a backend
BackendApi list_backends List backends
BackendApi update_backend Update a backend
BillingApi get_invoice Get an invoice
BillingApi get_invoice_by_id Get an invoice
BillingApi get_invoice_mtd Get month-to-date billing estimate
BillingAddressApi add_billing_addr Add a billing address to a customer
BillingAddressApi delete_billing_addr Delete a billing address
BillingAddressApi get_billing_addr Get a billing address
BillingAddressApi update_billing_addr Update a billing address
BillingInvoicesApi get_invoice_by_invoice_id Get invoice by ID.
BillingInvoicesApi get_month_to_date_invoice Get month-to-date invoice.
BillingInvoicesApi list_invoices List of invoices.
BillingUsageMetricsApi get_service_level_usage Retrieve service-level usage metrics for a product.
BillingUsageMetricsApi get_service_level_usage_types Retrieve product usage types for a customer.
CacheSettingsApi create_cache_settings Create a cache settings object
CacheSettingsApi delete_cache_settings Delete a cache settings object
CacheSettingsApi get_cache_settings Get a cache settings object
CacheSettingsApi list_cache_settings List cache settings objects
CacheSettingsApi update_cache_settings Update a cache settings object
ConditionApi create_condition Create a condition
ConditionApi delete_condition Delete a condition
ConditionApi get_condition Describe a condition
ConditionApi list_conditions List conditions
ConditionApi update_condition Update a condition
ConfigStoreApi create_config_store Create a config store
ConfigStoreApi delete_config_store Delete a config store
ConfigStoreApi get_config_store Describe a config store
ConfigStoreApi get_config_store_info Get config store metadata
ConfigStoreApi list_config_store_services List linked services
ConfigStoreApi list_config_stores List config stores
ConfigStoreApi update_config_store Update a config store
ConfigStoreItemApi bulk_update_config_store_item Update multiple entries in a config store
ConfigStoreItemApi create_config_store_item Create an entry in a config store
ConfigStoreItemApi delete_config_store_item Delete an item from a config store
ConfigStoreItemApi get_config_store_item Get an item from a config store
ConfigStoreItemApi list_config_store_items List items in a config store
ConfigStoreItemApi update_config_store_item Update an entry in a config store
ConfigStoreItemApi upsert_config_store_item Insert or update an entry in a config store
ContactApi create_contacts Add a new customer contact
ContactApi delete_contact Delete a contact
ContactApi list_contacts List contacts
ContentApi content_check Check status of content in each POP's cache
CustomerApi delete_customer Delete a customer
CustomerApi get_customer Get a customer
CustomerApi get_logged_in_customer Get the logged in customer
CustomerApi list_users List users
CustomerApi update_customer Update a customer
DictionaryApi create_dictionary Create an edge dictionary
DictionaryApi delete_dictionary Delete an edge dictionary
DictionaryApi get_dictionary Get an edge dictionary
DictionaryApi list_dictionaries List edge dictionaries
DictionaryApi update_dictionary Update an edge dictionary
DictionaryInfoApi get_dictionary_info Get edge dictionary metadata
DictionaryItemApi bulk_update_dictionary_item Update multiple entries in an edge dictionary
DictionaryItemApi create_dictionary_item Create an entry in an edge dictionary
DictionaryItemApi delete_dictionary_item Delete an item from an edge dictionary
DictionaryItemApi get_dictionary_item Get an item from an edge dictionary
DictionaryItemApi list_dictionary_items List items in an edge dictionary
DictionaryItemApi update_dictionary_item Update an entry in an edge dictionary
DictionaryItemApi upsert_dictionary_item Insert or update an entry in an edge dictionary
DiffApi diff_service_versions Diff two service versions
DirectorApi create_director Create a director
DirectorApi delete_director Delete a director
DirectorApi get_director Get a director
DirectorApi list_directors List directors
DirectorApi update_director Update a director
DirectorBackendApi create_director_backend Create a director-backend relationship
DirectorBackendApi delete_director_backend Delete a director-backend relationship
DirectorBackendApi get_director_backend Get a director-backend relationship
DomainApi check_domain Validate DNS configuration for a single domain on a service
DomainApi check_domains Validate DNS configuration for all domains on a service
DomainApi create_domain Add a domain name to a service
DomainApi delete_domain Remove a domain from a service
DomainApi get_domain Describe a domain
DomainApi list_domains List domains
DomainApi update_domain Update a domain
DomainInspectorHistoricalApi get_domain_inspector_historical Get historical domain data for a service
DomainInspectorRealtimeApi get_domain_inspector_last120_seconds Get real-time domain data for the last 120 seconds
DomainInspectorRealtimeApi get_domain_inspector_last_max_entries Get a limited number of real-time domain data entries
DomainInspectorRealtimeApi get_domain_inspector_last_second Get real-time domain data from a specified time
DomainOwnershipsApi list_domain_ownerships List domain-ownerships
EnabledProductsApi disable_product Disable a product
EnabledProductsApi enable_product Enable a product
EnabledProductsApi get_enabled_product Get enabled product
EventsApi get_event Get an event
EventsApi list_events List events
GzipApi create_gzip_config Create a gzip configuration
GzipApi delete_gzip_config Delete a gzip configuration
GzipApi get_gzip_configs Get a gzip configuration
GzipApi list_gzip_configs List gzip configurations
GzipApi update_gzip_config Update a gzip configuration
HeaderApi create_header_object Create a Header object
HeaderApi delete_header_object Delete a Header object
HeaderApi get_header_object Get a Header object
HeaderApi list_header_objects List Header objects
HeaderApi update_header_object Update a Header object
HealthcheckApi create_healthcheck Create a health check
HealthcheckApi delete_healthcheck Delete a health check
HealthcheckApi get_healthcheck Get a health check
HealthcheckApi list_healthchecks List health checks
HealthcheckApi update_healthcheck Update a health check
HistoricalApi get_hist_stats Get historical stats
HistoricalApi get_hist_stats_aggregated Get aggregated historical stats
HistoricalApi get_hist_stats_field Get historical stats for a single field
HistoricalApi get_hist_stats_service Get historical stats for a single service
HistoricalApi get_hist_stats_service_field Get historical stats for a single service/field combination
HistoricalApi get_regions Get region codes
HistoricalApi get_usage Get usage statistics
HistoricalApi get_usage_month Get month-to-date usage statistics
HistoricalApi get_usage_service Get usage statistics per service
Http3Api create_http3 Enable support for HTTP/3
Http3Api delete_http3 Disable support for HTTP/3
Http3Api get_http3 Get HTTP/3 status
IamPermissionsApi list_permissions List permissions
IamRolesApi add_role_permissions Add permissions to a role
IamRolesApi create_a_role Create a role
IamRolesApi delete_a_role Delete a role
IamRolesApi get_a_role Get a role
IamRolesApi list_role_permissions List permissions in a role
IamRolesApi list_roles List roles
IamRolesApi remove_role_permissions Remove permissions from a role
IamRolesApi update_a_role Update a role
IamServiceGroupsApi add_service_group_services Add services in a service group
IamServiceGroupsApi create_a_service_group Create a service group
IamServiceGroupsApi delete_a_service_group Delete a service group
IamServiceGroupsApi get_a_service_group Get a service group
IamServiceGroupsApi list_service_group_services List services to a service group
IamServiceGroupsApi list_service_groups List service groups
IamServiceGroupsApi remove_service_group_services Remove services from a service group
IamServiceGroupsApi update_a_service_group Update a service group
IamUserGroupsApi add_user_group_members Add members to a user group
IamUserGroupsApi add_user_group_roles Add roles to a user group
IamUserGroupsApi add_user_group_service_groups Add service groups to a user group
IamUserGroupsApi create_a_user_group Create a user group
IamUserGroupsApi delete_a_user_group Delete a user group
IamUserGroupsApi get_a_user_group Get a user group
IamUserGroupsApi list_user_group_members List members of a user group
IamUserGroupsApi list_user_group_roles List roles in a user group
IamUserGroupsApi list_user_group_service_groups List service groups in a user group
IamUserGroupsApi list_user_groups List user groups
IamUserGroupsApi remove_user_group_members Remove members of a user group
IamUserGroupsApi remove_user_group_roles Remove roles from a user group
IamUserGroupsApi remove_user_group_service_groups Remove service groups from a user group
IamUserGroupsApi update_a_user_group Update a user group
ImageOptimizerDefaultSettingsApi get_default_settings Get current Image Optimizer Default Settings
ImageOptimizerDefaultSettingsApi update_default_settings Update Image Optimizer Default Settings
InvitationsApi create_invitation Create an invitation
InvitationsApi delete_invitation Delete an invitation
InvitationsApi list_invitations List invitations
KvStoreApi create_store Create a KV store.
KvStoreApi delete_store Delete a KV store.
KvStoreApi get_store Describe a KV store.
KvStoreApi get_stores List KV stores.
KvStoreItemApi delete_key_from_store Delete kv store item.
KvStoreItemApi get_keys List kv store keys.
KvStoreItemApi get_value_for_key Get the value of an kv store item
KvStoreItemApi set_value_for_key Insert an item into an kv store
LegacyWafConfigurationSetsApi list_waf_config_sets List configuration sets
LegacyWafConfigurationSetsApi list_wafs_config_set List WAFs currently using a configuration set
LegacyWafConfigurationSetsApi use_waf_config_set Apply a configuration set to a WAF
LegacyWafFirewallApi create_legacy_waf_firewall_service Create a firewall
LegacyWafFirewallApi disable_legacy_waf_firewall Disable a firewall
LegacyWafFirewallApi enable_legacy_waf_firewall Enable a firewall
LegacyWafFirewallApi get_legacy_waf_firewall Get a firewall object
LegacyWafFirewallApi get_legacy_waf_firewall_service Get a firewall
LegacyWafFirewallApi list_legacy_waf_firewalls List active firewalls
LegacyWafFirewallApi list_legacy_waf_firewalls_service List firewalls
LegacyWafFirewallApi update_legacy_waf_firewall_service Update a firewall
LegacyWafOwaspApi create_owasp_settings Create an OWASP settings object
LegacyWafOwaspApi get_owasp_settings Get the OWASP settings object
LegacyWafOwaspApi update_owasp_settings Update the OWASP settings object
LegacyWafRuleApi get_legacy_waf_firewall_rule_vcl Get VCL for a rule associated with a firewall
LegacyWafRuleApi get_legacy_waf_rule Get a rule
LegacyWafRuleApi get_legacy_waf_rule_vcl Get VCL for a rule
LegacyWafRuleApi list_legacy_waf_rules List rules in the latest configuration set
LegacyWafRuleStatusApi get_waf_firewall_rule_status Get the status of a rule on a firewall
LegacyWafRuleStatusApi list_waf_firewall_rule_statuses List rule statuses
LegacyWafRuleStatusApi update_waf_firewall_rule_status Update the status of a rule
LegacyWafRuleStatusApi update_waf_firewall_rule_statuses_tag Create or update status of a tagged group of rules
LegacyWafRulesetApi get_waf_ruleset Get a WAF ruleset
LegacyWafRulesetApi get_waf_ruleset_vcl Generate WAF ruleset VCL
LegacyWafRulesetApi update_waf_ruleset Update a WAF ruleset
LegacyWafTagApi list_legacy_waf_tags List WAF tags
LegacyWafUpdateStatusApi get_waf_update_status Get the status of a WAF update
LegacyWafUpdateStatusApi list_waf_update_statuses List update statuses
LoggingAzureblobApi create_log_azure Create an Azure Blob Storage log endpoint
LoggingAzureblobApi delete_log_azure Delete the Azure Blob Storage log endpoint
LoggingAzureblobApi get_log_azure Get an Azure Blob Storage log endpoint
LoggingAzureblobApi list_log_azure List Azure Blob Storage log endpoints
LoggingAzureblobApi update_log_azure Update an Azure Blob Storage log endpoint
LoggingBigqueryApi create_log_bigquery Create a BigQuery log endpoint
LoggingBigqueryApi delete_log_bigquery Delete a BigQuery log endpoint
LoggingBigqueryApi get_log_bigquery Get a BigQuery log endpoint
LoggingBigqueryApi list_log_bigquery List BigQuery log endpoints
LoggingBigqueryApi update_log_bigquery Update a BigQuery log endpoint
LoggingCloudfilesApi create_log_cloudfiles Create a Cloud Files log endpoint
LoggingCloudfilesApi delete_log_cloudfiles Delete the Cloud Files log endpoint
LoggingCloudfilesApi get_log_cloudfiles Get a Cloud Files log endpoint
LoggingCloudfilesApi list_log_cloudfiles List Cloud Files log endpoints
LoggingCloudfilesApi update_log_cloudfiles Update the Cloud Files log endpoint
LoggingDatadogApi create_log_datadog Create a Datadog log endpoint
LoggingDatadogApi delete_log_datadog Delete a Datadog log endpoint
LoggingDatadogApi get_log_datadog Get a Datadog log endpoint
LoggingDatadogApi list_log_datadog List Datadog log endpoints
LoggingDatadogApi update_log_datadog Update a Datadog log endpoint
LoggingDigitaloceanApi create_log_digocean Create a DigitalOcean Spaces log endpoint
LoggingDigitaloceanApi delete_log_digocean Delete a DigitalOcean Spaces log endpoint
LoggingDigitaloceanApi get_log_digocean Get a DigitalOcean Spaces log endpoint
LoggingDigitaloceanApi list_log_digocean List DigitalOcean Spaces log endpoints
LoggingDigitaloceanApi update_log_digocean Update a DigitalOcean Spaces log endpoint
LoggingElasticsearchApi create_log_elasticsearch Create an Elasticsearch log endpoint
LoggingElasticsearchApi delete_log_elasticsearch Delete an Elasticsearch log endpoint
LoggingElasticsearchApi get_log_elasticsearch Get an Elasticsearch log endpoint
LoggingElasticsearchApi list_log_elasticsearch List Elasticsearch log endpoints
LoggingElasticsearchApi update_log_elasticsearch Update an Elasticsearch log endpoint
LoggingFtpApi create_log_ftp Create an FTP log endpoint
LoggingFtpApi delete_log_ftp Delete an FTP log endpoint
LoggingFtpApi get_log_ftp Get an FTP log endpoint
LoggingFtpApi list_log_ftp List FTP log endpoints
LoggingFtpApi update_log_ftp Update an FTP log endpoint
LoggingGcsApi create_log_gcs Create a GCS log endpoint
LoggingGcsApi delete_log_gcs Delete a GCS log endpoint
LoggingGcsApi get_log_gcs Get a GCS log endpoint
LoggingGcsApi list_log_gcs List GCS log endpoints
LoggingGcsApi update_log_gcs Update a GCS log endpoint
LoggingHerokuApi create_log_heroku Create a Heroku log endpoint
LoggingHerokuApi delete_log_heroku Delete the Heroku log endpoint
LoggingHerokuApi get_log_heroku Get a Heroku log endpoint
LoggingHerokuApi list_log_heroku List Heroku log endpoints
LoggingHerokuApi update_log_heroku Update the Heroku log endpoint
LoggingHoneycombApi create_log_honeycomb Create a Honeycomb log endpoint
LoggingHoneycombApi delete_log_honeycomb Delete the Honeycomb log endpoint
LoggingHoneycombApi get_log_honeycomb Get a Honeycomb log endpoint
LoggingHoneycombApi list_log_honeycomb List Honeycomb log endpoints
LoggingHoneycombApi update_log_honeycomb Update a Honeycomb log endpoint
LoggingHttpsApi create_log_https Create an HTTPS log endpoint
LoggingHttpsApi delete_log_https Delete an HTTPS log endpoint
LoggingHttpsApi get_log_https Get an HTTPS log endpoint
LoggingHttpsApi list_log_https List HTTPS log endpoints
LoggingHttpsApi update_log_https Update an HTTPS log endpoint
LoggingKafkaApi create_log_kafka Create a Kafka log endpoint
LoggingKafkaApi delete_log_kafka Delete the Kafka log endpoint
LoggingKafkaApi get_log_kafka Get a Kafka log endpoint
LoggingKafkaApi list_log_kafka List Kafka log endpoints
LoggingKafkaApi update_log_kafka Update the Kafka log endpoint
LoggingKinesisApi create_log_kinesis Create an Amazon Kinesis log endpoint
LoggingKinesisApi delete_log_kinesis Delete the Amazon Kinesis log endpoint
LoggingKinesisApi get_log_kinesis Get an Amazon Kinesis log endpoint
LoggingKinesisApi list_log_kinesis List Amazon Kinesis log endpoints
LoggingKinesisApi update_log_kinesis Update the Amazon Kinesis log endpoint
LoggingLogentriesApi create_log_logentries Create a Logentries log endpoint
LoggingLogentriesApi delete_log_logentries Delete a Logentries log endpoint
LoggingLogentriesApi get_log_logentries Get a Logentries log endpoint
LoggingLogentriesApi list_log_logentries List Logentries log endpoints
LoggingLogentriesApi update_log_logentries Update a Logentries log endpoint
LoggingLogglyApi create_log_loggly Create a Loggly log endpoint
LoggingLogglyApi delete_log_loggly Delete a Loggly log endpoint
LoggingLogglyApi get_log_loggly Get a Loggly log endpoint
LoggingLogglyApi list_log_loggly List Loggly log endpoints
LoggingLogglyApi update_log_loggly Update a Loggly log endpoint
LoggingLogshuttleApi create_log_logshuttle Create a Log Shuttle log endpoint
LoggingLogshuttleApi delete_log_logshuttle Delete a Log Shuttle log endpoint
LoggingLogshuttleApi get_log_logshuttle Get a Log Shuttle log endpoint
LoggingLogshuttleApi list_log_logshuttle List Log Shuttle log endpoints
LoggingLogshuttleApi update_log_logshuttle Update a Log Shuttle log endpoint
LoggingNewrelicApi create_log_newrelic Create a New Relic log endpoint
LoggingNewrelicApi delete_log_newrelic Delete a New Relic log endpoint
LoggingNewrelicApi get_log_newrelic Get a New Relic log endpoint
LoggingNewrelicApi list_log_newrelic List New Relic log endpoints
LoggingNewrelicApi update_log_newrelic Update a New Relic log endpoint
LoggingNewrelicotlpApi create_log_newrelicotlp Create a New Relic OTLP endpoint
LoggingNewrelicotlpApi delete_log_newrelicotlp Delete a New Relic OTLP endpoint
LoggingNewrelicotlpApi get_log_newrelicotlp Get a New Relic OTLP endpoint
LoggingNewrelicotlpApi list_log_newrelicotlp List New Relic OTLP endpoints
LoggingNewrelicotlpApi update_log_newrelicotlp Update a New Relic log endpoint
LoggingOpenstackApi create_log_openstack Create an OpenStack log endpoint
LoggingOpenstackApi delete_log_openstack Delete an OpenStack log endpoint
LoggingOpenstackApi get_log_openstack Get an OpenStack log endpoint
LoggingOpenstackApi list_log_openstack List OpenStack log endpoints
LoggingOpenstackApi update_log_openstack Update an OpenStack log endpoint
LoggingPapertrailApi create_log_papertrail Create a Papertrail log endpoint
LoggingPapertrailApi delete_log_papertrail Delete a Papertrail log endpoint
LoggingPapertrailApi get_log_papertrail Get a Papertrail log endpoint
LoggingPapertrailApi list_log_papertrail List Papertrail log endpoints
LoggingPapertrailApi update_log_papertrail Update a Papertrail log endpoint
LoggingPubsubApi create_log_gcp_pubsub Create a GCP Cloud Pub/Sub log endpoint
LoggingPubsubApi delete_log_gcp_pubsub Delete a GCP Cloud Pub/Sub log endpoint
LoggingPubsubApi get_log_gcp_pubsub Get a GCP Cloud Pub/Sub log endpoint
LoggingPubsubApi list_log_gcp_pubsub List GCP Cloud Pub/Sub log endpoints
LoggingPubsubApi update_log_gcp_pubsub Update a GCP Cloud Pub/Sub log endpoint
LoggingS3Api create_log_aws_s3 Create an AWS S3 log endpoint
LoggingS3Api delete_log_aws_s3 Delete an AWS S3 log endpoint
LoggingS3Api get_log_aws_s3 Get an AWS S3 log endpoint
LoggingS3Api list_log_aws_s3 List AWS S3 log endpoints
LoggingS3Api update_log_aws_s3 Update an AWS S3 log endpoint
LoggingScalyrApi create_log_scalyr Create a Scalyr log endpoint
LoggingScalyrApi delete_log_scalyr Delete the Scalyr log endpoint
LoggingScalyrApi get_log_scalyr Get a Scalyr log endpoint
LoggingScalyrApi list_log_scalyr List Scalyr log endpoints
LoggingScalyrApi update_log_scalyr Update the Scalyr log endpoint
LoggingSftpApi create_log_sftp Create an SFTP log endpoint
LoggingSftpApi delete_log_sftp Delete an SFTP log endpoint
LoggingSftpApi get_log_sftp Get an SFTP log endpoint
LoggingSftpApi list_log_sftp List SFTP log endpoints
LoggingSftpApi update_log_sftp Update an SFTP log endpoint
LoggingSplunkApi create_log_splunk Create a Splunk log endpoint
LoggingSplunkApi delete_log_splunk Delete a Splunk log endpoint
LoggingSplunkApi get_log_splunk Get a Splunk log endpoint
LoggingSplunkApi list_log_splunk List Splunk log endpoints
LoggingSplunkApi update_log_splunk Update a Splunk log endpoint
LoggingSumologicApi create_log_sumologic Create a Sumologic log endpoint
LoggingSumologicApi delete_log_sumologic Delete a Sumologic log endpoint
LoggingSumologicApi get_log_sumologic Get a Sumologic log endpoint
LoggingSumologicApi list_log_sumologic List Sumologic log endpoints
LoggingSumologicApi update_log_sumologic Update a Sumologic log endpoint
LoggingSyslogApi create_log_syslog Create a syslog log endpoint
LoggingSyslogApi delete_log_syslog Delete a syslog log endpoint
LoggingSyslogApi get_log_syslog Get a syslog log endpoint
LoggingSyslogApi list_log_syslog List Syslog log endpoints
LoggingSyslogApi update_log_syslog Update a syslog log endpoint
MutualAuthenticationApi create_mutual_tls_authentication Create a Mutual Authentication
MutualAuthenticationApi delete_mutual_tls Delete a Mutual TLS
MutualAuthenticationApi get_mutual_authentication Get a Mutual Authentication
MutualAuthenticationApi list_mutual_authentications List Mutual Authentications
MutualAuthenticationApi patch_mutual_authentication Update a Mutual Authentication
ObservabilityCustomDashboardsApi create_dashboard Create a new dashboard
ObservabilityCustomDashboardsApi delete_dashboard Delete an existing dashboard
ObservabilityCustomDashboardsApi get_dashboard Retrieve a dashboard by ID
ObservabilityCustomDashboardsApi list_dashboards List all custom dashboards
ObservabilityCustomDashboardsApi update_dashboard Update an existing dashboard
OriginInspectorHistoricalApi get_origin_inspector_historical Get historical origin data for a service
OriginInspectorRealtimeApi get_origin_inspector_last120_seconds Get real-time origin data for the last 120 seconds
OriginInspectorRealtimeApi get_origin_inspector_last_max_entries Get a limited number of real-time origin data entries
OriginInspectorRealtimeApi get_origin_inspector_last_second Get real-time origin data from specific time.
PackageApi get_package Get details of the service's Compute package.
PackageApi put_package Upload a Compute package.
PoolApi create_server_pool Create a server pool
PoolApi delete_server_pool Delete a server pool
PoolApi get_server_pool Get a server pool
PoolApi list_server_pools List server pools
PoolApi update_server_pool Update a server pool
PopApi list_pops List Fastly POPs
PublicIpListApi list_fastly_ips List Fastly's public IPs
PublishApi publish Send messages to Fanout subscribers
PurgeApi bulk_purge_tag Purge multiple surrogate key tags
PurgeApi purge_all Purge everything from a service
PurgeApi purge_single_url Purge a URL
PurgeApi purge_tag Purge by surrogate key tag
RateLimiterApi create_rate_limiter Create a rate limiter
RateLimiterApi delete_rate_limiter Delete a rate limiter
RateLimiterApi get_rate_limiter Get a rate limiter
RateLimiterApi list_rate_limiters List rate limiters
RateLimiterApi update_rate_limiter Update a rate limiter
RealtimeApi get_stats_last120_seconds Get real-time data for the last 120 seconds
RealtimeApi get_stats_last120_seconds_limit_entries Get a limited number of real-time data entries
RealtimeApi get_stats_last_second Get real-time data from specified time
RequestSettingsApi create_request_settings Create a Request Settings object
RequestSettingsApi delete_request_settings Delete a Request Settings object
RequestSettingsApi get_request_settings Get a Request Settings object
RequestSettingsApi list_request_settings List Request Settings objects
RequestSettingsApi update_request_settings Update a Request Settings object
ResourceApi create_resource Create a resource link
ResourceApi delete_resource Delete a resource link
ResourceApi get_resource Display a resource link
ResourceApi list_resources List resource links
ResourceApi update_resource Update a resource link
ResponseObjectApi create_response_object Create a Response object
ResponseObjectApi delete_response_object Delete a Response Object
ResponseObjectApi get_response_object Get a Response object
ResponseObjectApi list_response_objects List Response objects
ResponseObjectApi update_response_object Update a Response object
SecretStoreApi client_key Create new client key
SecretStoreApi create_secret_store Create new secret store
SecretStoreApi delete_secret_store Delete secret store
SecretStoreApi get_secret_store Get secret store by ID
SecretStoreApi get_secret_stores Get all secret stores
SecretStoreApi signing_key Get public key
SecretStoreItemApi create_secret Create a new secret in a store.
SecretStoreItemApi delete_secret Delete a secret from a store.
SecretStoreItemApi get_secret Get secret metadata.
SecretStoreItemApi get_secrets List secrets within a store.
SecretStoreItemApi must_recreate_secret Recreate a secret in a store.
SecretStoreItemApi recreate_secret Create or recreate a secret in a store.
ServerApi create_pool_server Add a server to a pool
ServerApi delete_pool_server Delete a server from a pool
ServerApi get_pool_server Get a pool server
ServerApi list_pool_servers List servers in a pool
ServerApi update_pool_server Update a server
ServiceApi create_service Create a service
ServiceApi delete_service Delete a service
ServiceApi get_service Get a service
ServiceApi get_service_detail Get service details
ServiceApi list_service_domains List the domains within a service
ServiceApi list_services List services
ServiceApi search_service Search for a service by name
ServiceApi update_service Update a service
ServiceAuthorizationsApi create_service_authorization Create service authorization
ServiceAuthorizationsApi delete_service_authorization Delete service authorization
ServiceAuthorizationsApi delete_service_authorization2 Delete service authorizations
ServiceAuthorizationsApi list_service_authorization List service authorizations
ServiceAuthorizationsApi show_service_authorization Show service authorization
ServiceAuthorizationsApi update_service_authorization Update service authorization
ServiceAuthorizationsApi update_service_authorization2 Update service authorizations
SettingsApi get_service_settings Get service settings
SettingsApi update_service_settings Update service settings
SnippetApi create_snippet Create a snippet
SnippetApi delete_snippet Delete a snippet
SnippetApi get_snippet Get a versioned snippet
SnippetApi get_snippet_dynamic Get a dynamic snippet
SnippetApi list_snippets List snippets
SnippetApi update_snippet Update a versioned snippet
SnippetApi update_snippet_dynamic Update a dynamic snippet
StarApi create_service_star Create a star
StarApi delete_service_star Delete a star
StarApi get_service_star Get a star
StarApi list_service_stars List stars
StatsApi get_service_stats Get stats for a service
SudoApi request_sudo_access Request Sudo access
TlsActivationsApi create_tls_activation Enable TLS for a domain using a custom certificate
TlsActivationsApi delete_tls_activation Disable TLS on a domain
TlsActivationsApi get_tls_activation Get a TLS activation
TlsActivationsApi list_tls_activations List TLS activations
TlsActivationsApi update_tls_activation Update a certificate
TlsBulkCertificatesApi delete_bulk_tls_cert Delete a certificate
TlsBulkCertificatesApi get_tls_bulk_cert Get a certificate
TlsBulkCertificatesApi list_tls_bulk_certs List certificates
TlsBulkCertificatesApi update_bulk_tls_cert Update a certificate
TlsBulkCertificatesApi upload_tls_bulk_cert Upload a certificate
TlsCertificatesApi create_tls_cert Create a TLS certificate
TlsCertificatesApi delete_tls_cert Delete a TLS certificate
TlsCertificatesApi get_tls_cert Get a TLS certificate
TlsCertificatesApi get_tls_cert_blob Get a TLS certificate blob (Limited Availability)
TlsCertificatesApi list_tls_certs List TLS certificates
TlsCertificatesApi update_tls_cert Update a TLS certificate
TlsConfigurationsApi get_tls_config Get a TLS configuration
TlsConfigurationsApi list_tls_configs List TLS configurations
TlsConfigurationsApi update_tls_config Update a TLS configuration
TlsCsrsApi create_csr Create CSR
TlsDomainsApi list_tls_domains List TLS domains
TlsPrivateKeysApi create_tls_key Create a TLS private key
TlsPrivateKeysApi delete_tls_key Delete a TLS private key
TlsPrivateKeysApi get_tls_key Get a TLS private key
TlsPrivateKeysApi list_tls_keys List TLS private keys
TlsSubscriptionsApi create_globalsign_email_challenge Creates a GlobalSign email challenge.
TlsSubscriptionsApi create_tls_sub Create a TLS subscription
TlsSubscriptionsApi delete_globalsign_email_challenge Delete a GlobalSign email challenge
TlsSubscriptionsApi delete_tls_sub Delete a TLS subscription
TlsSubscriptionsApi get_tls_sub Get a TLS subscription
TlsSubscriptionsApi list_tls_subs List TLS subscriptions
TlsSubscriptionsApi patch_tls_sub Update a TLS subscription
TokensApi bulk_revoke_tokens Revoke multiple tokens
TokensApi create_token Create a token
TokensApi get_token Get a token
TokensApi get_token_current Get the current token
TokensApi list_tokens_customer List tokens for a customer
TokensApi list_tokens_user List tokens for the authenticated user
TokensApi revoke_token Revoke a token
TokensApi revoke_token_current Revoke the current token
UserApi create_user Create a user
UserApi delete_user Delete a user
UserApi get_current_user Get the current user
UserApi get_user Get a user
UserApi request_password_reset Request a password reset
UserApi update_user Update a user
UserApi update_user_password Update the user's password
VclApi create_custom_vcl Create a custom VCL file
VclApi delete_custom_vcl Delete a custom VCL file
VclApi get_custom_vcl Get a custom VCL file
VclApi get_custom_vcl_boilerplate Get boilerplate VCL
VclApi get_custom_vcl_generated Get the generated VCL for a service
VclApi get_custom_vcl_generated_highlighted Get the generated VCL with syntax highlighting
VclApi get_custom_vcl_highlighted Get a custom VCL file with syntax highlighting
VclApi get_custom_vcl_raw Download a custom VCL file
VclApi lint_vcl_default Lint (validate) VCL using a default set of flags.
VclApi lint_vcl_for_service Lint (validate) VCL using flags set for the service.
VclApi list_custom_vcl List custom VCL files
VclApi set_custom_vcl_main Set a custom VCL file as main
VclApi update_custom_vcl Update a custom VCL file
VclDiffApi vcl_diff_service_versions Get a comparison of the VCL changes between two service versions
VersionApi activate_service_version Activate a service version
VersionApi clone_service_version Clone a service version
VersionApi create_service_version Create a service version
VersionApi deactivate_service_version Deactivate a service version
VersionApi get_service_version Get a version of a service
VersionApi list_service_versions List versions of a service
VersionApi lock_service_version Lock a service version
VersionApi update_service_version Update a service version
VersionApi validate_service_version Validate a service version
WafActiveRulesApi bulk_delete_waf_active_rules Delete multiple active rules from a WAF
WafActiveRulesApi bulk_update_waf_active_rules Update multiple active rules
WafActiveRulesApi create_waf_active_rule Add a rule to a WAF as an active rule
WafActiveRulesApi create_waf_active_rules_tag Create active rules by tag
WafActiveRulesApi delete_waf_active_rule Delete an active rule
WafActiveRulesApi get_waf_active_rule Get an active WAF rule object
WafActiveRulesApi list_waf_active_rules List active rules on a WAF
WafActiveRulesApi update_waf_active_rule Update an active rule
WafExclusionsApi create_waf_rule_exclusion Create a WAF rule exclusion
WafExclusionsApi delete_waf_rule_exclusion Delete a WAF rule exclusion
WafExclusionsApi get_waf_rule_exclusion Get a WAF rule exclusion
WafExclusionsApi list_waf_rule_exclusions List WAF rule exclusions
WafExclusionsApi update_waf_rule_exclusion Update a WAF rule exclusion
WafFirewallVersionsApi clone_waf_firewall_version Clone a firewall version
WafFirewallVersionsApi create_waf_firewall_version Create a firewall version
WafFirewallVersionsApi deploy_activate_waf_firewall_version Deploy or activate a firewall version
WafFirewallVersionsApi get_waf_firewall_version Get a firewall version
WafFirewallVersionsApi list_waf_firewall_versions List firewall versions
WafFirewallVersionsApi update_waf_firewall_version Update a firewall version
WafFirewallsApi create_waf_firewall Create a firewall
WafFirewallsApi delete_waf_firewall Delete a firewall
WafFirewallsApi get_waf_firewall Get a firewall
WafFirewallsApi list_waf_firewalls List firewalls
WafFirewallsApi update_waf_firewall Update a firewall
WafRuleRevisionsApi get_waf_rule_revision Get a revision of a rule
WafRuleRevisionsApi list_waf_rule_revisions List revisions for a rule
WafRulesApi get_waf_rule Get a rule
WafRulesApi list_waf_rules List available WAF rules
WafTagsApi list_waf_tags List tags
WholePlatformDdosHistoricalApi get_platform_ddos_historical Get historical DDoS metrics for the entire Fastly platform

Issues

The fastly-py API client currently does not support the following endpoints:

If you encounter any non-security-related bug or unexpected behavior, please file an issue using the bug report template.

Security issues

Please see our SECURITY.md for guidance on reporting security-related issues.

License

MIT.

fastly-py's People

Contributors

andriantoniades avatar blithe avatar conorbranagan avatar davidebeatrici avatar dcmoore-gd avatar di avatar djworth avatar edmund-huber avatar everdance avatar gschorkopf avatar harmony7 avatar ilons avatar integralist avatar jakeroggenbuck avatar justizin avatar kshay avatar lanej avatar lizards avatar mmay avatar pedropregueiro avatar psbanka avatar sajal avatar sivy avatar stanimoto avatar thommahoney avatar tomds avatar tyler avatar verkaufer avatar vu3jej avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fastly-py's Issues

ApiValueError when calling billing api from example

just trying the docs for month to date bill found here, and hit an exception internally to the package. Tried another billing_api endpoint and it also hit the same error.

fastly.exceptions.ApiValueError: Invalid inputs given to generate an instance of 'Billing'. The input data was invalid for the allOf schema 'Billing' in the composed schema 'BillingEstimateResponse'. Error=Invalid type for variable 'cost'. Required value type is dict and passed type was float at ['received_data']['regions']['usa']['cost']

Drop python2 support for new releases

  • We need to come up with a plan for this, which includes finding out more information from our users as to how many of them are still using Python2 and when to drop support.
  • How do we communicate this to our customers?

Remove non-secure (http-only) access to API

Fastly APIs must be used with ssl. Having the environment variable FASTLY_SECURE which toggles between http and https is not useful and is actively confusing because any communication to fastly's APIs via http will simply not work. Let's remove this feature.

Error: Invalid inputs given to generate an instance of 'Token'

Version

fastly==4.0.0

What happened

I got an error while trying to list all tokens belonging to a customer.

In order to get started, I used the sample script provided here: https://github.com/fastly/fastly-py/blob/main/docs/TokensApi.md#list_tokens_customer

But when I tested it, I got the following error:

Traceback (most recent call last):
  File "/home/gasper/.local/lib/python3.10/site-packages/fastly/model_utils.py", line 1784, in get_allof_instances
    allof_instance = allof_class._from_openapi_data(**model_args, **constant_args)
  File "/home/gasper/.local/lib/python3.10/site-packages/fastly/model_utils.py", line 45, in wrapped_init
    return fn(_self, *args, **kwargs)
  File "/home/gasper/.local/lib/python3.10/site-packages/fastly/model/token.py", line 183, in _from_openapi_data
    setattr(self, var_name, var_value)
  File "/home/gasper/.local/lib/python3.10/site-packages/fastly/model_utils.py", line 184, in __setattr__
    self[attr] = value
  File "/home/gasper/.local/lib/python3.10/site-packages/fastly/model_utils.py", line 509, in __setitem__
    self.set_attribute(name, value)
  File "/home/gasper/.local/lib/python3.10/site-packages/fastly/model_utils.py", line 160, in set_attribute
    check_allowed_values(
  File "/home/gasper/.local/lib/python3.10/site-packages/fastly/model_utils.py", line 872, in check_allowed_values
    raise ApiValueError(
fastly.exceptions.ApiValueError: Invalid value for `scope` (global:read global), must be one of ['global', 'purge_select', 'purge_all', 'global:read']

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/gasper/Documents/work/experiments/audit_fastly_users/main.py", line 64, in <module>
    main()
  File "/home/gasper/Documents/work/experiments/audit_fastly_users/main.py", line 45, in main
    customer_tokens = list_customer_tokens(fastly_api_key, customer_id)
  File "/home/gasper/Documents/work/experiments/audit_fastly_users/main.py", line 32, in list_customer_tokens
    api_response = api_instance.list_tokens_customer(customer_id)
  File "/home/gasper/.local/lib/python3.10/site-packages/fastly/api/tokens_api.py", line 850, in list_tokens_customer
    return self.list_tokens_customer_endpoint.call_with_http_info(**kwargs)
  File "/home/gasper/.local/lib/python3.10/site-packages/fastly/api_client.py", line 872, in call_with_http_info
    return self.api_client.call_api(
  File "/home/gasper/.local/lib/python3.10/site-packages/fastly/api_client.py", line 427, in call_api
    return self.__call_api(resource_path, method,
  File "/home/gasper/.local/lib/python3.10/site-packages/fastly/api_client.py", line 236, in __call_api
    return_data = self.deserialize(
  File "/home/gasper/.local/lib/python3.10/site-packages/fastly/api_client.py", line 341, in deserialize
    deserialized_data = validate_and_convert_types(
  File "/home/gasper/.local/lib/python3.10/site-packages/fastly/model_utils.py", line 1619, in validate_and_convert_types
    input_value[index] = validate_and_convert_types(
  File "/home/gasper/.local/lib/python3.10/site-packages/fastly/model_utils.py", line 1569, in validate_and_convert_types
    converted_instance = attempt_convert_item(
  File "/home/gasper/.local/lib/python3.10/site-packages/fastly/model_utils.py", line 1462, in attempt_convert_item
    raise conversion_exc
  File "/home/gasper/.local/lib/python3.10/site-packages/fastly/model_utils.py", line 1453, in attempt_convert_item
    return deserialize_model(input_value, valid_class,
  File "/home/gasper/.local/lib/python3.10/site-packages/fastly/model_utils.py", line 1373, in deserialize_model
    return model_class._new_from_openapi_data(**kw_args)
  File "/home/gasper/.local/lib/python3.10/site-packages/fastly/model_utils.py", line 45, in wrapped_init
    return fn(_self, *args, **kwargs)
  File "/home/gasper/.local/lib/python3.10/site-packages/fastly/model_utils.py", line 369, in _new_from_openapi_data
    return cls._from_openapi_data(*args, **kwargs)
  File "/home/gasper/.local/lib/python3.10/site-packages/fastly/model_utils.py", line 45, in wrapped_init
    return fn(_self, *args, **kwargs)
  File "/home/gasper/.local/lib/python3.10/site-packages/fastly/model/token_response.py", line 223, in _from_openapi_data
    composed_info = validate_get_composed_info(
  File "/home/gasper/.local/lib/python3.10/site-packages/fastly/model_utils.py", line 1992, in validate_get_composed_info
    allof_instances = get_allof_instances(self, model_args, constant_args)
  File "/home/gasper/.local/lib/python3.10/site-packages/fastly/model_utils.py", line 1789, in get_allof_instances
    raise ApiValueError(
fastly.exceptions.ApiValueError: Invalid inputs given to generate an instance of 'Token'. The input data was invalid for the allOf schema 'Token' in the composed schema 'TokenResponse'. Error=Invalid value for `scope` (global:read global), must be one of ['global', 'purge_select', 'purge_all', 'global:read']

I was expecting to get a list containing all tokens belonging to my customer account.
Am I missing something? Can you folks help me to understand that error?

Any support would be highly appreciated!
Thank you!

query() got multiple values for keyword argument 'method'

I noticed when trying to create a Healthcheck the method property clashes with the parameter in query().

payload = {
    "service_id": newService.attrs["id"],
    "version": 1,
    "name": TEST_NAME,
    "host": REQ_HOST,
    "method": "GET",
    "path": TEST_PATH,
    "expected_response": 200,
    "check_interval": 60000,
    "initial": 1,
    "threshold": 1,
    "timeout": 5000,
    "window": 2,
}
newHealthcheck = fastly.models.Healthcheck.create(api.conn, data=payload)
Traceback (most recent call last):
  File "./python/main.py", line 54, in <module>
    newHealthcheck = fastly.models.Healthcheck.create(api.conn, data=payload)
  File "/usr/local/lib/python2.7/site-packages/fastly/models.py", line 79, in create
    instance.save()
  File "/usr/local/lib/python2.7/site-packages/fastly/models.py", line 44, in save
    resp, data = self._collection_query('POST', body=params_str)
  File "/usr/local/lib/python2.7/site-packages/fastly/models.py", line 29, in _collection_query
    return self.__class__.query(self.conn, self.COLLECTION_PATTERN, method, suffix, body, **self.attrs)
TypeError: query() got multiple values for keyword argument 'method'

Lack of documentation

it would be nice to officially have some documentation for this package and its public functions. We should use a system like PyDoc to do this.

'fastly is not a package' on macos with python 3.11

➜  fastly python3 -m pip install fastly
Requirement already satisfied: fastly in /usr/local/lib/python3.11/site-packages (2.2.1)
➜  fastly python3
Python 3.11.2 (main, Mar 24 2023, 00:31:37) [Clang 14.0.0 (clang-1400.0.29.202)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import fastly
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<redacted>/fastly.py", line 2, in <module>
    from fastly.api import tokens_api
ModuleNotFoundError: No module named 'fastly.api'; 'fastly' is not a package
>>>

tls_configurations error on upload_tls_bulk_cert()

Version

fastly==1.3.0

What happened

I'm attempting to upload a TLS cert with the upload_tls_bulk_cert() method.

When I structure the request as per this example:

https://developer.fastly.com/reference/api/tls/platform/#upload-tls-bulk-cert

I get this error:

AttributeError: 'dict' object has no attribute 'tls_configurations'

The error looks like it's originating from the model_utils - I've got a stacktrace here:

https://gist.github.com/mechanicalgirl/9421a604b989b3ebb65aa3b44092b5bf

I've also tried structuring the request as per these docs:

https://github.com/fastly/fastly-py/blob/main/docs/TlsBulkCertificatesApi.md#upload_tls_bulk_cert

Where the error returned is this:

Exception when calling TlsBulkCertificatesApi->upload_tls_bulk_cert: (400)
Reason: Bad Request
HTTP response body: {"errors":[{"title":"Missing required attribute","detail":"param is missing or the value is empty: tls_configuration_ids"}]}

(My apologies, I did not save a stacktrace from this one.)

I've been able to get this working with a workaround that uses the request library and hits the api.fastly.com/tls/bulk/certificates endpoint directly.

I started with a Fastly support request - one of their engineers directed me to submit an issue here. Their ticket is https://support.fastly.com/hc/en-us/requests/610399 and may provide more detail. (There are some of my code examples in that ticket, although I don't think they'll be helpful as they mirror what's in your docs exactly, aside from the specific values being passed.)

Incomplete API

Are there plans to implement all APIs in this module? Looks like it is only supporting a readonly API calls. go-fastly seems to have a more complete implementation.

Wrong type error when passing Integer

Version 1.0.0

This is happening for various API calls. When passing the int value to the call it still says string is passed.

fastly.exceptions.ApiTypeError: Invalid type for variable 'version'. Required value type is int and passed type was str at ['received_data']['version']

This is the API call where version_is is int, I tried type casting too but still the same problem persists.

I observed this in other calls too.

api_response = api_instance.create_snippet(service_id, 44 , name=snippet_name, dynamic=dynamic, type=type, content=content, priority=priority)

Traceback (most recent call last):
File "/Users/kondapal/fastly_py/main.py", line 47, in
vcl.createVCLSnippet(configuration, service_id, int(cloned_service_version), acl_name, vcl_snippet)
File "/Users/kondapal/fastly_py/vcl.py", line 43, in createVCLSnippet
api_response = api_instance.create_snippet(service_id, version_id , name=snippet_name, dynamic=dynamic, type=type, content=content, priority=priority)
File "/usr/local/lib/python3.10/site-packages/fastly/api/snippet_api.py", line 573, in create_snippet
return self.create_snippet_endpoint.call_with_http_info(**kwargs)
File "/usr/local/lib/python3.10/site-packages/fastly/api_client.py", line 862, in call_with_http_info
return self.api_client.call_api(
File "/usr/local/lib/python3.10/site-packages/fastly/api_client.py", line 421, in call_api
return self.__call_api(resource_path, method,
File "/usr/local/lib/python3.10/site-packages/fastly/api_client.py", line 232, in __call_api
return_data = self.deserialize(
File "/usr/local/lib/python3.10/site-packages/fastly/api_client.py", line 337, in deserialize
deserialized_data = validate_and_convert_types(
File "/usr/local/lib/python3.10/site-packages/fastly/model_utils.py", line 1569, in validate_and_convert_types
converted_instance = attempt_convert_item(
File "/usr/local/lib/python3.10/site-packages/fastly/model_utils.py", line 1462, in attempt_convert_item
raise conversion_exc
File "/usr/local/lib/python3.10/site-packages/fastly/model_utils.py", line 1453, in attempt_convert_item
return deserialize_model(input_value, valid_class,
File "/usr/local/lib/python3.10/site-packages/fastly/model_utils.py", line 1373, in deserialize_model
return model_class._new_from_openapi_data(**kw_args)
File "/usr/local/lib/python3.10/site-packages/fastly/model_utils.py", line 45, in wrapped_init
return fn(_self, *args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/fastly/model_utils.py", line 369, in _new_from_openapi_data
return cls._from_openapi_data(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/fastly/model_utils.py", line 45, in wrapped_init
return fn(_self, *args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/fastly/model/snippet_response.py", line 233, in _from_openapi_data
composed_info = validate_get_composed_info(
File "/usr/local/lib/python3.10/site-packages/fastly/model_utils.py", line 1992, in validate_get_composed_info
allof_instances = get_allof_instances(self, model_args, constant_args)
File "/usr/local/lib/python3.10/site-packages/fastly/model_utils.py", line 1789, in get_allof_instances
raise ApiValueError(
fastly.exceptions.ApiValueError: Invalid inputs given to generate an instance of 'ServiceIdAndVersion'. The input data was invalid for the allOf schema 'ServiceIdAndVersion' in the composed schema 'SnippetResponse'. Error=Invalid type for variable 'version'. Required value type is int and passed type was str at ['received_data']['version']

Get Service details is broken

Hi,
I'm trying to run get_service_detail function and receiving an error both with using service version and without it:

Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 1784, in get_allof_instances
    allof_instance = allof_class._from_openapi_data(**model_args, **constant_args)
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 45, in wrapped_init
    return fn(_self, *args, **kwargs)
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model/version_detail.py", line 239, in _from_openapi_data
    setattr(self, var_name, var_value)
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 184, in __setattr__
    self[attr] = value
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 509, in __setitem__
    self.set_attribute(name, value)
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 156, in set_attribute
    value = validate_and_convert_types(
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 1619, in validate_and_convert_types
    input_value[index] = validate_and_convert_types(
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 1569, in validate_and_convert_types
    converted_instance = attempt_convert_item(
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 1453, in attempt_convert_item
    return deserialize_model(input_value, valid_class,
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 1373, in deserialize_model
    return model_class._new_from_openapi_data(**kw_args)
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 45, in wrapped_init
    return fn(_self, *args, **kwargs)
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 369, in _new_from_openapi_data
    return cls._from_openapi_data(*args, **kwargs)
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 45, in wrapped_init
    return fn(_self, *args, **kwargs)
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model/header_response.py", line 245, in _from_openapi_data
    composed_info = validate_get_composed_info(
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 1992, in validate_get_composed_info
    allof_instances = get_allof_instances(self, model_args, constant_args)
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 1780, in get_allof_instances
    for allof_class in self._composed_schemas['allOf']:
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 62, in __get__
    result = self._fn()
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model/header_response.py", line 387, in _composed_schemas
    lazy_import()
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model/header_response.py", line 35, in lazy_import
    from fastly.model.str_none_type import StrNoneType
ModuleNotFoundError: No module named 'fastly.model.str_none_type'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 1784, in get_allof_instances
    allof_instance = allof_class._from_openapi_data(**model_args, **constant_args)
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 45, in wrapped_init
    return fn(_self, *args, **kwargs)
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model/service_detail_all_of.py", line 181, in _from_openapi_data
    setattr(self, var_name, var_value)
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 184, in __setattr__
    self[attr] = value
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 509, in __setitem__
    self.set_attribute(name, value)
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 156, in set_attribute
    value = validate_and_convert_types(
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 1569, in validate_and_convert_types
    converted_instance = attempt_convert_item(
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 1462, in attempt_convert_item
    raise conversion_exc
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 1453, in attempt_convert_item
    return deserialize_model(input_value, valid_class,
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 1373, in deserialize_model
    return model_class._new_from_openapi_data(**kw_args)
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 45, in wrapped_init
    return fn(_self, *args, **kwargs)
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 369, in _new_from_openapi_data
    return cls._from_openapi_data(*args, **kwargs)
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 45, in wrapped_init
    return fn(_self, *args, **kwargs)
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model/service_version_detail.py", line 279, in _from_openapi_data
    composed_info = validate_get_composed_info(
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 1992, in validate_get_composed_info
    allof_instances = get_allof_instances(self, model_args, constant_args)
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 1789, in get_allof_instances
    raise ApiValueError(
fastly.exceptions.ApiValueError: Invalid inputs given to generate an instance of 'VersionDetail'. The input data was invalid for the allOf schema 'VersionDetail' in the composed schema 'ServiceVersionDetail'. Error=No module named 'fastly.model.str_none_type'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/davidg/Code/devops/lambdas/fastly/main.py", line 126, in <module>
    api_response = api_instance.get_service_detail(service_id)
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/api/service_api.py", line 830, in get_service_detail
    return self.get_service_detail_endpoint.call_with_http_info(**kwargs)
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/api_client.py", line 862, in call_with_http_info
    return self.api_client.call_api(
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/api_client.py", line 421, in call_api
    return self.__call_api(resource_path, method,
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/api_client.py", line 232, in __call_api
    return_data = self.deserialize(
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/api_client.py", line 337, in deserialize
    deserialized_data = validate_and_convert_types(
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 1569, in validate_and_convert_types
    converted_instance = attempt_convert_item(
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 1462, in attempt_convert_item
    raise conversion_exc
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 1453, in attempt_convert_item
    return deserialize_model(input_value, valid_class,
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 1373, in deserialize_model
    return model_class._new_from_openapi_data(**kw_args)
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 45, in wrapped_init
    return fn(_self, *args, **kwargs)
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 369, in _new_from_openapi_data
    return cls._from_openapi_data(*args, **kwargs)
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 45, in wrapped_init
    return fn(_self, *args, **kwargs)
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model/service_detail.py", line 226, in _from_openapi_data
    composed_info = validate_get_composed_info(
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 1992, in validate_get_composed_info
    allof_instances = get_allof_instances(self, model_args, constant_args)
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 1789, in get_allof_instances
    raise ApiValueError(
fastly.exceptions.ApiValueError: Invalid inputs given to generate an instance of 'ServiceDetailAllOf'. The input data was invalid for the allOf schema 'ServiceDetailAllOf' in the composed schema 'ServiceDetail'. Error=Invalid inputs given to generate an instance of 'VersionDetail'. The input data was invalid for the allOf schema 'VersionDetail' in the composed schema 'ServiceVersionDetail'. Error=No module named 'fastly.model.str_none_type'

The code is the example code in get_service_detail with correct api key and service id and using latest 1.1.0 version.

From debbugin it looks like this module is really not exists in the code:

from fastly.model.str_none_type import StrNoneType

Set up Makefile

it's nice to be able to have the tooling in place to do all the critical tasks with the project, specifically:

  • lint (when we have a linting system)
  • build
  • publish
  • test
  • doc (when we have a doc system)

Method `list_acl_entries` is broken

Version

4.1.1

What happened

Finally got to test the latest updates, but list_acl_entries is broken. Running identical code to example:

        try:
            # List ACL entries
            api_response = api_instance.list_acl_entries(service_id, acl_id)
            pprint(api_response)
        except fastly.ApiException as e:
            print("Exception when calling AclEntryApi->list_acl_entries: %s\n" % e)

And getting the following error:

Invalid inputs given to generate an instance of 'AclEntry'. The input data was invalid for the allOf schema 'AclEntry' in the composed schema 'AclEntryResponse'. Error=Invalid type for variable 'negated'. Required value type is int and passed type was str at ['received_data'][0]['negated']
fastly.exceptions.ApiTypeError: Invalid type for variable 'negated'. Required value type is int and passed type was str at ['received_data'][0]['negated']

The values of service_id and acl_id are valid IDs and type of str, currently using requests workaround:

    response = requests.get(
        "{}/service/{}/acl/{}/entries".format(FASTLY_API_URL, service_id, acl_id),
        headers={
            "Fastly-Key": FASTLY_API_KEY,
            "Accept": "application/json"
        },
        timeout=5)

Missing required dependencies from package metadata

Version

4.2.2

What happened

When installing the 4.2.2 version, the required dependencies are not resolved. For e.g.

12:10 $ pip install fastly
Looking in indexes: https://local-pypi-repo/artifactory/api/pypi/pypi-repos/simple
Collecting fastly
  Downloading https://local-pypi-repo/artifactory/api/pypi/pypi-repos/packages/packages/22/ef/651e717cba0fbf73ad1a23256b1224860aa1172e5c521482d4b870d75153/fastly-4.2.2-py3-none-any.whl (2.6 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.6/2.6 MB 7.9 MB/s eta 0:00:00
Installing collected packages: fastly
Successfully installed fastly-4.2.2

I would expect urllib3 and python-dateutil to be installed as per the setup config here.

The missing package metadata (and the dependencies) results in import errors

Python 3.9.13 (main, Jan 31 2023, 15:38:49)
[Clang 14.0.0 (clang-1400.0.29.202)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import fastly
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/dmistry/.pyenv/versions/gh-py-libs-39/lib/python3.9/site-packages/fastly/__init__.py", line 16, in <module>
    from fastly.api_client import ApiClient
  File "/Users/dmistry/.pyenv/versions/gh-py-libs-39/lib/python3.9/site-packages/fastly/api_client.py", line 20, in <module>
    from urllib3.fields import RequestField
ModuleNotFoundError: No module named 'urllib3'
>>>

readme references old version

The readme file mentions "This 1.x release" but we're well into 2.x releases now. Also, couldn't find a CONTRIBUTING file that would tell me where to send a PR to fix it myself.

License to use?

Sorry to nit-pick here, I'm not a lawyer but I'm asked to clarify the license for this code (BSD, MIT, etc.). Do you have a preference?

The set of HTTP response codes checked is incomplete

In connection.py there are only a few HTTP error codes checked for: 400,401,403,404,500 but we often see several other responses, especially HTTP 502. The logic to do this checking is a little flawed, it assumes any response not caught specifically is an OK response, requiring clients to do extensive checking on each call for the extra error cases.

This logic should be rewritten to either raise specific errors for all possible cases, or to raise a default error when the status code is not 2xx.

CustomerApi list_users doesn't like require_new_password being null

Version

Python 3.11.3
fastly 2.3.0

What happened

Tried following each of these CustomerApi list_users examples:
https://developer.fastly.com/reference/api/account/customer/#list-users
https://github.com/fastly/fastly-py/blob/main/docs/CustomerApi.md#list_users

With both, I get this error:

Traceback (most recent call last):
  File "/home/pnickerson/.local/lib/python3.11/site-packages/fastly/model_utils.py", line 1784, in get_allof_instances
    allof_instance = allof_class._from_openapi_data(**model_args, **constant_args)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pnickerson/.local/lib/python3.11/site-packages/fastly/model_utils.py", line 45, in wrapped_init
    return fn(_self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pnickerson/.local/lib/python3.11/site-packages/fastly/model/user.py", line 198, in _from_openapi_data
    setattr(self, var_name, var_value)
  File "/home/pnickerson/.local/lib/python3.11/site-packages/fastly/model_utils.py", line 184, in __setattr__
    self[attr] = value
    ~~~~^^^^^^
  File "/home/pnickerson/.local/lib/python3.11/site-packages/fastly/model_utils.py", line 509, in __setitem__
    self.set_attribute(name, value)
  File "/home/pnickerson/.local/lib/python3.11/site-packages/fastly/model_utils.py", line 156, in set_attribute
    value = validate_and_convert_types(
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pnickerson/.local/lib/python3.11/site-packages/fastly/model_utils.py", line 1569, in validate_and_convert_types
    converted_instance = attempt_convert_item(
                         ^^^^^^^^^^^^^^^^^^^^^
  File "/home/pnickerson/.local/lib/python3.11/site-packages/fastly/model_utils.py", line 1448, in attempt_convert_item
    raise get_type_error(input_value, path_to_item, valid_classes,
fastly.exceptions.ApiTypeError: Invalid type for variable 'require_new_password'. Required value type is bool and passed type was NoneType at ['received_data'][0]['require_new_password']

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/pnickerson/repositories/devops_shared/cashstar/./uar-fastly.py", line 32, in <module>
    api_response = api_instance.list_users(customer_id)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pnickerson/.local/lib/python3.11/site-packages/fastly/api/customer_api.py", line 762, in list_users
    return self.list_users_endpoint.call_with_http_info(**kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pnickerson/.local/lib/python3.11/site-packages/fastly/api_client.py", line 872, in call_with_http_info
    return self.api_client.call_api(
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pnickerson/.local/lib/python3.11/site-packages/fastly/api_client.py", line 427, in call_api
    return self.__call_api(resource_path, method,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pnickerson/.local/lib/python3.11/site-packages/fastly/api_client.py", line 236, in __call_api
    return_data = self.deserialize(
                  ^^^^^^^^^^^^^^^^^
  File "/home/pnickerson/.local/lib/python3.11/site-packages/fastly/api_client.py", line 341, in deserialize
    deserialized_data = validate_and_convert_types(
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pnickerson/.local/lib/python3.11/site-packages/fastly/model_utils.py", line 1619, in validate_and_convert_types
    input_value[index] = validate_and_convert_types(
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pnickerson/.local/lib/python3.11/site-packages/fastly/model_utils.py", line 1569, in validate_and_convert_types
    converted_instance = attempt_convert_item(
                         ^^^^^^^^^^^^^^^^^^^^^
  File "/home/pnickerson/.local/lib/python3.11/site-packages/fastly/model_utils.py", line 1462, in attempt_convert_item
    raise conversion_exc
  File "/home/pnickerson/.local/lib/python3.11/site-packages/fastly/model_utils.py", line 1453, in attempt_convert_item
    return deserialize_model(input_value, valid_class,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pnickerson/.local/lib/python3.11/site-packages/fastly/model_utils.py", line 1373, in deserialize_model
    return model_class._new_from_openapi_data(**kw_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pnickerson/.local/lib/python3.11/site-packages/fastly/model_utils.py", line 45, in wrapped_init
    return fn(_self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pnickerson/.local/lib/python3.11/site-packages/fastly/model_utils.py", line 369, in _new_from_openapi_data
    return cls._from_openapi_data(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pnickerson/.local/lib/python3.11/site-packages/fastly/model_utils.py", line 45, in wrapped_init
    return fn(_self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pnickerson/.local/lib/python3.11/site-packages/fastly/model/schemas_user_response.py", line 226, in _from_openapi_data
    composed_info = validate_get_composed_info(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pnickerson/.local/lib/python3.11/site-packages/fastly/model_utils.py", line 1992, in validate_get_composed_info
    allof_instances = get_allof_instances(self, model_args, constant_args)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pnickerson/.local/lib/python3.11/site-packages/fastly/model_utils.py", line 1789, in get_allof_instances
    raise ApiValueError(
fastly.exceptions.ApiValueError: Invalid inputs given to generate an instance of 'User'. The input data was invalid for the allOf schema 'User' in the composed schema 'SchemasUserResponse'. Error=Invalid type for variable 'require_new_password'. Required value type is bool and passed type was NoneType at ['received_data'][0]['require_new_password']

If I use curl against the API, I notice the result includes this key-value pair:
[{"require_new_password": null,...},...]

Wrong type for version in ListACLs

Version
1.1.0

What happened
Running sample code for list_acls fails as the returned version in API request is string and the python expects for integer:

Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 1784, in get_allof_instances
    allof_instance = allof_class._from_openapi_data(**model_args, **constant_args)
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 45, in wrapped_init
    return fn(_self, *args, **kwargs)
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model/service_id_and_version.py", line 175, in _from_openapi_data
    setattr(self, var_name, var_value)
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 184, in __setattr__
    self[attr] = value
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 509, in __setitem__
    self.set_attribute(name, value)
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 156, in set_attribute
    value = validate_and_convert_types(
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 1569, in validate_and_convert_types
    converted_instance = attempt_convert_item(
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 1448, in attempt_convert_item
    raise get_type_error(input_value, path_to_item, valid_classes,
fastly.exceptions.ApiTypeError: Invalid type for variable 'version'. Required value type is int and passed type was str at ['received_data'][0]['version']

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/davidg/Code/devops/lambdas/fastly/main.py", line 106, in <module>
    lambda_handler({}, "")
  File "/Users/davidg/Code/devops/lambdas/fastly/main.py", line 87, in lambda_handler
    fastly_get_service_acl(service_id, version_id)
  File "/Users/davidg/Code/devops/lambdas/fastly/main.py", line 35, in fastly_get_service_acl
    api_response = api_instance.list_acls(service_id, 15)
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/api/acl_api.py", line 690, in list_acls
    return self.list_acls_endpoint.call_with_http_info(**kwargs)
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/api_client.py", line 862, in call_with_http_info
    return self.api_client.call_api(
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/api_client.py", line 421, in call_api
    return self.__call_api(resource_path, method,
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/api_client.py", line 232, in __call_api
    return_data = self.deserialize(
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/api_client.py", line 337, in deserialize
    deserialized_data = validate_and_convert_types(
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 1619, in validate_and_convert_types
    input_value[index] = validate_and_convert_types(
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 1569, in validate_and_convert_types
    converted_instance = attempt_convert_item(
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 1462, in attempt_convert_item
    raise conversion_exc
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 1453, in attempt_convert_item
    return deserialize_model(input_value, valid_class,
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 1373, in deserialize_model
    return model_class._new_from_openapi_data(**kw_args)
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 45, in wrapped_init
    return fn(_self, *args, **kwargs)
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 369, in _new_from_openapi_data
    return cls._from_openapi_data(*args, **kwargs)
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 45, in wrapped_init
    return fn(_self, *args, **kwargs)
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model/acl_response.py", line 204, in _from_openapi_data
    composed_info = validate_get_composed_info(
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 1992, in validate_get_composed_info
    allof_instances = get_allof_instances(self, model_args, constant_args)
  File "/opt/homebrew/lib/python3.9/site-packages/fastly/model_utils.py", line 1789, in get_allof_instances
    raise ApiValueError(
fastly.exceptions.ApiValueError: Invalid inputs given to generate an instance of 'ServiceIdAndVersion'. The input data was invalid for the allOf schema 'ServiceIdAndVersion' in the composed schema 'AclResponse'. Error=Invalid type for variable 'version'. Required value type is int and passed type was str at ['received_data'][0]['version']

From some debugging I see that it's not changing the type in remove_uncoercible function. The type pair <str>, <int> is not UPCONVERSION_TYPE_PAIRS and must_convert is passed False here

def remove_uncoercible(required_types_classes, current_item, spec_property_naming,

Documentation: describe the entire process of setting up a fastly service and using it to test this library

Currently it's necessary to set up an .env file and source it before testing. This file requires a lot of information about a fastly user account (including username, password, account token, service-id. Plus the service-id that you reference needs to have certain things set up, but none of this configuration is documented. Let's get this fully documented so it's easy for anyone to test this library.

ModuleNotFoundError when attempting to create a GCS logging endpoint

Version

Please provide the version of fastly that you're using.

4.2.1

What happened

When attempting to run api_instance.create_log_gcs(service_id, version_id, etc..), I get the following error:

venv/lib/python3.10/site-packages/fastly/model/logging_gcs_response.py", line 38, in lazy_import
    from fastly.model.str_none_type import StrNoneType
ModuleNotFoundError: No module named 'fastly.model.str_none_type'

Please describe what you did, what you expected to happen, and what happened instead.

What I did: Attempted to create a GCS logging endpoint using create_log_gcs with compression_codec set to None since I have gzip set to 3 and the docs specifically state "Specifying both compression_codec and gzip_level in the same API request will result in an error. (optional)".

Then, I set compression_codec to an empty string since it's not nullable according to the README and the API returned the same error as above^.

So I'm stuck..

What I expected to happen: I expected the GCS logging endpoint to be created 🪄

What happened: I get the following error

venv/lib/python3.10/site-packages/fastly/model/logging_gcs_response.py", line 38, in lazy_import
    from fastly.model.str_none_type import StrNoneType
ModuleNotFoundError: No module named 'fastly.model.str_none_type'

Provide a base class for Error/Exception classes

When writing a try-except block to catch this library's exceptions, one has to add extra lines to catch everything:

    try:
        # make calls to fastly   
    except (
        fastly.errors.AuthenticationError,
        fastly.errors.InternalServerError,
        fastly.errors.BadRequestError,
        fastly.errors.NotFoundError
    ) as e:
        # handle exception

It would be nice if the error classes shared the same base class so that consumers only had to catch a single exception:

    try:
        # make calls to fastly   
    except fastly.errors.FastlyError as e:
        # handle exception

ApiValueError when running list_backends

Version

5.2.0

What happened

when calling
api_response = api_instance.list_backends(service_id, version_id)

Changes in the backend_api.py file introduced in version 5.2.0 cause the following exception

  File "/Users/ianderso/e-conolight.com/config/fastlytesting/update_fastly_backend.py", line 139, in <module>
    main()
  File "/Users/ianderso/e-conolight.com/config/fastlytesting/update_fastly_backend.py", line 129, in main
    bkends = getBackendNames(api_client, service_id, current_version)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ianderso/e-conolight.com/config/fastlytesting/update_fastly_backend.py", line 69, in getBackendNames
    api_response = api_instance.list_backends(service_id, version_id)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ianderso/e-conolight.com/config/fastlytesting/lib/python3.12/site-packages/fastly/api/backend_api.py", line 1068, in list_backends
    return self.list_backends_endpoint.call_with_http_info(**kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ianderso/e-conolight.com/config/fastlytesting/lib/python3.12/site-packages/fastly/api_client.py", line 872, in call_with_http_info
    return self.api_client.call_api(
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ianderso/e-conolight.com/config/fastlytesting/lib/python3.12/site-packages/fastly/api_client.py", line 427, in call_api
    return self.__call_api(resource_path, method,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ianderso/e-conolight.com/config/fastlytesting/lib/python3.12/site-packages/fastly/api_client.py", line 236, in __call_api
    return_data = self.deserialize(
                  ^^^^^^^^^^^^^^^^^
  File "/Users/ianderso/e-conolight.com/config/fastlytesting/lib/python3.12/site-packages/fastly/api_client.py", line 341, in deserialize
    deserialized_data = validate_and_convert_types(
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ianderso/e-conolight.com/config/fastlytesting/lib/python3.12/site-packages/fastly/model_utils.py", line 1619, in validate_and_convert_types
    input_value[index] = validate_and_convert_types(
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ianderso/e-conolight.com/config/fastlytesting/lib/python3.12/site-packages/fastly/model_utils.py", line 1569, in validate_and_convert_types
    converted_instance = attempt_convert_item(
                         ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ianderso/e-conolight.com/config/fastlytesting/lib/python3.12/site-packages/fastly/model_utils.py", line 1462, in attempt_convert_item
    raise conversion_exc
  File "/Users/ianderso/e-conolight.com/config/fastlytesting/lib/python3.12/site-packages/fastly/model_utils.py", line 1453, in attempt_convert_item
    return deserialize_model(input_value, valid_class,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ianderso/e-conolight.com/config/fastlytesting/lib/python3.12/site-packages/fastly/model_utils.py", line 1373, in deserialize_model
    return model_class._new_from_openapi_data(**kw_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ianderso/e-conolight.com/config/fastlytesting/lib/python3.12/site-packages/fastly/model_utils.py", line 45, in wrapped_init
    return fn(_self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ianderso/e-conolight.com/config/fastlytesting/lib/python3.12/site-packages/fastly/model_utils.py", line 369, in _new_from_openapi_data
    return cls._from_openapi_data(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ianderso/e-conolight.com/config/fastlytesting/lib/python3.12/site-packages/fastly/model_utils.py", line 45, in wrapped_init
    return fn(_self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ianderso/e-conolight.com/config/fastlytesting/lib/python3.12/site-packages/fastly/model/backend_response.py", line 311, in _from_openapi_data
    composed_info = validate_get_composed_info(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ianderso/e-conolight.com/config/fastlytesting/lib/python3.12/site-packages/fastly/model_utils.py", line 1992, in validate_get_composed_info
    allof_instances = get_allof_instances(self, model_args, constant_args)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ianderso/e-conolight.com/config/fastlytesting/lib/python3.12/site-packages/fastly/model_utils.py", line 1789, in get_allof_instances
    raise ApiValueError(
fastly.exceptions.ApiValueError: Invalid inputs given to generate an instance of 'Backend'. The input data was invalid for the allOf schema 'Backend' in the composed schema 'BackendResponse'. Error=Invalid type for variable 'tcp_keepalive_enable'. Required value type is bool and passed type was NoneType at ['received_data'][0]['tcp_keepalive_enable']```

failing test: test_auth_session_success

$ python -m test.api_test
..E.
======================================================================
ERROR: test_auth_session_success (__main__.APITest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/edmund/fastly/fastly-py/test/api_test.py", line 23, in test_auth_session_success
    self.api.authenticate_by_password('[email protected]', 'password')
  File "fastly/fastly.py", line 23, in authenticate_by_password
    self.conn.authenticator = SessionAuthenticator(self.conn, login, password)
  File "fastly/auth.py", line 18, in __init__
    resp, data = conn.request('POST', '/login', body)
  File "fastly/connection.py", line 44, in request
    raise AuthenticationError()
AuthenticationError

----------------------------------------------------------------------
Ran 4 tests in 0.784s

FAILED (errors=1)

AttributeError: 'module' object has no attribute 'PROTOCOL_TLS'

Running the example from the docs gives me this error:

Traceback (most recent call last):
    api.purge_key(service, key)
  File "fastly/fastly.py", line 79, in purge_key
    resp, data = self.conn.request('POST', '/service/%s/purge/%s' % (service, key), headers=headers)
  File "fastly/connection.py", line 35, in request
    ctx = ssl.SSLContext(ssl.PROTOCOL_TLS)
AttributeError: 'module' object has no attribute 'PROTOCOL_TLS'

I'm using python 3.4.2 and fastly 0.1.4.

I ended up using the API directly instead, but curious to find out if this is an issue with my environment or with the way the package is handling SSL connections.

Repo abandoned?

Is this repo abandoned? There are several PR's going back to 2020 that have no movement. Our own project still requires a working 2.7 compatible fastly library (for now) and we need to be able to access ACLs. I have a fork where I am adding this ability and about to submit a PR, but it looks like that may be in vain.

Support for TLS Subscriptions

One of the features that are currently not implemented in the fastly-py is a model for TLS subscriptions.
This came up when one of our prospects tried to automate their domain/TLS deployment flow using python.
He worked around it with Requests library and our API endpoints which did the job, but an official support would be great.

Thanks!

Python Boolean values are not understood by the API

Version

4.0.0 (and 3.x.x)

TLDR
I am running into a bug with regards to Boolean values.

The bug seems to be in the way data is send to the API by the Fastly-py library, not necessarily in the API itself.
The REST calls where this issue arises are of Content-Type ‘application/x-www-form-urlencoded’. The given values are transferred to the server 1:1. This means that when I provide a Python Boolean (i.e. False or True) for a certain parameter, it is sent as such to the API, although the API only seems to understand lowercase Boolean values, or binary values such as 0 or 1.

What I did
I stumbled upon this bug while trying to create objects with specific parameters of type ‘Boolean’, in my case a backend object for my service with specific values for ‘ssl_check_cert’ and ‘use_ssl’.

My code does the following:

  • Create a new service;
  • Create a new backend for the new service;
    • ‘ssl_check_cert’ and ‘use_ssl’ are set to False in the request.

What I expected would happen
I expected a service would be created, with a backend which has both 'ssl_check_cert' and 'use_ssl' set to False.

What actually happened
I noticed that the values given in my Python code were not reflected in the created backend object. The values for both 'ssl_check_cert' and 'use_ssl' were set to True (the default value), completely ignoring my values during creation.

This behavior indicates that the given values are not understood by the Fastly API.

Extra comment

I’m not a programmer so I don’t know the best solution for this. I did however find a dirty hack which worked for me as a temporarily solution. I noticed this ‘_urlencode’ function in a very old version of the fastly-py project (0.5.x), which says something about converting Boolean to lowercase:

https://github.com/fastly/fastly-py/blob/1d3235611627811d83990c31a928e7cf21fe2caa/fastly/models.py#L31C1-L42C11

I somewhat recreated this function as follows:

def sanitize_list_of_tuples(input_list):
    def sanitize_value(value):
        """ Sanitize the value """
        if isinstance(value, bool):
            # Perform the desired conversion for booleans
            return int(value)  # Example: Convert boolean to integer
        # Handle other value types if needed
        return value

    sanitized_list = []
    for key, value in input_list:
        sanitized_value = sanitize_value(value)
        sanitized_list.append((key, sanitized_value))

    return sanitized_list

I added this function at the top of rest.py and added the following line before line 161 of rest.py:

post_params = sanitize_list_of_tuples(post_params)

This results in Boolean values being converted to their integer/binary representation, which the Fastly API does interpret correctly.

As I said, I’m not sure if this is the best solution, probably not, you guys probably know a better way to fix this issue across the board.

Let me know if you need any further information or assistance!
Thanks in advance,
Mark

No proxy support

It appears that because the underlying HTTP is powered by the minimal most low-level Python HTTP package that there's no easy way to use a proxy. I'm not sure if this project is still maintained or if it's just an "as-is" alternative to the more up-to-date golang CLI

It would make much more sense to use the third-party requests package which is the standard for nearly all Python projects doing anything but the simplest HTTP operations

Rather than hack in proxy support, I'm going to fork fastly-py and make the necessary changes to make it work with requests, if you're interest in a PR I'm happy to submit it but it will be a pretty invasive change

Module 'fastly' has no 'API' member

Python Version

python --version
Python 2.7.11

PIP

pip install fastly

Reduced Test Case

import fastly

api_key = '123'

api = fastly.API()
api.authenticate_by_key(api_key)
print api.__dict__

I'm using the exact example from the README

Error

Module 'fastly' has no 'API' member

kwarg passed to a URI Template needs URI quoting.

If you provide a name for a Model, such as a Healthcheck that has a space in it, the created URI will fail with a 404 as the space has not been escaped to %20.

The naive fix is something like the following in models.py:

@@ -12,6 +12,9 @@ class Model(object):

     @classmethod
     def query(cls, conn, pattern, method, suffix='', body=None, **kwargs):
+        for key in kwargs:
+            value = quote(kwargs[key], safe='')
+            kwargs[key] = value

This isn't entirely explicit though as the overlap between self.attrs as source for body data and URI data isn't entirely clear.

Fastly 0.0.3 code isn't on PyPI

Fastly 0.0.3 isn't available on the index.

The web page exists: https://pypi.python.org/pypi/fastly/0.0.3
But the code isn't there.

$ pip install fastly==0.0.3

Collecting fastly==0.0.3
  Could not find a version that satisfies the requirement fastly==0.0.3 (from versions: 0.0.2)
  No distributions matching the version for fastly==0.0.3

Contribution guide

It'd be nice for potential new contributors to be able to know how we do business. Probably should include a code-of-conduct, requirements for PRs (for example, new PRs should have tests and should include updates to the CLI).

Better documentation for setup

Currently there is no requirements.txt file for this library, so its dependencies are poorly documented. There are also no instructions for using with with virtualenv. Let's get these written up.

EnabledProductsApi TypeError

Version

Lib version: 5.2.0.

What happened

I tried to use Enable Product API but it is failing on type error when using multiple methods on instance class of EnabledProductsApi:

    api_response = api_instance.get_enabled_product(**options)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/q9k17i98pxvzxxqk7mazb8gnbcpwffj9-python3-3.11.8-env/lib/python3.11/site-packages/fastly/api/enabled_products_api.py", line 471, in get_enabled_product
    return self.get_enabled_product_endpoint.call_with_http_info(**kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/q9k17i98pxvzxxqk7mazb8gnbcpwffj9-python3-3.11.8-env/lib/python3.11/site-packages/fastly/api_client.py", line 872, in call_with_http_info
    return self.api_client.call_api(
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/q9k17i98pxvzxxqk7mazb8gnbcpwffj9-python3-3.11.8-env/lib/python3.11/site-packages/fastly/api_client.py", line 427, in call_api
    return self.__call_api(resource_path, method,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/q9k17i98pxvzxxqk7mazb8gnbcpwffj9-python3-3.11.8-env/lib/python3.11/site-packages/fastly/api_client.py", line 236, in __call_api
    return_data = self.deserialize(
                  ^^^^^^^^^^^^^^^^^
  File "/nix/store/q9k17i98pxvzxxqk7mazb8gnbcpwffj9-python3-3.11.8-env/lib/python3.11/site-packages/fastly/api_client.py", line 341, in deserialize
    deserialized_data = validate_and_convert_types(
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/q9k17i98pxvzxxqk7mazb8gnbcpwffj9-python3-3.11.8-env/lib/python3.11/site-packages/fastly/model_utils.py", line 1569, in validate_and_convert_types
    converted_instance = attempt_convert_item(
                         ^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/q9k17i98pxvzxxqk7mazb8gnbcpwffj9-python3-3.11.8-env/lib/python3.11/site-packages/fastly/model_utils.py", line 1453, in attempt_convert_item
    return deserialize_model(input_value, valid_class,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/q9k17i98pxvzxxqk7mazb8gnbcpwffj9-python3-3.11.8-env/lib/python3.11/site-packages/fastly/model_utils.py", line 1373, in deserialize_model
    return model_class._new_from_openapi_data(**kw_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/q9k17i98pxvzxxqk7mazb8gnbcpwffj9-python3-3.11.8-env/lib/python3.11/site-packages/fastly/model_utils.py", line 45, in wrapped_init
    return fn(_self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/q9k17i98pxvzxxqk7mazb8gnbcpwffj9-python3-3.11.8-env/lib/python3.11/site-packages/fastly/model_utils.py", line 369, in _new_from_openapi_data
    return cls._from_openapi_data(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/q9k17i98pxvzxxqk7mazb8gnbcpwffj9-python3-3.11.8-env/lib/python3.11/site-packages/fastly/model_utils.py", line 45, in wrapped_init
    return fn(_self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/q9k17i98pxvzxxqk7mazb8gnbcpwffj9-python3-3.11.8-env/lib/python3.11/site-packages/fastly/model/enabled_product_response.py", line 186, in _from_openapi_data
    setattr(self, var_name, var_value)
  File "/nix/store/q9k17i98pxvzxxqk7mazb8gnbcpwffj9-python3-3.11.8-env/lib/python3.11/site-packages/fastly/model_utils.py", line 184, in __setattr__
    self[attr] = value
    ~~~~^^^^^^
  File "/nix/store/q9k17i98pxvzxxqk7mazb8gnbcpwffj9-python3-3.11.8-env/lib/python3.11/site-packages/fastly/model_utils.py", line 509, in __setitem__
    self.set_attribute(name, value)
  File "/nix/store/q9k17i98pxvzxxqk7mazb8gnbcpwffj9-python3-3.11.8-env/lib/python3.11/site-packages/fastly/model_utils.py", line 156, in set_attribute
    value = validate_and_convert_types(
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/q9k17i98pxvzxxqk7mazb8gnbcpwffj9-python3-3.11.8-env/lib/python3.11/site-packages/fastly/model_utils.py", line 1569, in validate_and_convert_types
    converted_instance = attempt_convert_item(
                         ^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/q9k17i98pxvzxxqk7mazb8gnbcpwffj9-python3-3.11.8-env/lib/python3.11/site-packages/fastly/model_utils.py", line 1453, in attempt_convert_item
    return deserialize_model(input_value, valid_class,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/q9k17i98pxvzxxqk7mazb8gnbcpwffj9-python3-3.11.8-env/lib/python3.11/site-packages/fastly/model_utils.py", line 1373, in deserialize_model
    return model_class._new_from_openapi_data(**kw_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/q9k17i98pxvzxxqk7mazb8gnbcpwffj9-python3-3.11.8-env/lib/python3.11/site-packages/fastly/model_utils.py", line 45, in wrapped_init
    return fn(_self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/q9k17i98pxvzxxqk7mazb8gnbcpwffj9-python3-3.11.8-env/lib/python3.11/site-packages/fastly/model_utils.py", line 369, in _new_from_openapi_data
    return cls._from_openapi_data(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: EnabledProductResponseLinks._from_openapi_data() got multiple values for argument '_self'

The above error is raised also for python example code from the Fastly documentation.

NameError: name 'Service' is not defined

This module seems to fail to function due to an unresolved import when installed under pipenv

To replicate, using pipenv:

Pipfile:

[[source]]
url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"

[dev-packages]

[packages]
fastly = "==0.2.3"

[requires]
python_version = "3.7"

Steps to replicate:

jbeard@jbeard-desktop /tmp/fastly-py-test $ pipenv install
jbeard@jbeard-desktop /tmp/fastly-py-test $ pipenv run python
Python 3.7.3 (default, May  8 2019, 14:42:49) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from fastly import fastly
>>> api = fastly.API()
>>> api.authenticate_by_key('DUMMY')
>>> api.service('DUMMY')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/tmp/.venv/lib/python3.7/site-packages/fastly/fastly.py", line 33, in service
    return Service.find(self.conn, id=id)
NameError: name 'Service' is not defined
>>> 

I believe this can be fixed with an implict import statement in fastly.py:

from fastly.models import *

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.