From d9cb56ccfa62319ba26636c1c814853d3270d309 Mon Sep 17 00:00:00 2001 From: "Federico G. Schwindt" Date: Fri, 17 Nov 2023 11:30:38 +0000 Subject: [PATCH] replace: pointer helpers to generic ToPointer function (#489) --- fastly/acl_entries_batch_test.go | 60 +++---- fastly/acl_entry_test.go | 12 +- fastly/acl_test.go | 4 +- fastly/backend_test.go | 32 ++-- fastly/basictypes_helper.go | 30 +--- fastly/bigquery_test.go | 24 +-- fastly/blobstorage_test.go | 122 ++++++------- fastly/cache_setting.go | 6 - fastly/cache_setting_test.go | 10 +- fastly/cloudfiles_test.go | 128 ++++++------- fastly/condition_test.go | 10 +- fastly/datadog_test.go | 16 +- fastly/dictionary_test.go | 4 +- fastly/diff_test.go | 4 +- fastly/digitalocean_test.go | 124 ++++++------- fastly/director_test.go | 22 +-- fastly/domain_test.go | 10 +- fastly/elasticsearch_test.go | 34 ++-- fastly/erl.go | 15 -- fastly/erl_test.go | 24 +-- fastly/fastly_test.go | 46 ++--- fastly/ftp_test.go | 122 ++++++------- fastly/gcs_test.go | 118 ++++++------ fastly/gzip_test.go | 10 +- fastly/header_test.go | 16 +- fastly/health_check_test.go | 24 +-- fastly/heroku_test.go | 16 +- fastly/honeycomb_test.go | 18 +- fastly/http3_test.go | 2 +- fastly/https_test.go | 38 ++-- fastly/kafka_test.go | 40 ++--- fastly/kinesis_test.go | 78 ++++---- fastly/logentries_test.go | 20 +-- fastly/loggly_test.go | 12 +- fastly/logshuttle_test.go | 18 +- fastly/newrelic_test.go | 38 ++-- fastly/newrelicotlp_test.go | 14 +- fastly/openstack_test.go | 124 ++++++------- fastly/papertrail_test.go | 14 +- fastly/pool_test.go | 18 +- fastly/pubsub_test.go | 22 +-- fastly/request_setting.go | 12 -- fastly/request_setting_test.go | 24 +-- fastly/resource_test.go | 6 +- fastly/response_object_test.go | 12 +- fastly/s3.go | 15 -- fastly/s3_test.go | 298 +++++++++++++++---------------- fastly/scalyr_test.go | 18 +- fastly/server_test.go | 8 +- fastly/service_test.go | 6 +- fastly/settings_test.go | 4 +- fastly/sftp_test.go | 140 +++++++-------- fastly/splunk_test.go | 28 +-- fastly/sumologic_test.go | 14 +- fastly/syslog_test.go | 32 ++-- fastly/tls_subscription_test.go | 8 +- fastly/user_test.go | 10 +- fastly/vcl_snippets_test.go | 22 +-- fastly/vcl_test.go | 6 +- fastly/version_test.go | 4 +- fastly/waf_test.go | 8 +- 61 files changed, 1050 insertions(+), 1124 deletions(-) diff --git a/fastly/acl_entries_batch_test.go b/fastly/acl_entries_batch_test.go index 97c810567..5eb5915b8 100644 --- a/fastly/acl_entries_batch_test.go +++ b/fastly/acl_entries_batch_test.go @@ -24,17 +24,17 @@ func TestClient_BatchModifyACLEntries_Create(t *testing.T) { Entries: []*BatchACLEntry{ { Operation: CreateBatchOperation, - IP: String("127.0.0.1"), - Subnet: Int(24), - Negated: CBool(false), - Comment: String("ACL Entry 1"), + IP: ToPointer("127.0.0.1"), + Subnet: ToPointer(24), + Negated: ToPointer(Compatibool(false)), + Comment: ToPointer("ACL Entry 1"), }, { Operation: CreateBatchOperation, - IP: String("192.168.0.1"), - Subnet: Int(24), - Negated: CBool(true), - Comment: String("ACL Entry 2"), + IP: ToPointer("192.168.0.1"), + Subnet: ToPointer(24), + Negated: ToPointer(Compatibool(true)), + Comment: ToPointer("ACL Entry 2"), }, }, } @@ -120,17 +120,17 @@ func TestClient_BatchModifyACLEntries_Delete(t *testing.T) { Entries: []*BatchACLEntry{ { Operation: CreateBatchOperation, - IP: String("127.0.0.1"), - Subnet: Int(24), - Negated: CBool(false), - Comment: String("ACL Entry 1"), + IP: ToPointer("127.0.0.1"), + Subnet: ToPointer(24), + Negated: ToPointer(Compatibool(false)), + Comment: ToPointer("ACL Entry 1"), }, { Operation: CreateBatchOperation, - IP: String("192.168.0.1"), - Subnet: Int(24), - Negated: CBool(true), - Comment: String("ACL Entry 2"), + IP: ToPointer("192.168.0.1"), + Subnet: ToPointer(24), + Negated: ToPointer(Compatibool(true)), + Comment: ToPointer("ACL Entry 2"), }, }, } @@ -165,7 +165,7 @@ func TestClient_BatchModifyACLEntries_Delete(t *testing.T) { Entries: []*BatchACLEntry{ { Operation: DeleteBatchOperation, - ID: String(createdACLEntries[0].ID), + ID: ToPointer(createdACLEntries[0].ID), }, }, } @@ -219,17 +219,17 @@ func TestClient_BatchModifyACLEntries_Update(t *testing.T) { Entries: []*BatchACLEntry{ { Operation: CreateBatchOperation, - IP: String("127.0.0.1"), - Subnet: Int(24), - Negated: CBool(false), - Comment: String("ACL Entry 1"), + IP: ToPointer("127.0.0.1"), + Subnet: ToPointer(24), + Negated: ToPointer(Compatibool(false)), + Comment: ToPointer("ACL Entry 1"), }, { Operation: CreateBatchOperation, - IP: String("192.168.0.1"), - Subnet: Int(24), - Negated: CBool(true), - Comment: String("ACL Entry 2"), + IP: ToPointer("192.168.0.1"), + Subnet: ToPointer(24), + Negated: ToPointer(Compatibool(true)), + Comment: ToPointer("ACL Entry 2"), }, }, } @@ -264,11 +264,11 @@ func TestClient_BatchModifyACLEntries_Update(t *testing.T) { Entries: []*BatchACLEntry{ { Operation: UpdateBatchOperation, - ID: String(createdACLEntries[0].ID), - IP: String("127.0.0.2"), - Subnet: Int(16), - Negated: CBool(true), - Comment: String("Updated ACL Entry 1"), + ID: ToPointer(createdACLEntries[0].ID), + IP: ToPointer("127.0.0.2"), + Subnet: ToPointer(16), + Negated: ToPointer(Compatibool(true)), + Comment: ToPointer("Updated ACL Entry 1"), }, }, } diff --git a/fastly/acl_entry_test.go b/fastly/acl_entry_test.go index 5547d28ba..ebc9c600f 100644 --- a/fastly/acl_entry_test.go +++ b/fastly/acl_entry_test.go @@ -23,10 +23,10 @@ func TestClient_ACLEntries(t *testing.T) { e, err = c.CreateACLEntry(&CreateACLEntryInput{ ServiceID: testService.ID, ACLID: testACL.ID, - IP: String("10.0.0.3"), - Subnet: Int(8), - Negated: CBool(false), - Comment: String("test entry"), + IP: ToPointer("10.0.0.3"), + Subnet: ToPointer(8), + Negated: ToPointer(Compatibool(false)), + Comment: ToPointer("test entry"), }) }) if err != nil { @@ -124,8 +124,8 @@ func TestClient_ACLEntries(t *testing.T) { ServiceID: testService.ID, ACLID: testACL.ID, ID: e.ID, - IP: String("10.0.0.4"), - Negated: CBool(true), + IP: ToPointer("10.0.0.4"), + Negated: ToPointer(Compatibool(true)), }) }) if err != nil { diff --git a/fastly/acl_test.go b/fastly/acl_test.go index ac742f1cb..d6a92dcad 100644 --- a/fastly/acl_test.go +++ b/fastly/acl_test.go @@ -18,7 +18,7 @@ func TestClient_ACLs(t *testing.T) { a, err = c.CreateACL(&CreateACLInput{ ServiceID: testServiceID, ServiceVersion: testVersion.Number, - Name: String("test_acl"), + Name: ToPointer("test_acl"), }) }) if err != nil { @@ -96,7 +96,7 @@ func TestClient_ACLs(t *testing.T) { ServiceID: testServiceID, ServiceVersion: testVersion.Number, Name: "test_acl", - NewName: String("new_test_acl"), + NewName: ToPointer("new_test_acl"), }) }) if err != nil { diff --git a/fastly/backend_test.go b/fastly/backend_test.go index 2f59d4532..d0a6d708a 100644 --- a/fastly/backend_test.go +++ b/fastly/backend_test.go @@ -19,13 +19,13 @@ func TestClient_Backends(t *testing.T) { b, err = c.CreateBackend(&CreateBackendInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-backend"), - Address: String("integ-test.go-fastly.com"), - ConnectTimeout: Int(1500), - OverrideHost: String("origin.example.com"), - SSLCheckCert: CBool(false), - SSLCiphers: String("DHE-RSA-AES256-SHA:DHE-RSA-CAMELLIA256-SHA:AES256-GCM-SHA384"), - SSLSNIHostname: String("ssl-hostname.com"), + Name: ToPointer("test-backend"), + Address: ToPointer("integ-test.go-fastly.com"), + ConnectTimeout: ToPointer(1500), + OverrideHost: ToPointer("origin.example.com"), + SSLCheckCert: ToPointer(Compatibool(false)), + SSLCiphers: ToPointer("DHE-RSA-AES256-SHA:DHE-RSA-CAMELLIA256-SHA:AES256-GCM-SHA384"), + SSLSNIHostname: ToPointer("ssl-hostname.com"), }) }) if err != nil { @@ -124,13 +124,13 @@ func TestClient_Backends(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-backend", - NewName: String("new-test-backend"), - OverrideHost: String("www.example.com"), - Port: Int(1234), - ShareKey: String("shared-key"), - SSLCiphers: String("RC4:!COMPLEMENTOFDEFAULT"), - SSLCheckCert: CBool(false), - SSLSNIHostname: String("ssl-hostname-updated.com"), + NewName: ToPointer("new-test-backend"), + OverrideHost: ToPointer("www.example.com"), + Port: ToPointer(1234), + ShareKey: ToPointer("shared-key"), + SSLCiphers: ToPointer("RC4:!COMPLEMENTOFDEFAULT"), + SSLCheckCert: ToPointer(Compatibool(false)), + SSLSNIHostname: ToPointer("ssl-hostname-updated.com"), }) }) if err != nil { @@ -183,8 +183,8 @@ func TestClient_Backends(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "new-test-backend", - OverrideHost: String(""), - Port: Int(0), + OverrideHost: ToPointer(""), + Port: ToPointer(0), }) }) if err != nil { diff --git a/fastly/basictypes_helper.go b/fastly/basictypes_helper.go index 505d77ceb..9b1020c39 100644 --- a/fastly/basictypes_helper.go +++ b/fastly/basictypes_helper.go @@ -1,27 +1,7 @@ package fastly -// String is a helper that returns a pointer to the string value passed in. -func String(v string) *string { - return &v -} - -// Int is a helper that returns a pointer to the int value passed in. -func Int(v int) *int { - return &v -} - -// Uint is a helper that returns a pointer to the uint value passed in. -func Uint(v uint) *uint { - return &v -} - -// Uint8 is a helper that returns a pointer to the uint8 value passed in. -func Uint8(v uint8) *uint8 { - return &v -} - -// Bool is a helper that returns a pointer to the bool value passed in. -func Bool(v bool) *bool { +// ToPointer converts T to *T. +func ToPointer[T string | int | uint | uint8 | bool | CacheSettingAction | Compatibool | ERLAction | ERLLogger | ERLWindowSize | RequestSettingAction | RequestSettingXFF | S3AccessControlList | S3Redundancy | S3ServerSideEncryption](v T) *T { return &v } @@ -36,9 +16,3 @@ func NullString(v string) *string { } return &v } - -// CBool is a helper that returns a pointer to a Compatibool with the value passed in. -func CBool(b bool) *Compatibool { - c := Compatibool(b) - return &c -} diff --git a/fastly/bigquery_test.go b/fastly/bigquery_test.go index 2d76862b5..9b1deab7a 100644 --- a/fastly/bigquery_test.go +++ b/fastly/bigquery_test.go @@ -22,17 +22,17 @@ func TestClient_Bigqueries(t *testing.T) { bq, err = c.CreateBigQuery(&CreateBigQueryInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-bigquery"), - ProjectID: String("example-fastly-log"), - Dataset: String("fastly_log_test"), - Table: String("fastly_logs"), - Template: String(""), - User: String("fastly-bigquery-log@example-fastly-log.iam.gserviceaccount.com"), - AccountName: String("service-account"), - SecretKey: String(secretKey), - Format: String("{\n \"timestamp\":\"%{begin:%Y-%m-%dT%H:%M:%S}t\",\n \"time_elapsed\":%{time.elapsed.usec}V,\n \"is_tls\":%{if(req.is_ssl, \"true\", \"false\")}V,\n \"client_ip\":\"%{req.http.Fastly-Client-IP}V\",\n \"geo_city\":\"%{client.geo.city}V\",\n \"geo_country_code\":\"%{client.geo.country_code}V\",\n \"request\":\"%{req.request}V\",\n \"host\":\"%{req.http.Fastly-Orig-Host}V\",\n \"url\":\"%{json.escape(req.url)}V\",\n \"request_referer\":\"%{json.escape(req.http.Referer)}V\",\n \"request_user_agent\":\"%{json.escape(req.http.User-Agent)}V\",\n \"request_accept_language\":\"%{json.escape(req.http.Accept-Language)}V\",\n \"request_accept_charset\":\"%{json.escape(req.http.Accept-Charset)}V\",\n \"cache_status\":\"%{regsub(fastly_info.state, \"^(HIT-(SYNTH)|(HITPASS|HIT|MISS|PASS|ERROR|PIPE)).*\", \"\\\\2\\\\3\") }V\"\n}"), - Placement: String("waf_debug"), - FormatVersion: Int(2), + Name: ToPointer("test-bigquery"), + ProjectID: ToPointer("example-fastly-log"), + Dataset: ToPointer("fastly_log_test"), + Table: ToPointer("fastly_logs"), + Template: ToPointer(""), + User: ToPointer("fastly-bigquery-log@example-fastly-log.iam.gserviceaccount.com"), + AccountName: ToPointer("service-account"), + SecretKey: ToPointer(secretKey), + Format: ToPointer("{\n \"timestamp\":\"%{begin:%Y-%m-%dT%H:%M:%S}t\",\n \"time_elapsed\":%{time.elapsed.usec}V,\n \"is_tls\":%{if(req.is_ssl, \"true\", \"false\")}V,\n \"client_ip\":\"%{req.http.Fastly-Client-IP}V\",\n \"geo_city\":\"%{client.geo.city}V\",\n \"geo_country_code\":\"%{client.geo.country_code}V\",\n \"request\":\"%{req.request}V\",\n \"host\":\"%{req.http.Fastly-Orig-Host}V\",\n \"url\":\"%{json.escape(req.url)}V\",\n \"request_referer\":\"%{json.escape(req.http.Referer)}V\",\n \"request_user_agent\":\"%{json.escape(req.http.User-Agent)}V\",\n \"request_accept_language\":\"%{json.escape(req.http.Accept-Language)}V\",\n \"request_accept_charset\":\"%{json.escape(req.http.Accept-Charset)}V\",\n \"cache_status\":\"%{regsub(fastly_info.state, \"^(HIT-(SYNTH)|(HITPASS|HIT|MISS|PASS|ERROR|PIPE)).*\", \"\\\\2\\\\3\") }V\"\n}"), + Placement: ToPointer("waf_debug"), + FormatVersion: ToPointer(2), }) }) if err != nil { @@ -161,7 +161,7 @@ func TestClient_Bigqueries(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-bigquery", - NewName: String("new-test-bigquery"), + NewName: ToPointer("new-test-bigquery"), }) }) if err != nil { diff --git a/fastly/blobstorage_test.go b/fastly/blobstorage_test.go index 6c41b4490..0a69db96a 100644 --- a/fastly/blobstorage_test.go +++ b/fastly/blobstorage_test.go @@ -23,20 +23,20 @@ func TestClient_BlobStorages(t *testing.T) { bsCreateResp1, err = c.CreateBlobStorage(&CreateBlobStorageInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-blobstorage"), - Path: String("/logs"), - AccountName: String("test"), - Container: String("fastly"), - SASToken: String("sv=2015-04-05&ss=b&srt=sco&sp=rw&se=2030-07-21T18%3A00%3A00Z&sig=3ABdLOJZosCp0o491T%2BqZGKIhafF1nlM3MzESDDD3Gg%3D"), - Period: Int(12), - TimestampFormat: String("%Y-%m-%dT%H:%M:%S.000"), - CompressionCodec: String("snappy"), - PublicKey: String("-----BEGIN PGP PUBLIC KEY BLOCK-----\n\nmQENBFyUD8sBCACyFnB39AuuTygseek+eA4fo0cgwva6/FSjnWq7riouQee8GgQ/\nibXTRyv4iVlwI12GswvMTIy7zNvs1R54i0qvsLr+IZ4GVGJqs6ZJnvQcqe3xPoR4\n8AnBfw90o32r/LuHf6QCJXi+AEu35koNlNAvLJ2B+KACaNB7N0EeWmqpV/1V2k9p\nlDYk+th7LcCuaFNGqKS/PrMnnMqR6VDLCjHhNx4KR79b0Twm/2qp6an3hyNRu8Gn\ndwxpf1/BUu3JWf+LqkN4Y3mbOmSUL3MaJNvyQguUzTfS0P0uGuBDHrJCVkMZCzDB\n89ag55jCPHyGeHBTd02gHMWzsg3WMBWvCsrzABEBAAG0JXRlcnJhZm9ybSAodGVz\ndCkgPHRlc3RAdGVycmFmb3JtLmNvbT6JAU4EEwEIADgWIQSHYyc6Kj9l6HzQsau6\nvFFc9jxV/wUCXJQPywIbAwULCQgHAgYVCgkICwIEFgIDAQIeAQIXgAAKCRC6vFFc\n9jxV/815CAClb32OxV7wG01yF97TzlyTl8TnvjMtoG29Mw4nSyg+mjM3b8N7iXm9\nOLX59fbDAWtBSldSZE22RXd3CvlFOG/EnKBXSjBtEqfyxYSnyOPkMPBYWGL/ApkX\nSvPYJ4LKdvipYToKFh3y9kk2gk1DcDBDyaaHvR+3rv1u3aoy7/s2EltAfDS3ZQIq\n7/cWTLJml/lleeB/Y6rPj8xqeCYhE5ahw9gsV/Mdqatl24V9Tks30iijx0Hhw+Gx\nkATUikMGr2GDVqoIRga5kXI7CzYff4rkc0Twn47fMHHHe/KY9M2yVnMHUXmAZwbG\nM1cMI/NH1DjevCKdGBLcRJlhuLPKF/anuQENBFyUD8sBCADIpd7r7GuPd6n/Ikxe\nu6h7umV6IIPoAm88xCYpTbSZiaK30Svh6Ywra9jfE2KlU9o6Y/art8ip0VJ3m07L\n4RSfSpnzqgSwdjSq5hNour2Fo/BzYhK7yaz2AzVSbe33R0+RYhb4b/6N+bKbjwGF\nftCsqVFMH+PyvYkLbvxyQrHlA9woAZaNThI1ztO5rGSnGUR8xt84eup28WIFKg0K\nUEGUcTzz+8QGAwAra+0ewPXo/AkO+8BvZjDidP417u6gpBHOJ9qYIcO9FxHeqFyu\nYrjlrxowEgXn5wO8xuNz6Vu1vhHGDHGDsRbZF8pv1d5O+0F1G7ttZ2GRRgVBZPwi\nkiyRABEBAAGJATYEGAEIACAWIQSHYyc6Kj9l6HzQsau6vFFc9jxV/wUCXJQPywIb\nDAAKCRC6vFFc9jxV/9YOCACe8qmOSnKQpQfW+PqYOqo3dt7JyweTs3FkD6NT8Zml\ndYy/vkstbTjPpX6aTvUZjkb46BVi7AOneVHpD5GBqvRsZ9iVgDYHaehmLCdKiG5L\n3Tp90NN+QY5WDbsGmsyk6+6ZMYejb4qYfweQeduOj27aavCJdLkCYMoRKfcFYI8c\nFaNmEfKKy/r1PO20NXEG6t9t05K/frHy6ZG8bCNYdpagfFVot47r9JaQqWlTNtIR\n5+zkkSq/eG9BEtRij3a6cTdQbktdBzx2KBeI0PYc1vlZR0LpuFKZqY9vlE6vTGLR\nwMfrTEOvx0NxUM3rpaCgEmuWbB1G1Hu371oyr4srrr+N\n=28dr\n-----END PGP PUBLIC KEY BLOCK-----\n"), - Format: String("%h %l %u %{now}V %{req.method}V %{req.url}V %>s %{resp.http.Content-Length}V"), - FormatVersion: Int(2), - MessageType: String("classic"), - Placement: String("waf_debug"), - FileMaxBytes: Int(MiB), + Name: ToPointer("test-blobstorage"), + Path: ToPointer("/logs"), + AccountName: ToPointer("test"), + Container: ToPointer("fastly"), + SASToken: ToPointer("sv=2015-04-05&ss=b&srt=sco&sp=rw&se=2030-07-21T18%3A00%3A00Z&sig=3ABdLOJZosCp0o491T%2BqZGKIhafF1nlM3MzESDDD3Gg%3D"), + Period: ToPointer(12), + TimestampFormat: ToPointer("%Y-%m-%dT%H:%M:%S.000"), + CompressionCodec: ToPointer("snappy"), + PublicKey: ToPointer("-----BEGIN PGP PUBLIC KEY BLOCK-----\n\nmQENBFyUD8sBCACyFnB39AuuTygseek+eA4fo0cgwva6/FSjnWq7riouQee8GgQ/\nibXTRyv4iVlwI12GswvMTIy7zNvs1R54i0qvsLr+IZ4GVGJqs6ZJnvQcqe3xPoR4\n8AnBfw90o32r/LuHf6QCJXi+AEu35koNlNAvLJ2B+KACaNB7N0EeWmqpV/1V2k9p\nlDYk+th7LcCuaFNGqKS/PrMnnMqR6VDLCjHhNx4KR79b0Twm/2qp6an3hyNRu8Gn\ndwxpf1/BUu3JWf+LqkN4Y3mbOmSUL3MaJNvyQguUzTfS0P0uGuBDHrJCVkMZCzDB\n89ag55jCPHyGeHBTd02gHMWzsg3WMBWvCsrzABEBAAG0JXRlcnJhZm9ybSAodGVz\ndCkgPHRlc3RAdGVycmFmb3JtLmNvbT6JAU4EEwEIADgWIQSHYyc6Kj9l6HzQsau6\nvFFc9jxV/wUCXJQPywIbAwULCQgHAgYVCgkICwIEFgIDAQIeAQIXgAAKCRC6vFFc\n9jxV/815CAClb32OxV7wG01yF97TzlyTl8TnvjMtoG29Mw4nSyg+mjM3b8N7iXm9\nOLX59fbDAWtBSldSZE22RXd3CvlFOG/EnKBXSjBtEqfyxYSnyOPkMPBYWGL/ApkX\nSvPYJ4LKdvipYToKFh3y9kk2gk1DcDBDyaaHvR+3rv1u3aoy7/s2EltAfDS3ZQIq\n7/cWTLJml/lleeB/Y6rPj8xqeCYhE5ahw9gsV/Mdqatl24V9Tks30iijx0Hhw+Gx\nkATUikMGr2GDVqoIRga5kXI7CzYff4rkc0Twn47fMHHHe/KY9M2yVnMHUXmAZwbG\nM1cMI/NH1DjevCKdGBLcRJlhuLPKF/anuQENBFyUD8sBCADIpd7r7GuPd6n/Ikxe\nu6h7umV6IIPoAm88xCYpTbSZiaK30Svh6Ywra9jfE2KlU9o6Y/art8ip0VJ3m07L\n4RSfSpnzqgSwdjSq5hNour2Fo/BzYhK7yaz2AzVSbe33R0+RYhb4b/6N+bKbjwGF\nftCsqVFMH+PyvYkLbvxyQrHlA9woAZaNThI1ztO5rGSnGUR8xt84eup28WIFKg0K\nUEGUcTzz+8QGAwAra+0ewPXo/AkO+8BvZjDidP417u6gpBHOJ9qYIcO9FxHeqFyu\nYrjlrxowEgXn5wO8xuNz6Vu1vhHGDHGDsRbZF8pv1d5O+0F1G7ttZ2GRRgVBZPwi\nkiyRABEBAAGJATYEGAEIACAWIQSHYyc6Kj9l6HzQsau6vFFc9jxV/wUCXJQPywIb\nDAAKCRC6vFFc9jxV/9YOCACe8qmOSnKQpQfW+PqYOqo3dt7JyweTs3FkD6NT8Zml\ndYy/vkstbTjPpX6aTvUZjkb46BVi7AOneVHpD5GBqvRsZ9iVgDYHaehmLCdKiG5L\n3Tp90NN+QY5WDbsGmsyk6+6ZMYejb4qYfweQeduOj27aavCJdLkCYMoRKfcFYI8c\nFaNmEfKKy/r1PO20NXEG6t9t05K/frHy6ZG8bCNYdpagfFVot47r9JaQqWlTNtIR\n5+zkkSq/eG9BEtRij3a6cTdQbktdBzx2KBeI0PYc1vlZR0LpuFKZqY9vlE6vTGLR\nwMfrTEOvx0NxUM3rpaCgEmuWbB1G1Hu371oyr4srrr+N\n=28dr\n-----END PGP PUBLIC KEY BLOCK-----\n"), + Format: ToPointer("%h %l %u %{now}V %{req.method}V %{req.url}V %>s %{resp.http.Content-Length}V"), + FormatVersion: ToPointer(2), + MessageType: ToPointer("classic"), + Placement: ToPointer("waf_debug"), + FileMaxBytes: ToPointer(MiB), }) }) if err != nil { @@ -47,20 +47,20 @@ func TestClient_BlobStorages(t *testing.T) { bsCreateResp2, err = c.CreateBlobStorage(&CreateBlobStorageInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-blobstorage-2"), - Path: String("/logs"), - AccountName: String("test"), - Container: String("fastly"), - SASToken: String("sv=2015-04-05&ss=b&srt=sco&sp=rw&se=2030-07-21T18%3A00%3A00Z&sig=3ABdLOJZosCp0o491T%2BqZGKIhafF1nlM3MzESDDD3Gg%3D"), - Period: Int(12), - TimestampFormat: String("%Y-%m-%dT%H:%M:%S.000"), - GzipLevel: Int(8), - PublicKey: String("-----BEGIN PGP PUBLIC KEY BLOCK-----\n\nmQENBFyUD8sBCACyFnB39AuuTygseek+eA4fo0cgwva6/FSjnWq7riouQee8GgQ/\nibXTRyv4iVlwI12GswvMTIy7zNvs1R54i0qvsLr+IZ4GVGJqs6ZJnvQcqe3xPoR4\n8AnBfw90o32r/LuHf6QCJXi+AEu35koNlNAvLJ2B+KACaNB7N0EeWmqpV/1V2k9p\nlDYk+th7LcCuaFNGqKS/PrMnnMqR6VDLCjHhNx4KR79b0Twm/2qp6an3hyNRu8Gn\ndwxpf1/BUu3JWf+LqkN4Y3mbOmSUL3MaJNvyQguUzTfS0P0uGuBDHrJCVkMZCzDB\n89ag55jCPHyGeHBTd02gHMWzsg3WMBWvCsrzABEBAAG0JXRlcnJhZm9ybSAodGVz\ndCkgPHRlc3RAdGVycmFmb3JtLmNvbT6JAU4EEwEIADgWIQSHYyc6Kj9l6HzQsau6\nvFFc9jxV/wUCXJQPywIbAwULCQgHAgYVCgkICwIEFgIDAQIeAQIXgAAKCRC6vFFc\n9jxV/815CAClb32OxV7wG01yF97TzlyTl8TnvjMtoG29Mw4nSyg+mjM3b8N7iXm9\nOLX59fbDAWtBSldSZE22RXd3CvlFOG/EnKBXSjBtEqfyxYSnyOPkMPBYWGL/ApkX\nSvPYJ4LKdvipYToKFh3y9kk2gk1DcDBDyaaHvR+3rv1u3aoy7/s2EltAfDS3ZQIq\n7/cWTLJml/lleeB/Y6rPj8xqeCYhE5ahw9gsV/Mdqatl24V9Tks30iijx0Hhw+Gx\nkATUikMGr2GDVqoIRga5kXI7CzYff4rkc0Twn47fMHHHe/KY9M2yVnMHUXmAZwbG\nM1cMI/NH1DjevCKdGBLcRJlhuLPKF/anuQENBFyUD8sBCADIpd7r7GuPd6n/Ikxe\nu6h7umV6IIPoAm88xCYpTbSZiaK30Svh6Ywra9jfE2KlU9o6Y/art8ip0VJ3m07L\n4RSfSpnzqgSwdjSq5hNour2Fo/BzYhK7yaz2AzVSbe33R0+RYhb4b/6N+bKbjwGF\nftCsqVFMH+PyvYkLbvxyQrHlA9woAZaNThI1ztO5rGSnGUR8xt84eup28WIFKg0K\nUEGUcTzz+8QGAwAra+0ewPXo/AkO+8BvZjDidP417u6gpBHOJ9qYIcO9FxHeqFyu\nYrjlrxowEgXn5wO8xuNz6Vu1vhHGDHGDsRbZF8pv1d5O+0F1G7ttZ2GRRgVBZPwi\nkiyRABEBAAGJATYEGAEIACAWIQSHYyc6Kj9l6HzQsau6vFFc9jxV/wUCXJQPywIb\nDAAKCRC6vFFc9jxV/9YOCACe8qmOSnKQpQfW+PqYOqo3dt7JyweTs3FkD6NT8Zml\ndYy/vkstbTjPpX6aTvUZjkb46BVi7AOneVHpD5GBqvRsZ9iVgDYHaehmLCdKiG5L\n3Tp90NN+QY5WDbsGmsyk6+6ZMYejb4qYfweQeduOj27aavCJdLkCYMoRKfcFYI8c\nFaNmEfKKy/r1PO20NXEG6t9t05K/frHy6ZG8bCNYdpagfFVot47r9JaQqWlTNtIR\n5+zkkSq/eG9BEtRij3a6cTdQbktdBzx2KBeI0PYc1vlZR0LpuFKZqY9vlE6vTGLR\nwMfrTEOvx0NxUM3rpaCgEmuWbB1G1Hu371oyr4srrr+N\n=28dr\n-----END PGP PUBLIC KEY BLOCK-----\n"), - Format: String("%h %l %u %{now}V %{req.method}V %{req.url}V %>s %{resp.http.Content-Length}V"), - FormatVersion: Int(2), - MessageType: String("classic"), - Placement: String("waf_debug"), - FileMaxBytes: Int(10 * MiB), + Name: ToPointer("test-blobstorage-2"), + Path: ToPointer("/logs"), + AccountName: ToPointer("test"), + Container: ToPointer("fastly"), + SASToken: ToPointer("sv=2015-04-05&ss=b&srt=sco&sp=rw&se=2030-07-21T18%3A00%3A00Z&sig=3ABdLOJZosCp0o491T%2BqZGKIhafF1nlM3MzESDDD3Gg%3D"), + Period: ToPointer(12), + TimestampFormat: ToPointer("%Y-%m-%dT%H:%M:%S.000"), + GzipLevel: ToPointer(8), + PublicKey: ToPointer("-----BEGIN PGP PUBLIC KEY BLOCK-----\n\nmQENBFyUD8sBCACyFnB39AuuTygseek+eA4fo0cgwva6/FSjnWq7riouQee8GgQ/\nibXTRyv4iVlwI12GswvMTIy7zNvs1R54i0qvsLr+IZ4GVGJqs6ZJnvQcqe3xPoR4\n8AnBfw90o32r/LuHf6QCJXi+AEu35koNlNAvLJ2B+KACaNB7N0EeWmqpV/1V2k9p\nlDYk+th7LcCuaFNGqKS/PrMnnMqR6VDLCjHhNx4KR79b0Twm/2qp6an3hyNRu8Gn\ndwxpf1/BUu3JWf+LqkN4Y3mbOmSUL3MaJNvyQguUzTfS0P0uGuBDHrJCVkMZCzDB\n89ag55jCPHyGeHBTd02gHMWzsg3WMBWvCsrzABEBAAG0JXRlcnJhZm9ybSAodGVz\ndCkgPHRlc3RAdGVycmFmb3JtLmNvbT6JAU4EEwEIADgWIQSHYyc6Kj9l6HzQsau6\nvFFc9jxV/wUCXJQPywIbAwULCQgHAgYVCgkICwIEFgIDAQIeAQIXgAAKCRC6vFFc\n9jxV/815CAClb32OxV7wG01yF97TzlyTl8TnvjMtoG29Mw4nSyg+mjM3b8N7iXm9\nOLX59fbDAWtBSldSZE22RXd3CvlFOG/EnKBXSjBtEqfyxYSnyOPkMPBYWGL/ApkX\nSvPYJ4LKdvipYToKFh3y9kk2gk1DcDBDyaaHvR+3rv1u3aoy7/s2EltAfDS3ZQIq\n7/cWTLJml/lleeB/Y6rPj8xqeCYhE5ahw9gsV/Mdqatl24V9Tks30iijx0Hhw+Gx\nkATUikMGr2GDVqoIRga5kXI7CzYff4rkc0Twn47fMHHHe/KY9M2yVnMHUXmAZwbG\nM1cMI/NH1DjevCKdGBLcRJlhuLPKF/anuQENBFyUD8sBCADIpd7r7GuPd6n/Ikxe\nu6h7umV6IIPoAm88xCYpTbSZiaK30Svh6Ywra9jfE2KlU9o6Y/art8ip0VJ3m07L\n4RSfSpnzqgSwdjSq5hNour2Fo/BzYhK7yaz2AzVSbe33R0+RYhb4b/6N+bKbjwGF\nftCsqVFMH+PyvYkLbvxyQrHlA9woAZaNThI1ztO5rGSnGUR8xt84eup28WIFKg0K\nUEGUcTzz+8QGAwAra+0ewPXo/AkO+8BvZjDidP417u6gpBHOJ9qYIcO9FxHeqFyu\nYrjlrxowEgXn5wO8xuNz6Vu1vhHGDHGDsRbZF8pv1d5O+0F1G7ttZ2GRRgVBZPwi\nkiyRABEBAAGJATYEGAEIACAWIQSHYyc6Kj9l6HzQsau6vFFc9jxV/wUCXJQPywIb\nDAAKCRC6vFFc9jxV/9YOCACe8qmOSnKQpQfW+PqYOqo3dt7JyweTs3FkD6NT8Zml\ndYy/vkstbTjPpX6aTvUZjkb46BVi7AOneVHpD5GBqvRsZ9iVgDYHaehmLCdKiG5L\n3Tp90NN+QY5WDbsGmsyk6+6ZMYejb4qYfweQeduOj27aavCJdLkCYMoRKfcFYI8c\nFaNmEfKKy/r1PO20NXEG6t9t05K/frHy6ZG8bCNYdpagfFVot47r9JaQqWlTNtIR\n5+zkkSq/eG9BEtRij3a6cTdQbktdBzx2KBeI0PYc1vlZR0LpuFKZqY9vlE6vTGLR\nwMfrTEOvx0NxUM3rpaCgEmuWbB1G1Hu371oyr4srrr+N\n=28dr\n-----END PGP PUBLIC KEY BLOCK-----\n"), + Format: ToPointer("%h %l %u %{now}V %{req.method}V %{req.url}V %>s %{resp.http.Content-Length}V"), + FormatVersion: ToPointer(2), + MessageType: ToPointer("classic"), + Placement: ToPointer("waf_debug"), + FileMaxBytes: ToPointer(10 * MiB), }) }) if err != nil { @@ -71,19 +71,19 @@ func TestClient_BlobStorages(t *testing.T) { bsCreateResp3, err = c.CreateBlobStorage(&CreateBlobStorageInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-blobstorage-3"), - Path: String("/logs"), - AccountName: String("test"), - Container: String("fastly"), - SASToken: String("sv=2015-04-05&ss=b&srt=sco&sp=rw&se=2030-07-21T18%3A00%3A00Z&sig=3ABdLOJZosCp0o491T%2BqZGKIhafF1nlM3MzESDDD3Gg%3D"), - Period: Int(12), - TimestampFormat: String("%Y-%m-%dT%H:%M:%S.000"), - CompressionCodec: String("snappy"), - PublicKey: String("-----BEGIN PGP PUBLIC KEY BLOCK-----\n\nmQENBFyUD8sBCACyFnB39AuuTygseek+eA4fo0cgwva6/FSjnWq7riouQee8GgQ/\nibXTRyv4iVlwI12GswvMTIy7zNvs1R54i0qvsLr+IZ4GVGJqs6ZJnvQcqe3xPoR4\n8AnBfw90o32r/LuHf6QCJXi+AEu35koNlNAvLJ2B+KACaNB7N0EeWmqpV/1V2k9p\nlDYk+th7LcCuaFNGqKS/PrMnnMqR6VDLCjHhNx4KR79b0Twm/2qp6an3hyNRu8Gn\ndwxpf1/BUu3JWf+LqkN4Y3mbOmSUL3MaJNvyQguUzTfS0P0uGuBDHrJCVkMZCzDB\n89ag55jCPHyGeHBTd02gHMWzsg3WMBWvCsrzABEBAAG0JXRlcnJhZm9ybSAodGVz\ndCkgPHRlc3RAdGVycmFmb3JtLmNvbT6JAU4EEwEIADgWIQSHYyc6Kj9l6HzQsau6\nvFFc9jxV/wUCXJQPywIbAwULCQgHAgYVCgkICwIEFgIDAQIeAQIXgAAKCRC6vFFc\n9jxV/815CAClb32OxV7wG01yF97TzlyTl8TnvjMtoG29Mw4nSyg+mjM3b8N7iXm9\nOLX59fbDAWtBSldSZE22RXd3CvlFOG/EnKBXSjBtEqfyxYSnyOPkMPBYWGL/ApkX\nSvPYJ4LKdvipYToKFh3y9kk2gk1DcDBDyaaHvR+3rv1u3aoy7/s2EltAfDS3ZQIq\n7/cWTLJml/lleeB/Y6rPj8xqeCYhE5ahw9gsV/Mdqatl24V9Tks30iijx0Hhw+Gx\nkATUikMGr2GDVqoIRga5kXI7CzYff4rkc0Twn47fMHHHe/KY9M2yVnMHUXmAZwbG\nM1cMI/NH1DjevCKdGBLcRJlhuLPKF/anuQENBFyUD8sBCADIpd7r7GuPd6n/Ikxe\nu6h7umV6IIPoAm88xCYpTbSZiaK30Svh6Ywra9jfE2KlU9o6Y/art8ip0VJ3m07L\n4RSfSpnzqgSwdjSq5hNour2Fo/BzYhK7yaz2AzVSbe33R0+RYhb4b/6N+bKbjwGF\nftCsqVFMH+PyvYkLbvxyQrHlA9woAZaNThI1ztO5rGSnGUR8xt84eup28WIFKg0K\nUEGUcTzz+8QGAwAra+0ewPXo/AkO+8BvZjDidP417u6gpBHOJ9qYIcO9FxHeqFyu\nYrjlrxowEgXn5wO8xuNz6Vu1vhHGDHGDsRbZF8pv1d5O+0F1G7ttZ2GRRgVBZPwi\nkiyRABEBAAGJATYEGAEIACAWIQSHYyc6Kj9l6HzQsau6vFFc9jxV/wUCXJQPywIb\nDAAKCRC6vFFc9jxV/9YOCACe8qmOSnKQpQfW+PqYOqo3dt7JyweTs3FkD6NT8Zml\ndYy/vkstbTjPpX6aTvUZjkb46BVi7AOneVHpD5GBqvRsZ9iVgDYHaehmLCdKiG5L\n3Tp90NN+QY5WDbsGmsyk6+6ZMYejb4qYfweQeduOj27aavCJdLkCYMoRKfcFYI8c\nFaNmEfKKy/r1PO20NXEG6t9t05K/frHy6ZG8bCNYdpagfFVot47r9JaQqWlTNtIR\n5+zkkSq/eG9BEtRij3a6cTdQbktdBzx2KBeI0PYc1vlZR0LpuFKZqY9vlE6vTGLR\nwMfrTEOvx0NxUM3rpaCgEmuWbB1G1Hu371oyr4srrr+N\n=28dr\n-----END PGP PUBLIC KEY BLOCK-----\n"), - Format: String("%h %l %u %{now}V %{req.method}V %{req.url}V %>s %{resp.http.Content-Length}V"), - FormatVersion: Int(2), - MessageType: String("classic"), - Placement: String("waf_debug"), + Name: ToPointer("test-blobstorage-3"), + Path: ToPointer("/logs"), + AccountName: ToPointer("test"), + Container: ToPointer("fastly"), + SASToken: ToPointer("sv=2015-04-05&ss=b&srt=sco&sp=rw&se=2030-07-21T18%3A00%3A00Z&sig=3ABdLOJZosCp0o491T%2BqZGKIhafF1nlM3MzESDDD3Gg%3D"), + Period: ToPointer(12), + TimestampFormat: ToPointer("%Y-%m-%dT%H:%M:%S.000"), + CompressionCodec: ToPointer("snappy"), + PublicKey: ToPointer("-----BEGIN PGP PUBLIC KEY BLOCK-----\n\nmQENBFyUD8sBCACyFnB39AuuTygseek+eA4fo0cgwva6/FSjnWq7riouQee8GgQ/\nibXTRyv4iVlwI12GswvMTIy7zNvs1R54i0qvsLr+IZ4GVGJqs6ZJnvQcqe3xPoR4\n8AnBfw90o32r/LuHf6QCJXi+AEu35koNlNAvLJ2B+KACaNB7N0EeWmqpV/1V2k9p\nlDYk+th7LcCuaFNGqKS/PrMnnMqR6VDLCjHhNx4KR79b0Twm/2qp6an3hyNRu8Gn\ndwxpf1/BUu3JWf+LqkN4Y3mbOmSUL3MaJNvyQguUzTfS0P0uGuBDHrJCVkMZCzDB\n89ag55jCPHyGeHBTd02gHMWzsg3WMBWvCsrzABEBAAG0JXRlcnJhZm9ybSAodGVz\ndCkgPHRlc3RAdGVycmFmb3JtLmNvbT6JAU4EEwEIADgWIQSHYyc6Kj9l6HzQsau6\nvFFc9jxV/wUCXJQPywIbAwULCQgHAgYVCgkICwIEFgIDAQIeAQIXgAAKCRC6vFFc\n9jxV/815CAClb32OxV7wG01yF97TzlyTl8TnvjMtoG29Mw4nSyg+mjM3b8N7iXm9\nOLX59fbDAWtBSldSZE22RXd3CvlFOG/EnKBXSjBtEqfyxYSnyOPkMPBYWGL/ApkX\nSvPYJ4LKdvipYToKFh3y9kk2gk1DcDBDyaaHvR+3rv1u3aoy7/s2EltAfDS3ZQIq\n7/cWTLJml/lleeB/Y6rPj8xqeCYhE5ahw9gsV/Mdqatl24V9Tks30iijx0Hhw+Gx\nkATUikMGr2GDVqoIRga5kXI7CzYff4rkc0Twn47fMHHHe/KY9M2yVnMHUXmAZwbG\nM1cMI/NH1DjevCKdGBLcRJlhuLPKF/anuQENBFyUD8sBCADIpd7r7GuPd6n/Ikxe\nu6h7umV6IIPoAm88xCYpTbSZiaK30Svh6Ywra9jfE2KlU9o6Y/art8ip0VJ3m07L\n4RSfSpnzqgSwdjSq5hNour2Fo/BzYhK7yaz2AzVSbe33R0+RYhb4b/6N+bKbjwGF\nftCsqVFMH+PyvYkLbvxyQrHlA9woAZaNThI1ztO5rGSnGUR8xt84eup28WIFKg0K\nUEGUcTzz+8QGAwAra+0ewPXo/AkO+8BvZjDidP417u6gpBHOJ9qYIcO9FxHeqFyu\nYrjlrxowEgXn5wO8xuNz6Vu1vhHGDHGDsRbZF8pv1d5O+0F1G7ttZ2GRRgVBZPwi\nkiyRABEBAAGJATYEGAEIACAWIQSHYyc6Kj9l6HzQsau6vFFc9jxV/wUCXJQPywIb\nDAAKCRC6vFFc9jxV/9YOCACe8qmOSnKQpQfW+PqYOqo3dt7JyweTs3FkD6NT8Zml\ndYy/vkstbTjPpX6aTvUZjkb46BVi7AOneVHpD5GBqvRsZ9iVgDYHaehmLCdKiG5L\n3Tp90NN+QY5WDbsGmsyk6+6ZMYejb4qYfweQeduOj27aavCJdLkCYMoRKfcFYI8c\nFaNmEfKKy/r1PO20NXEG6t9t05K/frHy6ZG8bCNYdpagfFVot47r9JaQqWlTNtIR\n5+zkkSq/eG9BEtRij3a6cTdQbktdBzx2KBeI0PYc1vlZR0LpuFKZqY9vlE6vTGLR\nwMfrTEOvx0NxUM3rpaCgEmuWbB1G1Hu371oyr4srrr+N\n=28dr\n-----END PGP PUBLIC KEY BLOCK-----\n"), + Format: ToPointer("%h %l %u %{now}V %{req.method}V %{req.url}V %>s %{resp.http.Content-Length}V"), + FormatVersion: ToPointer(2), + MessageType: ToPointer("classic"), + Placement: ToPointer("waf_debug"), }) }) if err != nil { @@ -96,21 +96,21 @@ func TestClient_BlobStorages(t *testing.T) { _, err = c.CreateBlobStorage(&CreateBlobStorageInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-blobstorage-4"), - Path: String("/logs"), - AccountName: String("test"), - Container: String("fastly"), - SASToken: String("sv=2015-04-05&ss=b&srt=sco&sp=rw&se=2030-07-21T18%3A00%3A00Z&sig=3ABdLOJZosCp0o491T%2BqZGKIhafF1nlM3MzESDDD3Gg%3D"), - Period: Int(12), - TimestampFormat: String("%Y-%m-%dT%H:%M:%S.000"), - CompressionCodec: String("snappy"), - GzipLevel: Int(8), - PublicKey: String("-----BEGIN PGP PUBLIC KEY BLOCK-----\n\nmQENBFyUD8sBCACyFnB39AuuTygseek+eA4fo0cgwva6/FSjnWq7riouQee8GgQ/\nibXTRyv4iVlwI12GswvMTIy7zNvs1R54i0qvsLr+IZ4GVGJqs6ZJnvQcqe3xPoR4\n8AnBfw90o32r/LuHf6QCJXi+AEu35koNlNAvLJ2B+KACaNB7N0EeWmqpV/1V2k9p\nlDYk+th7LcCuaFNGqKS/PrMnnMqR6VDLCjHhNx4KR79b0Twm/2qp6an3hyNRu8Gn\ndwxpf1/BUu3JWf+LqkN4Y3mbOmSUL3MaJNvyQguUzTfS0P0uGuBDHrJCVkMZCzDB\n89ag55jCPHyGeHBTd02gHMWzsg3WMBWvCsrzABEBAAG0JXRlcnJhZm9ybSAodGVz\ndCkgPHRlc3RAdGVycmFmb3JtLmNvbT6JAU4EEwEIADgWIQSHYyc6Kj9l6HzQsau6\nvFFc9jxV/wUCXJQPywIbAwULCQgHAgYVCgkICwIEFgIDAQIeAQIXgAAKCRC6vFFc\n9jxV/815CAClb32OxV7wG01yF97TzlyTl8TnvjMtoG29Mw4nSyg+mjM3b8N7iXm9\nOLX59fbDAWtBSldSZE22RXd3CvlFOG/EnKBXSjBtEqfyxYSnyOPkMPBYWGL/ApkX\nSvPYJ4LKdvipYToKFh3y9kk2gk1DcDBDyaaHvR+3rv1u3aoy7/s2EltAfDS3ZQIq\n7/cWTLJml/lleeB/Y6rPj8xqeCYhE5ahw9gsV/Mdqatl24V9Tks30iijx0Hhw+Gx\nkATUikMGr2GDVqoIRga5kXI7CzYff4rkc0Twn47fMHHHe/KY9M2yVnMHUXmAZwbG\nM1cMI/NH1DjevCKdGBLcRJlhuLPKF/anuQENBFyUD8sBCADIpd7r7GuPd6n/Ikxe\nu6h7umV6IIPoAm88xCYpTbSZiaK30Svh6Ywra9jfE2KlU9o6Y/art8ip0VJ3m07L\n4RSfSpnzqgSwdjSq5hNour2Fo/BzYhK7yaz2AzVSbe33R0+RYhb4b/6N+bKbjwGF\nftCsqVFMH+PyvYkLbvxyQrHlA9woAZaNThI1ztO5rGSnGUR8xt84eup28WIFKg0K\nUEGUcTzz+8QGAwAra+0ewPXo/AkO+8BvZjDidP417u6gpBHOJ9qYIcO9FxHeqFyu\nYrjlrxowEgXn5wO8xuNz6Vu1vhHGDHGDsRbZF8pv1d5O+0F1G7ttZ2GRRgVBZPwi\nkiyRABEBAAGJATYEGAEIACAWIQSHYyc6Kj9l6HzQsau6vFFc9jxV/wUCXJQPywIb\nDAAKCRC6vFFc9jxV/9YOCACe8qmOSnKQpQfW+PqYOqo3dt7JyweTs3FkD6NT8Zml\ndYy/vkstbTjPpX6aTvUZjkb46BVi7AOneVHpD5GBqvRsZ9iVgDYHaehmLCdKiG5L\n3Tp90NN+QY5WDbsGmsyk6+6ZMYejb4qYfweQeduOj27aavCJdLkCYMoRKfcFYI8c\nFaNmEfKKy/r1PO20NXEG6t9t05K/frHy6ZG8bCNYdpagfFVot47r9JaQqWlTNtIR\n5+zkkSq/eG9BEtRij3a6cTdQbktdBzx2KBeI0PYc1vlZR0LpuFKZqY9vlE6vTGLR\nwMfrTEOvx0NxUM3rpaCgEmuWbB1G1Hu371oyr4srrr+N\n=28dr\n-----END PGP PUBLIC KEY BLOCK-----\n"), - Format: String("%h %l %u %{now}V %{req.method}V %{req.url}V %>s %{resp.http.Content-Length}V"), - FormatVersion: Int(2), - MessageType: String("classic"), - Placement: String("waf_debug"), - FileMaxBytes: Int(10 * MiB), + Name: ToPointer("test-blobstorage-4"), + Path: ToPointer("/logs"), + AccountName: ToPointer("test"), + Container: ToPointer("fastly"), + SASToken: ToPointer("sv=2015-04-05&ss=b&srt=sco&sp=rw&se=2030-07-21T18%3A00%3A00Z&sig=3ABdLOJZosCp0o491T%2BqZGKIhafF1nlM3MzESDDD3Gg%3D"), + Period: ToPointer(12), + TimestampFormat: ToPointer("%Y-%m-%dT%H:%M:%S.000"), + CompressionCodec: ToPointer("snappy"), + GzipLevel: ToPointer(8), + PublicKey: ToPointer("-----BEGIN PGP PUBLIC KEY BLOCK-----\n\nmQENBFyUD8sBCACyFnB39AuuTygseek+eA4fo0cgwva6/FSjnWq7riouQee8GgQ/\nibXTRyv4iVlwI12GswvMTIy7zNvs1R54i0qvsLr+IZ4GVGJqs6ZJnvQcqe3xPoR4\n8AnBfw90o32r/LuHf6QCJXi+AEu35koNlNAvLJ2B+KACaNB7N0EeWmqpV/1V2k9p\nlDYk+th7LcCuaFNGqKS/PrMnnMqR6VDLCjHhNx4KR79b0Twm/2qp6an3hyNRu8Gn\ndwxpf1/BUu3JWf+LqkN4Y3mbOmSUL3MaJNvyQguUzTfS0P0uGuBDHrJCVkMZCzDB\n89ag55jCPHyGeHBTd02gHMWzsg3WMBWvCsrzABEBAAG0JXRlcnJhZm9ybSAodGVz\ndCkgPHRlc3RAdGVycmFmb3JtLmNvbT6JAU4EEwEIADgWIQSHYyc6Kj9l6HzQsau6\nvFFc9jxV/wUCXJQPywIbAwULCQgHAgYVCgkICwIEFgIDAQIeAQIXgAAKCRC6vFFc\n9jxV/815CAClb32OxV7wG01yF97TzlyTl8TnvjMtoG29Mw4nSyg+mjM3b8N7iXm9\nOLX59fbDAWtBSldSZE22RXd3CvlFOG/EnKBXSjBtEqfyxYSnyOPkMPBYWGL/ApkX\nSvPYJ4LKdvipYToKFh3y9kk2gk1DcDBDyaaHvR+3rv1u3aoy7/s2EltAfDS3ZQIq\n7/cWTLJml/lleeB/Y6rPj8xqeCYhE5ahw9gsV/Mdqatl24V9Tks30iijx0Hhw+Gx\nkATUikMGr2GDVqoIRga5kXI7CzYff4rkc0Twn47fMHHHe/KY9M2yVnMHUXmAZwbG\nM1cMI/NH1DjevCKdGBLcRJlhuLPKF/anuQENBFyUD8sBCADIpd7r7GuPd6n/Ikxe\nu6h7umV6IIPoAm88xCYpTbSZiaK30Svh6Ywra9jfE2KlU9o6Y/art8ip0VJ3m07L\n4RSfSpnzqgSwdjSq5hNour2Fo/BzYhK7yaz2AzVSbe33R0+RYhb4b/6N+bKbjwGF\nftCsqVFMH+PyvYkLbvxyQrHlA9woAZaNThI1ztO5rGSnGUR8xt84eup28WIFKg0K\nUEGUcTzz+8QGAwAra+0ewPXo/AkO+8BvZjDidP417u6gpBHOJ9qYIcO9FxHeqFyu\nYrjlrxowEgXn5wO8xuNz6Vu1vhHGDHGDsRbZF8pv1d5O+0F1G7ttZ2GRRgVBZPwi\nkiyRABEBAAGJATYEGAEIACAWIQSHYyc6Kj9l6HzQsau6vFFc9jxV/wUCXJQPywIb\nDAAKCRC6vFFc9jxV/9YOCACe8qmOSnKQpQfW+PqYOqo3dt7JyweTs3FkD6NT8Zml\ndYy/vkstbTjPpX6aTvUZjkb46BVi7AOneVHpD5GBqvRsZ9iVgDYHaehmLCdKiG5L\n3Tp90NN+QY5WDbsGmsyk6+6ZMYejb4qYfweQeduOj27aavCJdLkCYMoRKfcFYI8c\nFaNmEfKKy/r1PO20NXEG6t9t05K/frHy6ZG8bCNYdpagfFVot47r9JaQqWlTNtIR\n5+zkkSq/eG9BEtRij3a6cTdQbktdBzx2KBeI0PYc1vlZR0LpuFKZqY9vlE6vTGLR\nwMfrTEOvx0NxUM3rpaCgEmuWbB1G1Hu371oyr4srrr+N\n=28dr\n-----END PGP PUBLIC KEY BLOCK-----\n"), + Format: ToPointer("%h %l %u %{now}V %{req.method}V %{req.url}V %>s %{resp.http.Content-Length}V"), + FormatVersion: ToPointer(2), + MessageType: ToPointer("classic"), + Placement: ToPointer("waf_debug"), + FileMaxBytes: ToPointer(10 * MiB), }) }) if err == nil { @@ -287,9 +287,9 @@ func TestClient_BlobStorages(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-blobstorage", - NewName: String("new-test-blobstorage"), - CompressionCodec: String("zstd"), - FileMaxBytes: Int(5 * MiB), + NewName: ToPointer("new-test-blobstorage"), + CompressionCodec: ToPointer("zstd"), + FileMaxBytes: ToPointer(5 * MiB), }) }) if err != nil { @@ -303,7 +303,7 @@ func TestClient_BlobStorages(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-blobstorage-2", - CompressionCodec: String("zstd"), + CompressionCodec: ToPointer("zstd"), }) }) if err != nil { @@ -317,7 +317,7 @@ func TestClient_BlobStorages(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-blobstorage-3", - GzipLevel: Int(9), + GzipLevel: ToPointer(9), }) }) if err != nil { diff --git a/fastly/cache_setting.go b/fastly/cache_setting.go index 5dfd87c5a..02664ac22 100644 --- a/fastly/cache_setting.go +++ b/fastly/cache_setting.go @@ -21,12 +21,6 @@ const ( // CacheSettingAction is the type of cache action. type CacheSettingAction string -// CacheSettingActionPtr returns a pointer to a CacheSettingAction. -func CacheSettingActionPtr(v CacheSettingAction) *CacheSettingAction { - csa := &v - return csa -} - // CacheSetting represents a response from Fastly's API for cache settings. type CacheSetting struct { Action CacheSettingAction `mapstructure:"action"` diff --git a/fastly/cache_setting_test.go b/fastly/cache_setting_test.go index e04052331..03e22c4d9 100644 --- a/fastly/cache_setting_test.go +++ b/fastly/cache_setting_test.go @@ -19,10 +19,10 @@ func TestClient_CacheSettings(t *testing.T) { cacheSetting, err = c.CreateCacheSetting(&CreateCacheSettingInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-cache-setting"), - Action: CacheSettingActionPtr(CacheSettingActionCache), - TTL: Int(1234), - StaleTTL: Int(1500), + Name: ToPointer("test-cache-setting"), + Action: ToPointer(CacheSettingActionCache), + TTL: ToPointer(1234), + StaleTTL: ToPointer(1500), }) }) if err != nil { @@ -106,7 +106,7 @@ func TestClient_CacheSettings(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-cache-setting", - NewName: String("new-test-cache-setting"), + NewName: ToPointer("new-test-cache-setting"), }) }) if err != nil { diff --git a/fastly/cloudfiles_test.go b/fastly/cloudfiles_test.go index 11e256b31..a9affb60f 100644 --- a/fastly/cloudfiles_test.go +++ b/fastly/cloudfiles_test.go @@ -19,20 +19,20 @@ func TestClient_Cloudfiles(t *testing.T) { cloudfilesCreateResp1, err = c.CreateCloudfiles(&CreateCloudfilesInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-cloudfiles"), - User: String("user"), - AccessKey: String("secret-key"), - BucketName: String("bucket-name"), - Path: String("/path"), - Region: String("DFW"), - Period: Int(12), - Format: String("format"), - FormatVersion: Int(1), - TimestampFormat: String("%Y"), - MessageType: String("classic"), - Placement: String("waf_debug"), - PublicKey: String(pgpPublicKey()), - CompressionCodec: String("snappy"), + Name: ToPointer("test-cloudfiles"), + User: ToPointer("user"), + AccessKey: ToPointer("secret-key"), + BucketName: ToPointer("bucket-name"), + Path: ToPointer("/path"), + Region: ToPointer("DFW"), + Period: ToPointer(12), + Format: ToPointer("format"), + FormatVersion: ToPointer(1), + TimestampFormat: ToPointer("%Y"), + MessageType: ToPointer("classic"), + Placement: ToPointer("waf_debug"), + PublicKey: ToPointer(pgpPublicKey()), + CompressionCodec: ToPointer("snappy"), }) }) if err != nil { @@ -43,20 +43,20 @@ func TestClient_Cloudfiles(t *testing.T) { cloudfilesCreateResp2, err = c.CreateCloudfiles(&CreateCloudfilesInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-cloudfiles-2"), - User: String("user"), - AccessKey: String("secret-key"), - BucketName: String("bucket-name"), - Path: String("/path"), - Region: String("DFW"), - Period: Int(12), - GzipLevel: Int(8), - Format: String("format"), - FormatVersion: Int(1), - TimestampFormat: String("%Y"), - MessageType: String("classic"), - Placement: String("waf_debug"), - PublicKey: String(pgpPublicKey()), + Name: ToPointer("test-cloudfiles-2"), + User: ToPointer("user"), + AccessKey: ToPointer("secret-key"), + BucketName: ToPointer("bucket-name"), + Path: ToPointer("/path"), + Region: ToPointer("DFW"), + Period: ToPointer(12), + GzipLevel: ToPointer(8), + Format: ToPointer("format"), + FormatVersion: ToPointer(1), + TimestampFormat: ToPointer("%Y"), + MessageType: ToPointer("classic"), + Placement: ToPointer("waf_debug"), + PublicKey: ToPointer(pgpPublicKey()), }) }) if err != nil { @@ -67,20 +67,20 @@ func TestClient_Cloudfiles(t *testing.T) { cloudfilesCreateResp3, err = c.CreateCloudfiles(&CreateCloudfilesInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-cloudfiles-3"), - User: String("user"), - AccessKey: String("secret-key"), - BucketName: String("bucket-name"), - Path: String("/path"), - Region: String("DFW"), - Period: Int(12), - Format: String("format"), - FormatVersion: Int(1), - TimestampFormat: String("%Y"), - MessageType: String("classic"), - Placement: String("waf_debug"), - PublicKey: String(pgpPublicKey()), - CompressionCodec: String("snappy"), + Name: ToPointer("test-cloudfiles-3"), + User: ToPointer("user"), + AccessKey: ToPointer("secret-key"), + BucketName: ToPointer("bucket-name"), + Path: ToPointer("/path"), + Region: ToPointer("DFW"), + Period: ToPointer(12), + Format: ToPointer("format"), + FormatVersion: ToPointer(1), + TimestampFormat: ToPointer("%Y"), + MessageType: ToPointer("classic"), + Placement: ToPointer("waf_debug"), + PublicKey: ToPointer(pgpPublicKey()), + CompressionCodec: ToPointer("snappy"), }) }) if err != nil { @@ -93,21 +93,21 @@ func TestClient_Cloudfiles(t *testing.T) { _, err = c.CreateCloudfiles(&CreateCloudfilesInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-cloudfiles-4"), - User: String("user"), - AccessKey: String("secret-key"), - BucketName: String("bucket-name"), - Path: String("/path"), - Region: String("DFW"), - Period: Int(12), - GzipLevel: Int(8), - Format: String("format"), - FormatVersion: Int(1), - TimestampFormat: String("%Y"), - MessageType: String("classic"), - Placement: String("waf_debug"), - PublicKey: String(pgpPublicKey()), - CompressionCodec: String("snappy"), + Name: ToPointer("test-cloudfiles-4"), + User: ToPointer("user"), + AccessKey: ToPointer("secret-key"), + BucketName: ToPointer("bucket-name"), + Path: ToPointer("/path"), + Region: ToPointer("DFW"), + Period: ToPointer(12), + GzipLevel: ToPointer(8), + Format: ToPointer("format"), + FormatVersion: ToPointer(1), + TimestampFormat: ToPointer("%Y"), + MessageType: ToPointer("classic"), + Placement: ToPointer("waf_debug"), + PublicKey: ToPointer(pgpPublicKey()), + CompressionCodec: ToPointer("snappy"), }) }) if err == nil { @@ -280,11 +280,11 @@ func TestClient_Cloudfiles(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-cloudfiles", - NewName: String("new-test-cloudfiles"), - User: String("new-user"), - Period: Int(0), - FormatVersion: Int(2), - CompressionCodec: String("zstd"), + NewName: ToPointer("new-test-cloudfiles"), + User: ToPointer("new-user"), + Period: ToPointer(0), + FormatVersion: ToPointer(2), + CompressionCodec: ToPointer("zstd"), }) }) if err != nil { @@ -296,7 +296,7 @@ func TestClient_Cloudfiles(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-cloudfiles-2", - CompressionCodec: String("zstd"), + CompressionCodec: ToPointer("zstd"), }) }) if err != nil { @@ -308,7 +308,7 @@ func TestClient_Cloudfiles(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-cloudfiles-3", - GzipLevel: Int(9), + GzipLevel: ToPointer(9), }) }) if err != nil { diff --git a/fastly/condition_test.go b/fastly/condition_test.go index 809052306..3afd956c7 100644 --- a/fastly/condition_test.go +++ b/fastly/condition_test.go @@ -19,10 +19,10 @@ func TestClient_Conditions(t *testing.T) { condition, err = c.CreateCondition(&CreateConditionInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test/condition"), - Statement: String("req.url~+\"index.html\""), - Type: String("REQUEST"), - Priority: Int(1), + Name: ToPointer("test/condition"), + Statement: ToPointer("req.url~+\"index.html\""), + Type: ToPointer("REQUEST"), + Priority: ToPointer(1), }) }) if err != nil { @@ -100,7 +100,7 @@ func TestClient_Conditions(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test/condition", - Statement: String("req.url~+\"updated.html\""), + Statement: ToPointer("req.url~+\"updated.html\""), }) }) if err != nil { diff --git a/fastly/datadog_test.go b/fastly/datadog_test.go index 2c67b2f1f..6d16e3459 100644 --- a/fastly/datadog_test.go +++ b/fastly/datadog_test.go @@ -19,11 +19,11 @@ func TestClient_Datadog(t *testing.T) { d, err = c.CreateDatadog(&CreateDatadogInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-datadog"), - Region: String("US"), - Token: String("abcd1234"), - Format: String("format"), - Placement: String("waf_debug"), + Name: ToPointer("test-datadog"), + Region: ToPointer("US"), + Token: ToPointer("abcd1234"), + Format: ToPointer("format"), + Placement: ToPointer("waf_debug"), }) }) if err != nil { @@ -116,9 +116,9 @@ func TestClient_Datadog(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-datadog", - NewName: String("new-test-datadog"), - Region: String("EU"), - FormatVersion: Int(2), + NewName: ToPointer("new-test-datadog"), + Region: ToPointer("EU"), + FormatVersion: ToPointer(2), }) }) if err != nil { diff --git a/fastly/dictionary_test.go b/fastly/dictionary_test.go index 747fc67ad..434360609 100644 --- a/fastly/dictionary_test.go +++ b/fastly/dictionary_test.go @@ -18,7 +18,7 @@ func TestClient_Dictionaries(t *testing.T) { d, err = c.CreateDictionary(&CreateDictionaryInput{ ServiceID: testServiceID, ServiceVersion: testVersion.Number, - Name: String("test_dictionary"), + Name: ToPointer("test_dictionary"), }) }) if err != nil { @@ -84,7 +84,7 @@ func TestClient_Dictionaries(t *testing.T) { ServiceID: testServiceID, ServiceVersion: testVersion.Number, Name: "test_dictionary", - NewName: String("new_test_dictionary"), + NewName: ToPointer("new_test_dictionary"), }) }) if err != nil { diff --git a/fastly/diff_test.go b/fastly/diff_test.go index 22068d8d9..5c05fb95a 100644 --- a/fastly/diff_test.go +++ b/fastly/diff_test.go @@ -36,8 +36,8 @@ func TestClient_Diff(t *testing.T) { _, err = c.CreateBackend(&CreateBackendInput{ ServiceID: testServiceID, ServiceVersion: tv2.Number, - Name: String("test-backend"), - Address: String("integ-test.go-fastly.com"), + Name: ToPointer("test-backend"), + Address: ToPointer("integ-test.go-fastly.com"), }) }) if err != nil { diff --git a/fastly/digitalocean_test.go b/fastly/digitalocean_test.go index 37418d4ae..841a5a23f 100644 --- a/fastly/digitalocean_test.go +++ b/fastly/digitalocean_test.go @@ -19,20 +19,20 @@ func TestClient_DigitalOceans(t *testing.T) { digitaloceanCreateResp1, err = c.CreateDigitalOcean(&CreateDigitalOceanInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-digitalocean"), - BucketName: String("bucket-name"), - Domain: String("fra1.digitaloceanspaces.com"), - AccessKey: String("AKIAIOSFODNN7EXAMPLE"), - SecretKey: String("wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"), - Path: String("/path"), - Period: Int(12), - Format: String("format"), - FormatVersion: Int(2), - TimestampFormat: String("%Y"), - MessageType: String("classic"), - Placement: String("waf_debug"), - PublicKey: String(pgpPublicKey()), - CompressionCodec: String("snappy"), + Name: ToPointer("test-digitalocean"), + BucketName: ToPointer("bucket-name"), + Domain: ToPointer("fra1.digitaloceanspaces.com"), + AccessKey: ToPointer("AKIAIOSFODNN7EXAMPLE"), + SecretKey: ToPointer("wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"), + Path: ToPointer("/path"), + Period: ToPointer(12), + Format: ToPointer("format"), + FormatVersion: ToPointer(2), + TimestampFormat: ToPointer("%Y"), + MessageType: ToPointer("classic"), + Placement: ToPointer("waf_debug"), + PublicKey: ToPointer(pgpPublicKey()), + CompressionCodec: ToPointer("snappy"), }) }) if err != nil { @@ -43,20 +43,20 @@ func TestClient_DigitalOceans(t *testing.T) { digitaloceanCreateResp2, err = c.CreateDigitalOcean(&CreateDigitalOceanInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-digitalocean-2"), - BucketName: String("bucket-name"), - Domain: String("fra1.digitaloceanspaces.com"), - AccessKey: String("AKIAIOSFODNN7EXAMPLE"), - SecretKey: String("wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"), - Path: String("/path"), - Period: Int(12), - GzipLevel: Int(8), - Format: String("format"), - FormatVersion: Int(2), - TimestampFormat: String("%Y"), - MessageType: String("classic"), - Placement: String("waf_debug"), - PublicKey: String(pgpPublicKey()), + Name: ToPointer("test-digitalocean-2"), + BucketName: ToPointer("bucket-name"), + Domain: ToPointer("fra1.digitaloceanspaces.com"), + AccessKey: ToPointer("AKIAIOSFODNN7EXAMPLE"), + SecretKey: ToPointer("wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"), + Path: ToPointer("/path"), + Period: ToPointer(12), + GzipLevel: ToPointer(8), + Format: ToPointer("format"), + FormatVersion: ToPointer(2), + TimestampFormat: ToPointer("%Y"), + MessageType: ToPointer("classic"), + Placement: ToPointer("waf_debug"), + PublicKey: ToPointer(pgpPublicKey()), }) }) if err != nil { @@ -67,20 +67,20 @@ func TestClient_DigitalOceans(t *testing.T) { digitaloceanCreateResp3, err = c.CreateDigitalOcean(&CreateDigitalOceanInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-digitalocean-3"), - BucketName: String("bucket-name"), - Domain: String("fra1.digitaloceanspaces.com"), - AccessKey: String("AKIAIOSFODNN7EXAMPLE"), - SecretKey: String("wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"), - Path: String("/path"), - Period: Int(12), - Format: String("format"), - FormatVersion: Int(2), - TimestampFormat: String("%Y"), - MessageType: String("classic"), - Placement: String("waf_debug"), - PublicKey: String(pgpPublicKey()), - CompressionCodec: String("snappy"), + Name: ToPointer("test-digitalocean-3"), + BucketName: ToPointer("bucket-name"), + Domain: ToPointer("fra1.digitaloceanspaces.com"), + AccessKey: ToPointer("AKIAIOSFODNN7EXAMPLE"), + SecretKey: ToPointer("wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"), + Path: ToPointer("/path"), + Period: ToPointer(12), + Format: ToPointer("format"), + FormatVersion: ToPointer(2), + TimestampFormat: ToPointer("%Y"), + MessageType: ToPointer("classic"), + Placement: ToPointer("waf_debug"), + PublicKey: ToPointer(pgpPublicKey()), + CompressionCodec: ToPointer("snappy"), }) }) if err != nil { @@ -93,21 +93,21 @@ func TestClient_DigitalOceans(t *testing.T) { _, err = c.CreateDigitalOcean(&CreateDigitalOceanInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-digitalocean-4"), - BucketName: String("bucket-name"), - Domain: String("fra1.digitaloceanspaces.com"), - AccessKey: String("AKIAIOSFODNN7EXAMPLE"), - SecretKey: String("wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"), - Path: String("/path"), - Period: Int(12), - GzipLevel: Int(8), - Format: String("format"), - FormatVersion: Int(2), - TimestampFormat: String("%Y"), - MessageType: String("classic"), - Placement: String("waf_debug"), - PublicKey: String(pgpPublicKey()), - CompressionCodec: String("snappy"), + Name: ToPointer("test-digitalocean-4"), + BucketName: ToPointer("bucket-name"), + Domain: ToPointer("fra1.digitaloceanspaces.com"), + AccessKey: ToPointer("AKIAIOSFODNN7EXAMPLE"), + SecretKey: ToPointer("wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"), + Path: ToPointer("/path"), + Period: ToPointer(12), + GzipLevel: ToPointer(8), + Format: ToPointer("format"), + FormatVersion: ToPointer(2), + TimestampFormat: ToPointer("%Y"), + MessageType: ToPointer("classic"), + Placement: ToPointer("waf_debug"), + PublicKey: ToPointer(pgpPublicKey()), + CompressionCodec: ToPointer("snappy"), }) }) if err == nil { @@ -277,9 +277,9 @@ func TestClient_DigitalOceans(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-digitalocean", - NewName: String("new-test-digitalocean"), - Domain: String("nyc3.digitaloceanspaces.com"), - CompressionCodec: String("zstd"), + NewName: ToPointer("new-test-digitalocean"), + Domain: ToPointer("nyc3.digitaloceanspaces.com"), + CompressionCodec: ToPointer("zstd"), }) }) if err != nil { @@ -291,7 +291,7 @@ func TestClient_DigitalOceans(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-digitalocean-2", - CompressionCodec: String("zstd"), + CompressionCodec: ToPointer("zstd"), }) }) if err != nil { @@ -303,7 +303,7 @@ func TestClient_DigitalOceans(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-digitalocean-3", - GzipLevel: Int(9), + GzipLevel: ToPointer(9), }) }) if err != nil { diff --git a/fastly/director_test.go b/fastly/director_test.go index e4a4e03f9..ba134fa25 100644 --- a/fastly/director_test.go +++ b/fastly/director_test.go @@ -24,20 +24,20 @@ func TestClient_Directors(t *testing.T) { b, errBackend = c.CreateBackend(&CreateBackendInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-backend"), - Address: String("integ-test.go-fastly.com"), - Port: Int(1234), - ConnectTimeout: Int(1500), - OverrideHost: String("origin.example.com"), - SSLCiphers: String("DHE-RSA-AES256-SHA:DHE-RSA-CAMELLIA256-SHA:AES256-GCM-SHA384"), + Name: ToPointer("test-backend"), + Address: ToPointer("integ-test.go-fastly.com"), + Port: ToPointer(1234), + ConnectTimeout: ToPointer(1500), + OverrideHost: ToPointer("origin.example.com"), + SSLCiphers: ToPointer("DHE-RSA-AES256-SHA:DHE-RSA-CAMELLIA256-SHA:AES256-GCM-SHA384"), }) d, errDirector = c.CreateDirector(&CreateDirectorInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-director"), - Quorum: Int(50), + Name: ToPointer("test-director"), + Quorum: ToPointer(50), Type: DirectorTypePtr(DirectorTypeRandom), - Retries: Int(5), + Retries: ToPointer(5), }) _, errDirectorBackend = c.CreateDirectorBackend(&CreateDirectorBackendInput{ ServiceID: testServiceID, @@ -152,8 +152,8 @@ func TestClient_Directors(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-director", - NewName: String("new-test-director"), - Quorum: Int(100), + NewName: ToPointer("new-test-director"), + Quorum: ToPointer(100), }) }) if err != nil { diff --git a/fastly/domain_test.go b/fastly/domain_test.go index b34ee2c87..efe271143 100644 --- a/fastly/domain_test.go +++ b/fastly/domain_test.go @@ -26,8 +26,8 @@ func TestClient_Domains(t *testing.T) { d, err = c.CreateDomain(&CreateDomainInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String(domain1), - Comment: String("comment"), + Name: ToPointer(domain1), + Comment: ToPointer("comment"), }) }) if err != nil { @@ -39,8 +39,8 @@ func TestClient_Domains(t *testing.T) { d2, err = c.CreateDomain(&CreateDomainInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String(domain2), - Comment: String("comment"), + Name: ToPointer(domain2), + Comment: ToPointer("comment"), }) }) if err != nil { @@ -115,7 +115,7 @@ func TestClient_Domains(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: domain1, - NewName: String(domain3), + NewName: ToPointer(domain3), }) }) if err != nil { diff --git a/fastly/elasticsearch_test.go b/fastly/elasticsearch_test.go index e05e3ed8b..7b81fdba5 100644 --- a/fastly/elasticsearch_test.go +++ b/fastly/elasticsearch_test.go @@ -40,21 +40,21 @@ Wm7DCfrPNGVwFWUQOmsPue9rZBgO es, err = c.CreateElasticsearch(&CreateElasticsearchInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-elasticsearch"), - Format: String("format"), - Index: String("#{%F}"), - URL: String("https://example.com/"), - Pipeline: String("my_pipeline_id"), - User: String("user"), - Password: String("password"), - RequestMaxEntries: Int(1), - RequestMaxBytes: Int(1000), - Placement: String("waf_debug"), - TLSCACert: String(caCert), - TLSClientCert: String(clientCert), - TLSClientKey: String(clientKey), - TLSHostname: String("example.com"), - FormatVersion: Int(2), + Name: ToPointer("test-elasticsearch"), + Format: ToPointer("format"), + Index: ToPointer("#{%F}"), + URL: ToPointer("https://example.com/"), + Pipeline: ToPointer("my_pipeline_id"), + User: ToPointer("user"), + Password: ToPointer("password"), + RequestMaxEntries: ToPointer(1), + RequestMaxBytes: ToPointer(1000), + Placement: ToPointer("waf_debug"), + TLSCACert: ToPointer(caCert), + TLSClientCert: ToPointer(clientCert), + TLSClientKey: ToPointer(clientKey), + TLSHostname: ToPointer("example.com"), + FormatVersion: ToPointer(2), }) }) if err != nil { @@ -205,8 +205,8 @@ Wm7DCfrPNGVwFWUQOmsPue9rZBgO ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-elasticsearch", - NewName: String("new-test-elasticsearch"), - Pipeline: String("my_new_pipeline_id"), + NewName: ToPointer("new-test-elasticsearch"), + Pipeline: ToPointer("my_new_pipeline_id"), }) }) if err != nil { diff --git a/fastly/erl.go b/fastly/erl.go index c3a372bbe..6ec0ecb4c 100644 --- a/fastly/erl.go +++ b/fastly/erl.go @@ -49,11 +49,6 @@ type ERLResponseType struct { // violation is detected. type ERLAction string -// ERLActionPtr is a helper that returns a pointer to the type passed in. -func ERLActionPtr(v ERLAction) *ERLAction { - return &v -} - const ( // ERLActionLogOnly represents an action variant. ERLActionLogOnly ERLAction = "log_only" @@ -73,11 +68,6 @@ var ERLActions = []ERLAction{ // ERLLogger represents the supported log provider variants. type ERLLogger string -// ERLLoggerPtr is a helper that returns a pointer to the type passed in. -func ERLLoggerPtr(v ERLLogger) *ERLLogger { - return &v -} - const ( // ERLLogAzureBlob represents a log provider variant. ERLLogAzureBlob ERLLogger = "azureblob" @@ -176,11 +166,6 @@ var ERLLoggers = []ERLLogger{ // exceeded. type ERLWindowSize int -// ERLWindowSizePtr is a helper that returns a pointer to the type passed in. -func ERLWindowSizePtr(v ERLWindowSize) *ERLWindowSize { - return &v -} - const ( // ERLSize1 represents a duration variant. ERLSize1 ERLWindowSize = 1 diff --git a/fastly/erl_test.go b/fastly/erl_test.go index 83c8b3711..0ffcd3098 100644 --- a/fastly/erl_test.go +++ b/fastly/erl_test.go @@ -20,8 +20,8 @@ func TestClient_ERL(t *testing.T) { e, err = c.CreateERL(&CreateERLInput{ ServiceID: testServiceID, ServiceVersion: testVersion.Number, - Name: String("test_erl"), - Action: ERLActionPtr(ERLActionResponse), + Name: ToPointer("test_erl"), + Action: ToPointer(ERLActionResponse), ClientKey: &[]string{ "req.http.Fastly-Client-IP", }, @@ -29,14 +29,14 @@ func TestClient_ERL(t *testing.T) { http.MethodGet, http.MethodPost, }, - PenaltyBoxDuration: Int(30), + PenaltyBoxDuration: ToPointer(30), Response: &ERLResponseType{ ERLStatus: 429, ERLContentType: "application/json", ERLContent: "Too many requests", }, - RpsLimit: Int(20), - WindowSize: ERLWindowSizePtr(10), + RpsLimit: ToPointer(20), + WindowSize: ToPointer(ERLWindowSize(10)), }) }) if err != nil { @@ -110,7 +110,7 @@ func TestClient_ERL(t *testing.T) { record(t, fixtureBase+"update", func(c *Client) { ua, err = c.UpdateERL(&UpdateERLInput{ ERLID: e.ID, - Name: String("test_erl"), + Name: ToPointer("test_erl"), }) }) if err != nil { @@ -136,10 +136,10 @@ func TestClient_ERL(t *testing.T) { elog, err = c.CreateERL(&CreateERLInput{ ServiceID: testServiceID, ServiceVersion: testVersion.Number, - Name: String("test_erl"), - Action: ERLActionPtr(ERLActionLogOnly), + Name: ToPointer("test_erl"), + Action: ToPointer(ERLActionLogOnly), // IMPORTANT: API will 400 if LoggerType not set with log_only action. - LoggerType: ERLLoggerPtr(ERLLogAzureBlob), + LoggerType: ToPointer(ERLLogAzureBlob), ClientKey: &[]string{ "req.http.Fastly-Client-IP", }, @@ -147,9 +147,9 @@ func TestClient_ERL(t *testing.T) { http.MethodGet, http.MethodPost, }, - PenaltyBoxDuration: Int(30), - RpsLimit: Int(20), - WindowSize: ERLWindowSizePtr(10), + PenaltyBoxDuration: ToPointer(30), + RpsLimit: ToPointer(20), + WindowSize: ToPointer(ERLWindowSize(10)), }) }) if err != nil { diff --git a/fastly/fastly_test.go b/fastly/fastly_test.go index 354dab8df..17857a04e 100644 --- a/fastly/fastly_test.go +++ b/fastly/fastly_test.go @@ -125,9 +125,9 @@ func createTestService(t *testing.T, serviceFixture string, serviceNameSuffix st record(t, serviceFixture, func(client *Client) { service, err = client.CreateService(&CreateServiceInput{ - Name: String(fmt.Sprintf("test_service_%s", serviceNameSuffix)), - Comment: String("go-fastly client test"), - Type: String(ServiceTypeVCL), + Name: ToPointer(fmt.Sprintf("test_service_%s", serviceNameSuffix)), + Comment: ToPointer("go-fastly client test"), + Type: ToPointer(ServiceTypeVCL), }) }) if err != nil { @@ -143,9 +143,9 @@ func createTestServiceWasm(t *testing.T, serviceFixture string, serviceNameSuffi record(t, serviceFixture, func(client *Client) { service, err = client.CreateService(&CreateServiceInput{ - Name: String(fmt.Sprintf("test_service_wasm_%s", serviceNameSuffix)), - Comment: String("go-fastly wasm client test"), - Type: String(ServiceTypeWasm), + Name: ToPointer(fmt.Sprintf("test_service_wasm_%s", serviceNameSuffix)), + Comment: ToPointer("go-fastly wasm client test"), + Type: ToPointer(ServiceTypeWasm), }) }) if err != nil { @@ -196,7 +196,7 @@ func createTestDictionary(t *testing.T, dictionaryFixture string, serviceID stri dictionary, err = client.CreateDictionary(&CreateDictionaryInput{ ServiceID: serviceID, ServiceVersion: version, - Name: String(fmt.Sprintf("test_dictionary_%s", dictionaryNameSuffix)), + Name: ToPointer(fmt.Sprintf("test_dictionary_%s", dictionaryNameSuffix)), }) }) if err != nil { @@ -228,7 +228,7 @@ func createTestACL(t *testing.T, createFixture string, serviceID string, version acl, err = client.CreateACL(&CreateACLInput{ ServiceID: serviceID, ServiceVersion: version, - Name: String(fmt.Sprintf("test_acl_%s", aclNameSuffix)), + Name: ToPointer(fmt.Sprintf("test_acl_%s", aclNameSuffix)), }) }) if err != nil { @@ -260,7 +260,7 @@ func createTestPool(t *testing.T, createFixture string, serviceID string, versio pool, err = client.CreatePool(&CreatePoolInput{ ServiceID: serviceID, ServiceVersion: version, - Name: String(fmt.Sprintf("test_pool_%s", poolNameSuffix)), + Name: ToPointer(fmt.Sprintf("test_pool_%s", poolNameSuffix)), }) }) if err != nil { @@ -277,14 +277,14 @@ func createTestLogging(t *testing.T, fixture, serviceID string, serviceNumber in log, err = c.CreateSyslog(&CreateSyslogInput{ ServiceID: serviceID, ServiceVersion: serviceNumber, - Name: String("test-syslog"), - Address: String("example.com"), - Hostname: String("example.com"), - Port: Int(1234), - Token: String("abcd1234"), - Format: String("format"), - FormatVersion: Int(2), - MessageType: String("classic"), + Name: ToPointer("test-syslog"), + Address: ToPointer("example.com"), + Hostname: ToPointer("example.com"), + Port: ToPointer(1234), + Token: ToPointer("abcd1234"), + Format: ToPointer("format"), + FormatVersion: ToPointer(2), + MessageType: ToPointer("classic"), }) }) if err != nil { @@ -332,10 +332,10 @@ func createTestWAFCondition(t *testing.T, fixture, serviceID, name string, servi condition, err = c.CreateCondition(&CreateConditionInput{ ServiceID: serviceID, ServiceVersion: serviceNumber, - Name: String(name), - Statement: String("req.url~+\"index.html\""), - Type: String("PREFETCH"), // This must be a prefetch condition - Priority: Int(1), + Name: ToPointer(name), + Statement: ToPointer("req.url~+\"index.html\""), + Type: ToPointer("PREFETCH"), // This must be a prefetch condition + Priority: ToPointer(1), }) }) if err != nil { @@ -367,8 +367,8 @@ func createTestWAFResponseObject(t *testing.T, fixture, serviceID, name string, ro, err = c.CreateResponseObject(&CreateResponseObjectInput{ ServiceID: serviceID, ServiceVersion: serviceNumber, - Name: String(name), - Status: Int(403), + Name: ToPointer(name), + Status: ToPointer(403), }) }) if err != nil { diff --git a/fastly/ftp_test.go b/fastly/ftp_test.go index 59c22262f..85e64b302 100644 --- a/fastly/ftp_test.go +++ b/fastly/ftp_test.go @@ -18,20 +18,20 @@ func TestClient_FTPs(t *testing.T) { ftpCreateResp1, err = c.CreateFTP(&CreateFTPInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-ftp"), - Address: String("example.com"), - Port: Int(1234), - PublicKey: String(pgpPublicKey()), - Username: String("username"), - Password: String("password"), - Path: String("/dir"), - Period: Int(12), - CompressionCodec: String("snappy"), - FormatVersion: Int(2), - Format: String("format"), - TimestampFormat: String("%Y"), - Placement: String("waf_debug"), - MessageType: String("classic"), + Name: ToPointer("test-ftp"), + Address: ToPointer("example.com"), + Port: ToPointer(1234), + PublicKey: ToPointer(pgpPublicKey()), + Username: ToPointer("username"), + Password: ToPointer("password"), + Path: ToPointer("/dir"), + Period: ToPointer(12), + CompressionCodec: ToPointer("snappy"), + FormatVersion: ToPointer(2), + Format: ToPointer("format"), + TimestampFormat: ToPointer("%Y"), + Placement: ToPointer("waf_debug"), + MessageType: ToPointer("classic"), }) }) if err != nil { @@ -42,20 +42,20 @@ func TestClient_FTPs(t *testing.T) { ftpCreateResp2, err = c.CreateFTP(&CreateFTPInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-ftp-2"), - Address: String("example.com"), - Port: Int(1234), - PublicKey: String(pgpPublicKey()), - Username: String("username"), - Password: String("password"), - Path: String("/dir"), - Period: Int(12), - GzipLevel: Int(8), - FormatVersion: Int(2), - Format: String("format"), - TimestampFormat: String("%Y"), - Placement: String("waf_debug"), - MessageType: String("classic"), + Name: ToPointer("test-ftp-2"), + Address: ToPointer("example.com"), + Port: ToPointer(1234), + PublicKey: ToPointer(pgpPublicKey()), + Username: ToPointer("username"), + Password: ToPointer("password"), + Path: ToPointer("/dir"), + Period: ToPointer(12), + GzipLevel: ToPointer(8), + FormatVersion: ToPointer(2), + Format: ToPointer("format"), + TimestampFormat: ToPointer("%Y"), + Placement: ToPointer("waf_debug"), + MessageType: ToPointer("classic"), }) }) if err != nil { @@ -66,20 +66,20 @@ func TestClient_FTPs(t *testing.T) { ftpCreateResp3, err = c.CreateFTP(&CreateFTPInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-ftp-3"), - Address: String("example.com"), - Port: Int(1234), - PublicKey: String(pgpPublicKey()), - Username: String("username"), - Password: String("password"), - Path: String("/dir"), - Period: Int(12), - CompressionCodec: String("snappy"), - FormatVersion: Int(2), - Format: String("format"), - TimestampFormat: String("%Y"), - Placement: String("waf_debug"), - MessageType: String("classic"), + Name: ToPointer("test-ftp-3"), + Address: ToPointer("example.com"), + Port: ToPointer(1234), + PublicKey: ToPointer(pgpPublicKey()), + Username: ToPointer("username"), + Password: ToPointer("password"), + Path: ToPointer("/dir"), + Period: ToPointer(12), + CompressionCodec: ToPointer("snappy"), + FormatVersion: ToPointer(2), + Format: ToPointer("format"), + TimestampFormat: ToPointer("%Y"), + Placement: ToPointer("waf_debug"), + MessageType: ToPointer("classic"), }) }) if err != nil { @@ -92,21 +92,21 @@ func TestClient_FTPs(t *testing.T) { _, err = c.CreateFTP(&CreateFTPInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-ftp-4"), - Address: String("example.com"), - Port: Int(1234), - PublicKey: String(pgpPublicKey()), - Username: String("username"), - Password: String("password"), - Path: String("/dir"), - Period: Int(12), - CompressionCodec: String("snappy"), - GzipLevel: Int(8), - FormatVersion: Int(2), - Format: String("format"), - TimestampFormat: String("%Y"), - Placement: String("waf_debug"), - MessageType: String("classic"), + Name: ToPointer("test-ftp-4"), + Address: ToPointer("example.com"), + Port: ToPointer(1234), + PublicKey: ToPointer(pgpPublicKey()), + Username: ToPointer("username"), + Password: ToPointer("password"), + Path: ToPointer("/dir"), + Period: ToPointer(12), + CompressionCodec: ToPointer("snappy"), + GzipLevel: ToPointer(8), + FormatVersion: ToPointer(2), + Format: ToPointer("format"), + TimestampFormat: ToPointer("%Y"), + Placement: ToPointer("waf_debug"), + MessageType: ToPointer("classic"), }) }) if err == nil { @@ -282,8 +282,8 @@ func TestClient_FTPs(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-ftp", - NewName: String("new-test-ftp"), - CompressionCodec: String("zstd"), + NewName: ToPointer("new-test-ftp"), + CompressionCodec: ToPointer("zstd"), }) }) if err != nil { @@ -295,7 +295,7 @@ func TestClient_FTPs(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-ftp-2", - CompressionCodec: String("zstd"), + CompressionCodec: ToPointer("zstd"), }) }) if err != nil { @@ -307,7 +307,7 @@ func TestClient_FTPs(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-ftp-3", - GzipLevel: Int(9), + GzipLevel: ToPointer(9), }) }) if err != nil { diff --git a/fastly/gcs_test.go b/fastly/gcs_test.go index 742ce507f..6e5090e03 100644 --- a/fastly/gcs_test.go +++ b/fastly/gcs_test.go @@ -19,20 +19,20 @@ func TestClient_GCSs(t *testing.T) { gcsCreateResp1, err = c.CreateGCS(&CreateGCSInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-gcs"), - ProjectID: String("logging-project"), - Bucket: String("bucket"), - User: String("user"), - AccountName: String("service-account"), - SecretKey: String("-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC9aQoqdHVA86oq\nTdRQ5HqwMfpiLBBMKNQcAJsO71RKNrDWwJJZiyYbvM4FOWRZFtRSdPIDgX0C0Wg1\nNnqWYvHDyA5Ug+T8kowiQDn56dU6Km2FWO4wnqZeA8q5G7rQVXlqdibuiP7FglHA\neURUzFsqyymXMUGrqDPqrHsVWC2E3NTJEb4QlywtrwI13qbhlvTx6/9oRfUjytXJ\nRuUIE5xL8yhRCagNr5ZW250aa+wBwu5DSCk5fDNr0eDuZjw84WHDll+mHxBFGV+X\nKJ5jCOmGumGqjVWZesJpNN1My3M9bsY9layNJJ0eiDeHDEi/yXhhO/mNEXhvhq/R\nfN0Jh2A3AgMBAAECggEAef+CEL5aF6/aVs0yh7fiXkKSp1ECXkud8ztgpEn63KJF\nXM1EdnBt50fA2xSQUeGmeEXi6+cngf0nRb8FToAEgLoGoOEjSJuLrzP3I8U9Fe3m\nBRG2uZI2Ti/bD0eRGEc1oSDhCpsqnkTGK1bwcD4AKpwY+c08Izh/2BOoY6McDoqh\ndQ89jzTuMtD4cNlnPiIrY9HbxoNjshK2ax1OaeXyYKZFG1TxqMFv5gA/G5+S3Cwr\nVG4fkAxYi5vdIK3b8jUXrTM/kpoTl+d3dlQ7rRZYf7KyT31/HtJ/GNzxFI6upzO7\niDNrrUOyeOPjWXdzUh9budv3j+6UfbYK7uZIoebHIQKBgQDykYX1L/akGaOC2tfS\njzCWUzPxGFYVZQ7zD1PM6UyouuS1KLURDEGk9RxqVzTPh/pYd8Ivnz3vOVski5Zt\n19ozLGxdtDhn122DcnVpfCdYzHBdAzPCzORenFohX+MhiX5fEotTlVi7wfOmzTP5\nhUCMSd/17bJrV4XMLhkdrMRBFQKBgQDH5fwV7o+Ej/ZfcdGIa3mAFazToPDzxhHU\nnwADxaxpNGKRU03XCaiYkykarLYdG6Rk+7dXUv8eLy+6Dcq1SWQtfCWKEor++IIp\n1RwWmFHfYriHGkmxSkkEkLFvL8old9xM5YWbEXc4QIXvnfR4BZxdyJHVzIDdbI2i\nFgcn17U3GwKBgDd1njMY7ENIuWHJt16k7m7wRwfwkH4DxQ89ieNn0+cgE/p3fC6R\nptCYWg7WMXThmhNwDi3lMrvnWTdZ0uL6XyEkHwKtmdfkIV3UZZPglv5uf6JEgSkg\nv3YCOXk3+y5HyWTjUIejtc334kVY1XFPThrFKTeJSSnRsP2l7IgkYBqhAoGAYGsr\nM3z1FrDF2nWw5odIfKJ30UAw2LRyB0eGH0uqhLgyzvwKcK2E98sLqYUi9llN6zOK\n1IEA8xM5hxl97AFxY4sdJEMbbi55wim7uZ5Q51nbvbbNUsmM/Lm6C/JWI8pzpVeU\nIR7EjYp50AE1WOsD6CyFQ0W35pWkn0jWvL4L938CgYEAlax4dLE5+YCG5DeLT1/N\nin6kQjl7JS4oCNlPEj6aRPLX2OJresI7oOn+uNatKvlVyfPm6rdxeHCmER1FpR7Q\nA/aNVjPeViKT/R4nK9ytsa+s/1IJVrwLFHJK3toGE660g5w3vKrCjWisMdP4yzzQ\nbv1KwcKoQbNVXwauH79JKc0=\n-----END PRIVATE KEY-----\n"), - Path: String("/path"), - Period: Int(12), - CompressionCodec: String("snappy"), - FormatVersion: Int(2), - Format: String("format"), - MessageType: String("blank"), - TimestampFormat: String("%Y"), - Placement: String("waf_debug"), + Name: ToPointer("test-gcs"), + ProjectID: ToPointer("logging-project"), + Bucket: ToPointer("bucket"), + User: ToPointer("user"), + AccountName: ToPointer("service-account"), + SecretKey: ToPointer("-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC9aQoqdHVA86oq\nTdRQ5HqwMfpiLBBMKNQcAJsO71RKNrDWwJJZiyYbvM4FOWRZFtRSdPIDgX0C0Wg1\nNnqWYvHDyA5Ug+T8kowiQDn56dU6Km2FWO4wnqZeA8q5G7rQVXlqdibuiP7FglHA\neURUzFsqyymXMUGrqDPqrHsVWC2E3NTJEb4QlywtrwI13qbhlvTx6/9oRfUjytXJ\nRuUIE5xL8yhRCagNr5ZW250aa+wBwu5DSCk5fDNr0eDuZjw84WHDll+mHxBFGV+X\nKJ5jCOmGumGqjVWZesJpNN1My3M9bsY9layNJJ0eiDeHDEi/yXhhO/mNEXhvhq/R\nfN0Jh2A3AgMBAAECggEAef+CEL5aF6/aVs0yh7fiXkKSp1ECXkud8ztgpEn63KJF\nXM1EdnBt50fA2xSQUeGmeEXi6+cngf0nRb8FToAEgLoGoOEjSJuLrzP3I8U9Fe3m\nBRG2uZI2Ti/bD0eRGEc1oSDhCpsqnkTGK1bwcD4AKpwY+c08Izh/2BOoY6McDoqh\ndQ89jzTuMtD4cNlnPiIrY9HbxoNjshK2ax1OaeXyYKZFG1TxqMFv5gA/G5+S3Cwr\nVG4fkAxYi5vdIK3b8jUXrTM/kpoTl+d3dlQ7rRZYf7KyT31/HtJ/GNzxFI6upzO7\niDNrrUOyeOPjWXdzUh9budv3j+6UfbYK7uZIoebHIQKBgQDykYX1L/akGaOC2tfS\njzCWUzPxGFYVZQ7zD1PM6UyouuS1KLURDEGk9RxqVzTPh/pYd8Ivnz3vOVski5Zt\n19ozLGxdtDhn122DcnVpfCdYzHBdAzPCzORenFohX+MhiX5fEotTlVi7wfOmzTP5\nhUCMSd/17bJrV4XMLhkdrMRBFQKBgQDH5fwV7o+Ej/ZfcdGIa3mAFazToPDzxhHU\nnwADxaxpNGKRU03XCaiYkykarLYdG6Rk+7dXUv8eLy+6Dcq1SWQtfCWKEor++IIp\n1RwWmFHfYriHGkmxSkkEkLFvL8old9xM5YWbEXc4QIXvnfR4BZxdyJHVzIDdbI2i\nFgcn17U3GwKBgDd1njMY7ENIuWHJt16k7m7wRwfwkH4DxQ89ieNn0+cgE/p3fC6R\nptCYWg7WMXThmhNwDi3lMrvnWTdZ0uL6XyEkHwKtmdfkIV3UZZPglv5uf6JEgSkg\nv3YCOXk3+y5HyWTjUIejtc334kVY1XFPThrFKTeJSSnRsP2l7IgkYBqhAoGAYGsr\nM3z1FrDF2nWw5odIfKJ30UAw2LRyB0eGH0uqhLgyzvwKcK2E98sLqYUi9llN6zOK\n1IEA8xM5hxl97AFxY4sdJEMbbi55wim7uZ5Q51nbvbbNUsmM/Lm6C/JWI8pzpVeU\nIR7EjYp50AE1WOsD6CyFQ0W35pWkn0jWvL4L938CgYEAlax4dLE5+YCG5DeLT1/N\nin6kQjl7JS4oCNlPEj6aRPLX2OJresI7oOn+uNatKvlVyfPm6rdxeHCmER1FpR7Q\nA/aNVjPeViKT/R4nK9ytsa+s/1IJVrwLFHJK3toGE660g5w3vKrCjWisMdP4yzzQ\nbv1KwcKoQbNVXwauH79JKc0=\n-----END PRIVATE KEY-----\n"), + Path: ToPointer("/path"), + Period: ToPointer(12), + CompressionCodec: ToPointer("snappy"), + FormatVersion: ToPointer(2), + Format: ToPointer("format"), + MessageType: ToPointer("blank"), + TimestampFormat: ToPointer("%Y"), + Placement: ToPointer("waf_debug"), }) }) if err != nil { @@ -43,19 +43,19 @@ func TestClient_GCSs(t *testing.T) { gcsCreateResp2, err = c.CreateGCS(&CreateGCSInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-gcs-2"), - ProjectID: String("logging-project"), - Bucket: String("bucket"), - User: String("user"), - SecretKey: String("-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC9aQoqdHVA86oq\nTdRQ5HqwMfpiLBBMKNQcAJsO71RKNrDWwJJZiyYbvM4FOWRZFtRSdPIDgX0C0Wg1\nNnqWYvHDyA5Ug+T8kowiQDn56dU6Km2FWO4wnqZeA8q5G7rQVXlqdibuiP7FglHA\neURUzFsqyymXMUGrqDPqrHsVWC2E3NTJEb4QlywtrwI13qbhlvTx6/9oRfUjytXJ\nRuUIE5xL8yhRCagNr5ZW250aa+wBwu5DSCk5fDNr0eDuZjw84WHDll+mHxBFGV+X\nKJ5jCOmGumGqjVWZesJpNN1My3M9bsY9layNJJ0eiDeHDEi/yXhhO/mNEXhvhq/R\nfN0Jh2A3AgMBAAECggEAef+CEL5aF6/aVs0yh7fiXkKSp1ECXkud8ztgpEn63KJF\nXM1EdnBt50fA2xSQUeGmeEXi6+cngf0nRb8FToAEgLoGoOEjSJuLrzP3I8U9Fe3m\nBRG2uZI2Ti/bD0eRGEc1oSDhCpsqnkTGK1bwcD4AKpwY+c08Izh/2BOoY6McDoqh\ndQ89jzTuMtD4cNlnPiIrY9HbxoNjshK2ax1OaeXyYKZFG1TxqMFv5gA/G5+S3Cwr\nVG4fkAxYi5vdIK3b8jUXrTM/kpoTl+d3dlQ7rRZYf7KyT31/HtJ/GNzxFI6upzO7\niDNrrUOyeOPjWXdzUh9budv3j+6UfbYK7uZIoebHIQKBgQDykYX1L/akGaOC2tfS\njzCWUzPxGFYVZQ7zD1PM6UyouuS1KLURDEGk9RxqVzTPh/pYd8Ivnz3vOVski5Zt\n19ozLGxdtDhn122DcnVpfCdYzHBdAzPCzORenFohX+MhiX5fEotTlVi7wfOmzTP5\nhUCMSd/17bJrV4XMLhkdrMRBFQKBgQDH5fwV7o+Ej/ZfcdGIa3mAFazToPDzxhHU\nnwADxaxpNGKRU03XCaiYkykarLYdG6Rk+7dXUv8eLy+6Dcq1SWQtfCWKEor++IIp\n1RwWmFHfYriHGkmxSkkEkLFvL8old9xM5YWbEXc4QIXvnfR4BZxdyJHVzIDdbI2i\nFgcn17U3GwKBgDd1njMY7ENIuWHJt16k7m7wRwfwkH4DxQ89ieNn0+cgE/p3fC6R\nptCYWg7WMXThmhNwDi3lMrvnWTdZ0uL6XyEkHwKtmdfkIV3UZZPglv5uf6JEgSkg\nv3YCOXk3+y5HyWTjUIejtc334kVY1XFPThrFKTeJSSnRsP2l7IgkYBqhAoGAYGsr\nM3z1FrDF2nWw5odIfKJ30UAw2LRyB0eGH0uqhLgyzvwKcK2E98sLqYUi9llN6zOK\n1IEA8xM5hxl97AFxY4sdJEMbbi55wim7uZ5Q51nbvbbNUsmM/Lm6C/JWI8pzpVeU\nIR7EjYp50AE1WOsD6CyFQ0W35pWkn0jWvL4L938CgYEAlax4dLE5+YCG5DeLT1/N\nin6kQjl7JS4oCNlPEj6aRPLX2OJresI7oOn+uNatKvlVyfPm6rdxeHCmER1FpR7Q\nA/aNVjPeViKT/R4nK9ytsa+s/1IJVrwLFHJK3toGE660g5w3vKrCjWisMdP4yzzQ\nbv1KwcKoQbNVXwauH79JKc0=\n-----END PRIVATE KEY-----\n"), - Path: String("/path"), - Period: Int(12), - GzipLevel: Int(8), - FormatVersion: Int(2), - Format: String("format"), - MessageType: String("blank"), - TimestampFormat: String("%Y"), - Placement: String("waf_debug"), + Name: ToPointer("test-gcs-2"), + ProjectID: ToPointer("logging-project"), + Bucket: ToPointer("bucket"), + User: ToPointer("user"), + SecretKey: ToPointer("-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC9aQoqdHVA86oq\nTdRQ5HqwMfpiLBBMKNQcAJsO71RKNrDWwJJZiyYbvM4FOWRZFtRSdPIDgX0C0Wg1\nNnqWYvHDyA5Ug+T8kowiQDn56dU6Km2FWO4wnqZeA8q5G7rQVXlqdibuiP7FglHA\neURUzFsqyymXMUGrqDPqrHsVWC2E3NTJEb4QlywtrwI13qbhlvTx6/9oRfUjytXJ\nRuUIE5xL8yhRCagNr5ZW250aa+wBwu5DSCk5fDNr0eDuZjw84WHDll+mHxBFGV+X\nKJ5jCOmGumGqjVWZesJpNN1My3M9bsY9layNJJ0eiDeHDEi/yXhhO/mNEXhvhq/R\nfN0Jh2A3AgMBAAECggEAef+CEL5aF6/aVs0yh7fiXkKSp1ECXkud8ztgpEn63KJF\nXM1EdnBt50fA2xSQUeGmeEXi6+cngf0nRb8FToAEgLoGoOEjSJuLrzP3I8U9Fe3m\nBRG2uZI2Ti/bD0eRGEc1oSDhCpsqnkTGK1bwcD4AKpwY+c08Izh/2BOoY6McDoqh\ndQ89jzTuMtD4cNlnPiIrY9HbxoNjshK2ax1OaeXyYKZFG1TxqMFv5gA/G5+S3Cwr\nVG4fkAxYi5vdIK3b8jUXrTM/kpoTl+d3dlQ7rRZYf7KyT31/HtJ/GNzxFI6upzO7\niDNrrUOyeOPjWXdzUh9budv3j+6UfbYK7uZIoebHIQKBgQDykYX1L/akGaOC2tfS\njzCWUzPxGFYVZQ7zD1PM6UyouuS1KLURDEGk9RxqVzTPh/pYd8Ivnz3vOVski5Zt\n19ozLGxdtDhn122DcnVpfCdYzHBdAzPCzORenFohX+MhiX5fEotTlVi7wfOmzTP5\nhUCMSd/17bJrV4XMLhkdrMRBFQKBgQDH5fwV7o+Ej/ZfcdGIa3mAFazToPDzxhHU\nnwADxaxpNGKRU03XCaiYkykarLYdG6Rk+7dXUv8eLy+6Dcq1SWQtfCWKEor++IIp\n1RwWmFHfYriHGkmxSkkEkLFvL8old9xM5YWbEXc4QIXvnfR4BZxdyJHVzIDdbI2i\nFgcn17U3GwKBgDd1njMY7ENIuWHJt16k7m7wRwfwkH4DxQ89ieNn0+cgE/p3fC6R\nptCYWg7WMXThmhNwDi3lMrvnWTdZ0uL6XyEkHwKtmdfkIV3UZZPglv5uf6JEgSkg\nv3YCOXk3+y5HyWTjUIejtc334kVY1XFPThrFKTeJSSnRsP2l7IgkYBqhAoGAYGsr\nM3z1FrDF2nWw5odIfKJ30UAw2LRyB0eGH0uqhLgyzvwKcK2E98sLqYUi9llN6zOK\n1IEA8xM5hxl97AFxY4sdJEMbbi55wim7uZ5Q51nbvbbNUsmM/Lm6C/JWI8pzpVeU\nIR7EjYp50AE1WOsD6CyFQ0W35pWkn0jWvL4L938CgYEAlax4dLE5+YCG5DeLT1/N\nin6kQjl7JS4oCNlPEj6aRPLX2OJresI7oOn+uNatKvlVyfPm6rdxeHCmER1FpR7Q\nA/aNVjPeViKT/R4nK9ytsa+s/1IJVrwLFHJK3toGE660g5w3vKrCjWisMdP4yzzQ\nbv1KwcKoQbNVXwauH79JKc0=\n-----END PRIVATE KEY-----\n"), + Path: ToPointer("/path"), + Period: ToPointer(12), + GzipLevel: ToPointer(8), + FormatVersion: ToPointer(2), + Format: ToPointer("format"), + MessageType: ToPointer("blank"), + TimestampFormat: ToPointer("%Y"), + Placement: ToPointer("waf_debug"), }) }) if err != nil { @@ -66,19 +66,19 @@ func TestClient_GCSs(t *testing.T) { gcsCreateResp3, err = c.CreateGCS(&CreateGCSInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-gcs-3"), - ProjectID: String("logging-project"), - Bucket: String("bucket"), - User: String("user"), - SecretKey: String("-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC9aQoqdHVA86oq\nTdRQ5HqwMfpiLBBMKNQcAJsO71RKNrDWwJJZiyYbvM4FOWRZFtRSdPIDgX0C0Wg1\nNnqWYvHDyA5Ug+T8kowiQDn56dU6Km2FWO4wnqZeA8q5G7rQVXlqdibuiP7FglHA\neURUzFsqyymXMUGrqDPqrHsVWC2E3NTJEb4QlywtrwI13qbhlvTx6/9oRfUjytXJ\nRuUIE5xL8yhRCagNr5ZW250aa+wBwu5DSCk5fDNr0eDuZjw84WHDll+mHxBFGV+X\nKJ5jCOmGumGqjVWZesJpNN1My3M9bsY9layNJJ0eiDeHDEi/yXhhO/mNEXhvhq/R\nfN0Jh2A3AgMBAAECggEAef+CEL5aF6/aVs0yh7fiXkKSp1ECXkud8ztgpEn63KJF\nXM1EdnBt50fA2xSQUeGmeEXi6+cngf0nRb8FToAEgLoGoOEjSJuLrzP3I8U9Fe3m\nBRG2uZI2Ti/bD0eRGEc1oSDhCpsqnkTGK1bwcD4AKpwY+c08Izh/2BOoY6McDoqh\ndQ89jzTuMtD4cNlnPiIrY9HbxoNjshK2ax1OaeXyYKZFG1TxqMFv5gA/G5+S3Cwr\nVG4fkAxYi5vdIK3b8jUXrTM/kpoTl+d3dlQ7rRZYf7KyT31/HtJ/GNzxFI6upzO7\niDNrrUOyeOPjWXdzUh9budv3j+6UfbYK7uZIoebHIQKBgQDykYX1L/akGaOC2tfS\njzCWUzPxGFYVZQ7zD1PM6UyouuS1KLURDEGk9RxqVzTPh/pYd8Ivnz3vOVski5Zt\n19ozLGxdtDhn122DcnVpfCdYzHBdAzPCzORenFohX+MhiX5fEotTlVi7wfOmzTP5\nhUCMSd/17bJrV4XMLhkdrMRBFQKBgQDH5fwV7o+Ej/ZfcdGIa3mAFazToPDzxhHU\nnwADxaxpNGKRU03XCaiYkykarLYdG6Rk+7dXUv8eLy+6Dcq1SWQtfCWKEor++IIp\n1RwWmFHfYriHGkmxSkkEkLFvL8old9xM5YWbEXc4QIXvnfR4BZxdyJHVzIDdbI2i\nFgcn17U3GwKBgDd1njMY7ENIuWHJt16k7m7wRwfwkH4DxQ89ieNn0+cgE/p3fC6R\nptCYWg7WMXThmhNwDi3lMrvnWTdZ0uL6XyEkHwKtmdfkIV3UZZPglv5uf6JEgSkg\nv3YCOXk3+y5HyWTjUIejtc334kVY1XFPThrFKTeJSSnRsP2l7IgkYBqhAoGAYGsr\nM3z1FrDF2nWw5odIfKJ30UAw2LRyB0eGH0uqhLgyzvwKcK2E98sLqYUi9llN6zOK\n1IEA8xM5hxl97AFxY4sdJEMbbi55wim7uZ5Q51nbvbbNUsmM/Lm6C/JWI8pzpVeU\nIR7EjYp50AE1WOsD6CyFQ0W35pWkn0jWvL4L938CgYEAlax4dLE5+YCG5DeLT1/N\nin6kQjl7JS4oCNlPEj6aRPLX2OJresI7oOn+uNatKvlVyfPm6rdxeHCmER1FpR7Q\nA/aNVjPeViKT/R4nK9ytsa+s/1IJVrwLFHJK3toGE660g5w3vKrCjWisMdP4yzzQ\nbv1KwcKoQbNVXwauH79JKc0=\n-----END PRIVATE KEY-----\n"), - Path: String("/path"), - Period: Int(12), - CompressionCodec: String("snappy"), - FormatVersion: Int(2), - Format: String("format"), - MessageType: String("blank"), - TimestampFormat: String("%Y"), - Placement: String("waf_debug"), + Name: ToPointer("test-gcs-3"), + ProjectID: ToPointer("logging-project"), + Bucket: ToPointer("bucket"), + User: ToPointer("user"), + SecretKey: ToPointer("-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC9aQoqdHVA86oq\nTdRQ5HqwMfpiLBBMKNQcAJsO71RKNrDWwJJZiyYbvM4FOWRZFtRSdPIDgX0C0Wg1\nNnqWYvHDyA5Ug+T8kowiQDn56dU6Km2FWO4wnqZeA8q5G7rQVXlqdibuiP7FglHA\neURUzFsqyymXMUGrqDPqrHsVWC2E3NTJEb4QlywtrwI13qbhlvTx6/9oRfUjytXJ\nRuUIE5xL8yhRCagNr5ZW250aa+wBwu5DSCk5fDNr0eDuZjw84WHDll+mHxBFGV+X\nKJ5jCOmGumGqjVWZesJpNN1My3M9bsY9layNJJ0eiDeHDEi/yXhhO/mNEXhvhq/R\nfN0Jh2A3AgMBAAECggEAef+CEL5aF6/aVs0yh7fiXkKSp1ECXkud8ztgpEn63KJF\nXM1EdnBt50fA2xSQUeGmeEXi6+cngf0nRb8FToAEgLoGoOEjSJuLrzP3I8U9Fe3m\nBRG2uZI2Ti/bD0eRGEc1oSDhCpsqnkTGK1bwcD4AKpwY+c08Izh/2BOoY6McDoqh\ndQ89jzTuMtD4cNlnPiIrY9HbxoNjshK2ax1OaeXyYKZFG1TxqMFv5gA/G5+S3Cwr\nVG4fkAxYi5vdIK3b8jUXrTM/kpoTl+d3dlQ7rRZYf7KyT31/HtJ/GNzxFI6upzO7\niDNrrUOyeOPjWXdzUh9budv3j+6UfbYK7uZIoebHIQKBgQDykYX1L/akGaOC2tfS\njzCWUzPxGFYVZQ7zD1PM6UyouuS1KLURDEGk9RxqVzTPh/pYd8Ivnz3vOVski5Zt\n19ozLGxdtDhn122DcnVpfCdYzHBdAzPCzORenFohX+MhiX5fEotTlVi7wfOmzTP5\nhUCMSd/17bJrV4XMLhkdrMRBFQKBgQDH5fwV7o+Ej/ZfcdGIa3mAFazToPDzxhHU\nnwADxaxpNGKRU03XCaiYkykarLYdG6Rk+7dXUv8eLy+6Dcq1SWQtfCWKEor++IIp\n1RwWmFHfYriHGkmxSkkEkLFvL8old9xM5YWbEXc4QIXvnfR4BZxdyJHVzIDdbI2i\nFgcn17U3GwKBgDd1njMY7ENIuWHJt16k7m7wRwfwkH4DxQ89ieNn0+cgE/p3fC6R\nptCYWg7WMXThmhNwDi3lMrvnWTdZ0uL6XyEkHwKtmdfkIV3UZZPglv5uf6JEgSkg\nv3YCOXk3+y5HyWTjUIejtc334kVY1XFPThrFKTeJSSnRsP2l7IgkYBqhAoGAYGsr\nM3z1FrDF2nWw5odIfKJ30UAw2LRyB0eGH0uqhLgyzvwKcK2E98sLqYUi9llN6zOK\n1IEA8xM5hxl97AFxY4sdJEMbbi55wim7uZ5Q51nbvbbNUsmM/Lm6C/JWI8pzpVeU\nIR7EjYp50AE1WOsD6CyFQ0W35pWkn0jWvL4L938CgYEAlax4dLE5+YCG5DeLT1/N\nin6kQjl7JS4oCNlPEj6aRPLX2OJresI7oOn+uNatKvlVyfPm6rdxeHCmER1FpR7Q\nA/aNVjPeViKT/R4nK9ytsa+s/1IJVrwLFHJK3toGE660g5w3vKrCjWisMdP4yzzQ\nbv1KwcKoQbNVXwauH79JKc0=\n-----END PRIVATE KEY-----\n"), + Path: ToPointer("/path"), + Period: ToPointer(12), + CompressionCodec: ToPointer("snappy"), + FormatVersion: ToPointer(2), + Format: ToPointer("format"), + MessageType: ToPointer("blank"), + TimestampFormat: ToPointer("%Y"), + Placement: ToPointer("waf_debug"), }) }) if err != nil { @@ -91,20 +91,20 @@ func TestClient_GCSs(t *testing.T) { _, err = c.CreateGCS(&CreateGCSInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-gcs-4"), - ProjectID: String("logging-project"), - Bucket: String("bucket"), - User: String("user"), - SecretKey: String("-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC9aQoqdHVA86oq\nTdRQ5HqwMfpiLBBMKNQcAJsO71RKNrDWwJJZiyYbvM4FOWRZFtRSdPIDgX0C0Wg1\nNnqWYvHDyA5Ug+T8kowiQDn56dU6Km2FWO4wnqZeA8q5G7rQVXlqdibuiP7FglHA\neURUzFsqyymXMUGrqDPqrHsVWC2E3NTJEb4QlywtrwI13qbhlvTx6/9oRfUjytXJ\nRuUIE5xL8yhRCagNr5ZW250aa+wBwu5DSCk5fDNr0eDuZjw84WHDll+mHxBFGV+X\nKJ5jCOmGumGqjVWZesJpNN1My3M9bsY9layNJJ0eiDeHDEi/yXhhO/mNEXhvhq/R\nfN0Jh2A3AgMBAAECggEAef+CEL5aF6/aVs0yh7fiXkKSp1ECXkud8ztgpEn63KJF\nXM1EdnBt50fA2xSQUeGmeEXi6+cngf0nRb8FToAEgLoGoOEjSJuLrzP3I8U9Fe3m\nBRG2uZI2Ti/bD0eRGEc1oSDhCpsqnkTGK1bwcD4AKpwY+c08Izh/2BOoY6McDoqh\ndQ89jzTuMtD4cNlnPiIrY9HbxoNjshK2ax1OaeXyYKZFG1TxqMFv5gA/G5+S3Cwr\nVG4fkAxYi5vdIK3b8jUXrTM/kpoTl+d3dlQ7rRZYf7KyT31/HtJ/GNzxFI6upzO7\niDNrrUOyeOPjWXdzUh9budv3j+6UfbYK7uZIoebHIQKBgQDykYX1L/akGaOC2tfS\njzCWUzPxGFYVZQ7zD1PM6UyouuS1KLURDEGk9RxqVzTPh/pYd8Ivnz3vOVski5Zt\n19ozLGxdtDhn122DcnVpfCdYzHBdAzPCzORenFohX+MhiX5fEotTlVi7wfOmzTP5\nhUCMSd/17bJrV4XMLhkdrMRBFQKBgQDH5fwV7o+Ej/ZfcdGIa3mAFazToPDzxhHU\nnwADxaxpNGKRU03XCaiYkykarLYdG6Rk+7dXUv8eLy+6Dcq1SWQtfCWKEor++IIp\n1RwWmFHfYriHGkmxSkkEkLFvL8old9xM5YWbEXc4QIXvnfR4BZxdyJHVzIDdbI2i\nFgcn17U3GwKBgDd1njMY7ENIuWHJt16k7m7wRwfwkH4DxQ89ieNn0+cgE/p3fC6R\nptCYWg7WMXThmhNwDi3lMrvnWTdZ0uL6XyEkHwKtmdfkIV3UZZPglv5uf6JEgSkg\nv3YCOXk3+y5HyWTjUIejtc334kVY1XFPThrFKTeJSSnRsP2l7IgkYBqhAoGAYGsr\nM3z1FrDF2nWw5odIfKJ30UAw2LRyB0eGH0uqhLgyzvwKcK2E98sLqYUi9llN6zOK\n1IEA8xM5hxl97AFxY4sdJEMbbi55wim7uZ5Q51nbvbbNUsmM/Lm6C/JWI8pzpVeU\nIR7EjYp50AE1WOsD6CyFQ0W35pWkn0jWvL4L938CgYEAlax4dLE5+YCG5DeLT1/N\nin6kQjl7JS4oCNlPEj6aRPLX2OJresI7oOn+uNatKvlVyfPm6rdxeHCmER1FpR7Q\nA/aNVjPeViKT/R4nK9ytsa+s/1IJVrwLFHJK3toGE660g5w3vKrCjWisMdP4yzzQ\nbv1KwcKoQbNVXwauH79JKc0=\n-----END PRIVATE KEY-----\n"), - Path: String("/path"), - Period: Int(12), - CompressionCodec: String("snappy"), - GzipLevel: Int(8), - FormatVersion: Int(2), - Format: String("format"), - MessageType: String("blank"), - TimestampFormat: String("%Y"), - Placement: String("waf_debug"), + Name: ToPointer("test-gcs-4"), + ProjectID: ToPointer("logging-project"), + Bucket: ToPointer("bucket"), + User: ToPointer("user"), + SecretKey: ToPointer("-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC9aQoqdHVA86oq\nTdRQ5HqwMfpiLBBMKNQcAJsO71RKNrDWwJJZiyYbvM4FOWRZFtRSdPIDgX0C0Wg1\nNnqWYvHDyA5Ug+T8kowiQDn56dU6Km2FWO4wnqZeA8q5G7rQVXlqdibuiP7FglHA\neURUzFsqyymXMUGrqDPqrHsVWC2E3NTJEb4QlywtrwI13qbhlvTx6/9oRfUjytXJ\nRuUIE5xL8yhRCagNr5ZW250aa+wBwu5DSCk5fDNr0eDuZjw84WHDll+mHxBFGV+X\nKJ5jCOmGumGqjVWZesJpNN1My3M9bsY9layNJJ0eiDeHDEi/yXhhO/mNEXhvhq/R\nfN0Jh2A3AgMBAAECggEAef+CEL5aF6/aVs0yh7fiXkKSp1ECXkud8ztgpEn63KJF\nXM1EdnBt50fA2xSQUeGmeEXi6+cngf0nRb8FToAEgLoGoOEjSJuLrzP3I8U9Fe3m\nBRG2uZI2Ti/bD0eRGEc1oSDhCpsqnkTGK1bwcD4AKpwY+c08Izh/2BOoY6McDoqh\ndQ89jzTuMtD4cNlnPiIrY9HbxoNjshK2ax1OaeXyYKZFG1TxqMFv5gA/G5+S3Cwr\nVG4fkAxYi5vdIK3b8jUXrTM/kpoTl+d3dlQ7rRZYf7KyT31/HtJ/GNzxFI6upzO7\niDNrrUOyeOPjWXdzUh9budv3j+6UfbYK7uZIoebHIQKBgQDykYX1L/akGaOC2tfS\njzCWUzPxGFYVZQ7zD1PM6UyouuS1KLURDEGk9RxqVzTPh/pYd8Ivnz3vOVski5Zt\n19ozLGxdtDhn122DcnVpfCdYzHBdAzPCzORenFohX+MhiX5fEotTlVi7wfOmzTP5\nhUCMSd/17bJrV4XMLhkdrMRBFQKBgQDH5fwV7o+Ej/ZfcdGIa3mAFazToPDzxhHU\nnwADxaxpNGKRU03XCaiYkykarLYdG6Rk+7dXUv8eLy+6Dcq1SWQtfCWKEor++IIp\n1RwWmFHfYriHGkmxSkkEkLFvL8old9xM5YWbEXc4QIXvnfR4BZxdyJHVzIDdbI2i\nFgcn17U3GwKBgDd1njMY7ENIuWHJt16k7m7wRwfwkH4DxQ89ieNn0+cgE/p3fC6R\nptCYWg7WMXThmhNwDi3lMrvnWTdZ0uL6XyEkHwKtmdfkIV3UZZPglv5uf6JEgSkg\nv3YCOXk3+y5HyWTjUIejtc334kVY1XFPThrFKTeJSSnRsP2l7IgkYBqhAoGAYGsr\nM3z1FrDF2nWw5odIfKJ30UAw2LRyB0eGH0uqhLgyzvwKcK2E98sLqYUi9llN6zOK\n1IEA8xM5hxl97AFxY4sdJEMbbi55wim7uZ5Q51nbvbbNUsmM/Lm6C/JWI8pzpVeU\nIR7EjYp50AE1WOsD6CyFQ0W35pWkn0jWvL4L938CgYEAlax4dLE5+YCG5DeLT1/N\nin6kQjl7JS4oCNlPEj6aRPLX2OJresI7oOn+uNatKvlVyfPm6rdxeHCmER1FpR7Q\nA/aNVjPeViKT/R4nK9ytsa+s/1IJVrwLFHJK3toGE660g5w3vKrCjWisMdP4yzzQ\nbv1KwcKoQbNVXwauH79JKc0=\n-----END PRIVATE KEY-----\n"), + Path: ToPointer("/path"), + Period: ToPointer(12), + CompressionCodec: ToPointer("snappy"), + GzipLevel: ToPointer(8), + FormatVersion: ToPointer(2), + Format: ToPointer("format"), + MessageType: ToPointer("blank"), + TimestampFormat: ToPointer("%Y"), + Placement: ToPointer("waf_debug"), }) }) if err == nil { @@ -277,9 +277,9 @@ func TestClient_GCSs(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-gcs", - NewName: String("new-test-gcs"), - MessageType: String("classic"), - GzipLevel: Int(9), + NewName: ToPointer("new-test-gcs"), + MessageType: ToPointer("classic"), + GzipLevel: ToPointer(9), }) }) if err != nil { @@ -291,7 +291,7 @@ func TestClient_GCSs(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-gcs-2", - CompressionCodec: String("zstd"), + CompressionCodec: ToPointer("zstd"), }) }) if err != nil { @@ -303,7 +303,7 @@ func TestClient_GCSs(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-gcs-3", - GzipLevel: Int(9), + GzipLevel: ToPointer(9), }) }) if err != nil { diff --git a/fastly/gzip_test.go b/fastly/gzip_test.go index 85d61ad1e..6191d4065 100644 --- a/fastly/gzip_test.go +++ b/fastly/gzip_test.go @@ -19,9 +19,9 @@ func TestClient_Gzips(t *testing.T) { gzip, err = c.CreateGzip(&CreateGzipInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-gzip"), - ContentTypes: String("text/html text/css"), - Extensions: String("html css"), + Name: ToPointer("test-gzip"), + ContentTypes: ToPointer("text/html text/css"), + Extensions: ToPointer("html css"), }) }) if err != nil { @@ -35,7 +35,7 @@ func TestClient_Gzips(t *testing.T) { gzipomit, err = c.CreateGzip(&CreateGzipInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-gzip-omit"), + Name: ToPointer("test-gzip-omit"), }) }) if err != nil { @@ -125,7 +125,7 @@ func TestClient_Gzips(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-gzip", - NewName: String("new-test-gzip"), + NewName: ToPointer("new-test-gzip"), }) }) if err != nil { diff --git a/fastly/header_test.go b/fastly/header_test.go index b08803600..fa6e24dae 100644 --- a/fastly/header_test.go +++ b/fastly/header_test.go @@ -19,15 +19,15 @@ func TestClient_Headers(t *testing.T) { h, err = c.CreateHeader(&CreateHeaderInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-header"), + Name: ToPointer("test-header"), Action: HeaderActionPtr(HeaderActionSet), - IgnoreIfSet: CBool(false), + IgnoreIfSet: ToPointer(Compatibool(false)), Type: HeaderTypePtr(HeaderTypeRequest), - Destination: String("http.foo"), - Source: String("client.ip"), - Regex: String("foobar"), - Substitution: String("123"), - Priority: Int(50), + Destination: ToPointer("http.foo"), + Source: ToPointer("client.ip"), + Regex: ToPointer("foobar"), + Substitution: ToPointer("123"), + Priority: ToPointer(50), }) }) if err != nil { @@ -141,7 +141,7 @@ func TestClient_Headers(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-header", - NewName: String("new-test-header"), + NewName: ToPointer("new-test-header"), Action: HeaderActionPtr(HeaderActionAppend), Type: HeaderTypePtr(HeaderTypeFetch), }) diff --git a/fastly/health_check_test.go b/fastly/health_check_test.go index 659438e53..b36faeeec 100644 --- a/fastly/health_check_test.go +++ b/fastly/health_check_test.go @@ -19,21 +19,21 @@ func TestClient_HealthChecks(t *testing.T) { hc, err = c.CreateHealthCheck(&CreateHealthCheckInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-healthcheck"), - Method: String("HEAD"), + Name: ToPointer("test-healthcheck"), + Method: ToPointer("HEAD"), Headers: &[]string{ "Foo: Bar", "Baz: Qux", }, - Host: String("example.com"), - Path: String("/foo"), - HTTPVersion: String("1.1"), - Timeout: Int(1500), - CheckInterval: Int(2500), - ExpectedResponse: Int(200), - Window: Int(5000), - Threshold: Int(10), - Initial: Int(10), + Host: ToPointer("example.com"), + Path: ToPointer("/foo"), + HTTPVersion: ToPointer("1.1"), + Timeout: ToPointer(1500), + CheckInterval: ToPointer(2500), + ExpectedResponse: ToPointer(200), + Window: ToPointer(5000), + Threshold: ToPointer(10), + Initial: ToPointer(10), }) }) if err != nil { @@ -168,7 +168,7 @@ func TestClient_HealthChecks(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-healthcheck", - NewName: String("new-test-healthcheck"), + NewName: ToPointer("new-test-healthcheck"), Headers: &[]string{"Beep: Boop"}, }) }) diff --git a/fastly/heroku_test.go b/fastly/heroku_test.go index 35ae20d01..15bb9f2d2 100644 --- a/fastly/heroku_test.go +++ b/fastly/heroku_test.go @@ -19,12 +19,12 @@ func TestClient_Herokus(t *testing.T) { h, err = c.CreateHeroku(&CreateHerokuInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-heroku"), - Format: String("%h %l %u %t \"%r\" %>s %b"), - FormatVersion: Int(2), - Placement: String("waf_debug"), - Token: String("super-secure-token"), - URL: String("https://1.us.logplex.io/logs"), + Name: ToPointer("test-heroku"), + Format: ToPointer("%h %l %u %t \"%r\" %>s %b"), + FormatVersion: ToPointer(2), + Placement: ToPointer("waf_debug"), + Token: ToPointer("super-secure-token"), + URL: ToPointer("https://1.us.logplex.io/logs"), }) }) if err != nil { @@ -120,8 +120,8 @@ func TestClient_Herokus(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-heroku", - NewName: String("new-test-heroku"), - Token: String("new-token"), + NewName: ToPointer("new-test-heroku"), + Token: ToPointer("new-token"), }) }) if err != nil { diff --git a/fastly/honeycomb_test.go b/fastly/honeycomb_test.go index 09562a503..208bb3016 100644 --- a/fastly/honeycomb_test.go +++ b/fastly/honeycomb_test.go @@ -19,12 +19,12 @@ func TestClient_Honeycombs(t *testing.T) { h, err = c.CreateHoneycomb(&CreateHoneycombInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-honeycomb"), - Format: String("%h %l %u %t \"%r\" %>s %b"), - FormatVersion: Int(2), - Placement: String("waf_debug"), - Token: String("super-secure-token"), - Dataset: String("testDataset"), + Name: ToPointer("test-honeycomb"), + Format: ToPointer("%h %l %u %t \"%r\" %>s %b"), + FormatVersion: ToPointer(2), + Placement: ToPointer("waf_debug"), + Token: ToPointer("super-secure-token"), + Dataset: ToPointer("testDataset"), }) }) if err != nil { @@ -120,9 +120,9 @@ func TestClient_Honeycombs(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-honeycomb", - NewName: String("new-test-honeycomb"), - Token: String("new-token"), - Dataset: String("newDataset"), + NewName: ToPointer("new-test-honeycomb"), + Token: ToPointer("new-token"), + Dataset: ToPointer("newDataset"), }) }) if err != nil { diff --git a/fastly/http3_test.go b/fastly/http3_test.go index 624345ecf..5ab0f9eb4 100644 --- a/fastly/http3_test.go +++ b/fastly/http3_test.go @@ -17,7 +17,7 @@ func TestClient_HTTP3(t *testing.T) { var h *HTTP3 record(t, "http3/enable", func(c *Client) { h, err = c.EnableHTTP3(&EnableHTTP3Input{ - FeatureRevision: Int(1), + FeatureRevision: ToPointer(1), ServiceID: testServiceID, ServiceVersion: tv.Number, }) diff --git a/fastly/https_test.go b/fastly/https_test.go index 071a3f4ce..da39aa6a5 100644 --- a/fastly/https_test.go +++ b/fastly/https_test.go @@ -40,23 +40,23 @@ Wm7DCfrPNGVwFWUQOmsPue9rZBgO h, err = c.CreateHTTPS(&CreateHTTPSInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-https"), - Format: String("format"), - URL: String("https://example.com/"), - RequestMaxEntries: Int(1), - RequestMaxBytes: Int(1000), - ContentType: String("application/json"), - HeaderName: String("X-Example-Header"), - HeaderValue: String("ExampleValue"), - Method: String("PUT"), - JSONFormat: String("2"), - Placement: String("waf_debug"), - TLSCACert: String(caCert), - TLSClientCert: String(clientCert), - TLSClientKey: String(clientKey), - TLSHostname: String("example.com"), - MessageType: String("blank"), - FormatVersion: Int(2), + Name: ToPointer("test-https"), + Format: ToPointer("format"), + URL: ToPointer("https://example.com/"), + RequestMaxEntries: ToPointer(1), + RequestMaxBytes: ToPointer(1000), + ContentType: ToPointer("application/json"), + HeaderName: ToPointer("X-Example-Header"), + HeaderValue: ToPointer("ExampleValue"), + Method: ToPointer("PUT"), + JSONFormat: ToPointer("2"), + Placement: ToPointer("waf_debug"), + TLSCACert: ToPointer(caCert), + TLSClientCert: ToPointer(clientCert), + TLSClientKey: ToPointer(clientKey), + TLSHostname: ToPointer("example.com"), + MessageType: ToPointer("blank"), + FormatVersion: ToPointer(2), }) }) if err != nil { @@ -219,8 +219,8 @@ Wm7DCfrPNGVwFWUQOmsPue9rZBgO ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-https", - NewName: String("new-test-https"), - Method: String("POST"), + NewName: ToPointer("new-test-https"), + Method: ToPointer("POST"), }) }) if err != nil { diff --git a/fastly/kafka_test.go b/fastly/kafka_test.go index 0b657faeb..858e6f89b 100644 --- a/fastly/kafka_test.go +++ b/fastly/kafka_test.go @@ -24,26 +24,26 @@ func TestClient_Kafkas(t *testing.T) { var k *Kafka record(t, "kafkas/create", func(c *Client) { k, err = c.CreateKafka(&CreateKafkaInput{ - AuthMethod: String("scram-sha-512"), - Brokers: String("192.168.1.1,192.168.1.2"), - CompressionCodec: String("lz4"), - Format: String("%h %l %u %t \"%r\" %>s %b"), - FormatVersion: Int(2), - Name: String("test-kafka"), - ParseLogKeyvals: CBool(true), - Password: String("deadbeef"), - Placement: String("waf_debug"), - RequestMaxBytes: Int(requestMaxBytes), - RequiredACKs: String("-1"), + AuthMethod: ToPointer("scram-sha-512"), + Brokers: ToPointer("192.168.1.1,192.168.1.2"), + CompressionCodec: ToPointer("lz4"), + Format: ToPointer("%h %l %u %t \"%r\" %>s %b"), + FormatVersion: ToPointer(2), + Name: ToPointer("test-kafka"), + ParseLogKeyvals: ToPointer(Compatibool(true)), + Password: ToPointer("deadbeef"), + Placement: ToPointer("waf_debug"), + RequestMaxBytes: ToPointer(requestMaxBytes), + RequiredACKs: ToPointer("-1"), ServiceID: testServiceID, ServiceVersion: tv.Number, - TLSCACert: String(caCert), - TLSClientCert: String(clientCert), - TLSClientKey: String(clientKey), - TLSHostname: String("example.com"), - Topic: String("kafka-topic"), - UseTLS: CBool(true), - User: String("foobar"), + TLSCACert: ToPointer(caCert), + TLSClientCert: ToPointer(clientCert), + TLSClientKey: ToPointer(clientKey), + TLSHostname: ToPointer("example.com"), + Topic: ToPointer("kafka-topic"), + UseTLS: ToPointer(Compatibool(true)), + User: ToPointer("foobar"), }) }) if err != nil { @@ -211,8 +211,8 @@ func TestClient_Kafkas(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-kafka", - NewName: String("new-test-kafka"), - Topic: String("new-kafka-topic"), + NewName: ToPointer("new-test-kafka"), + Topic: ToPointer("new-kafka-topic"), }) }) if err != nil { diff --git a/fastly/kinesis_test.go b/fastly/kinesis_test.go index 1b06e066b..c8208c857 100644 --- a/fastly/kinesis_test.go +++ b/fastly/kinesis_test.go @@ -21,14 +21,14 @@ func TestClient_Kinesis(t *testing.T) { kinesisCreateResp1, err = c.CreateKinesis(&CreateKinesisInput{ ServiceID: testServiceID, ServiceVersion: v.Number, - Name: String("test-kinesis"), - StreamName: String("stream-name"), - Region: String("us-east-1"), - AccessKey: String("AKIAIOSFODNN7EXAMPLE"), - SecretKey: String("wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"), - Format: String("format"), - FormatVersion: Int(2), - Placement: String("waf_debug"), + Name: ToPointer("test-kinesis"), + StreamName: ToPointer("stream-name"), + Region: ToPointer("us-east-1"), + AccessKey: ToPointer("AKIAIOSFODNN7EXAMPLE"), + SecretKey: ToPointer("wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"), + Format: ToPointer("format"), + FormatVersion: ToPointer(2), + Placement: ToPointer("waf_debug"), }) }) if err != nil { @@ -39,13 +39,13 @@ func TestClient_Kinesis(t *testing.T) { kinesisCreateResp2, err = c.CreateKinesis(&CreateKinesisInput{ ServiceID: testServiceID, ServiceVersion: v.Number, - Name: String("test-kinesis-2"), - StreamName: String("stream-name"), - Region: String("us-east-1"), - IAMRole: String("arn:aws:iam::123456789012:role/S3Access"), - Format: String("format"), - FormatVersion: Int(2), - Placement: String("waf_debug"), + Name: ToPointer("test-kinesis-2"), + StreamName: ToPointer("stream-name"), + Region: ToPointer("us-east-1"), + IAMRole: ToPointer("arn:aws:iam::123456789012:role/S3Access"), + Format: ToPointer("format"), + FormatVersion: ToPointer(2), + Placement: ToPointer("waf_debug"), }) }) if err != nil { @@ -57,15 +57,15 @@ func TestClient_Kinesis(t *testing.T) { _, err = c.CreateKinesis(&CreateKinesisInput{ ServiceID: testServiceID, ServiceVersion: v.Number, - Name: String("test-kinesis-3"), - StreamName: String("stream-name"), - Region: String("us-east-1"), - AccessKey: String("AKIAIOSFODNN7EXAMPLE"), - SecretKey: String("wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"), - IAMRole: String("arn:aws:iam::123456789012:role/S3Access"), - Format: String("format"), - FormatVersion: Int(2), - Placement: String("waf_debug"), + Name: ToPointer("test-kinesis-3"), + StreamName: ToPointer("stream-name"), + Region: ToPointer("us-east-1"), + AccessKey: ToPointer("AKIAIOSFODNN7EXAMPLE"), + SecretKey: ToPointer("wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"), + IAMRole: ToPointer("arn:aws:iam::123456789012:role/S3Access"), + Format: ToPointer("format"), + FormatVersion: ToPointer(2), + Placement: ToPointer("waf_debug"), }) }) if err == nil { @@ -77,13 +77,13 @@ func TestClient_Kinesis(t *testing.T) { _, err = c.CreateKinesis(&CreateKinesisInput{ ServiceID: testServiceID, ServiceVersion: v.Number, - Name: String("test-kinesis-3"), - StreamName: String("stream-name"), - Region: String("us-east-1"), - IAMRole: String("badarn"), - Format: String("format"), - FormatVersion: Int(2), - Placement: String("waf_debug"), + Name: ToPointer("test-kinesis-3"), + StreamName: ToPointer("stream-name"), + Region: ToPointer("us-east-1"), + IAMRole: ToPointer("badarn"), + Format: ToPointer("format"), + FormatVersion: ToPointer(2), + Placement: ToPointer("waf_debug"), }) }) if err == nil { @@ -239,7 +239,7 @@ func TestClient_Kinesis(t *testing.T) { ServiceID: testServiceID, ServiceVersion: v.Number, Name: "test-kinesis", - NewName: String("new-test-kinesis"), + NewName: ToPointer("new-test-kinesis"), }) }) if err != nil { @@ -253,9 +253,9 @@ func TestClient_Kinesis(t *testing.T) { ServiceID: testServiceID, ServiceVersion: v.Number, Name: "new-test-kinesis", - AccessKey: String(""), - SecretKey: String(""), - IAMRole: String("arn:aws:iam::123456789012:role/S3Access"), + AccessKey: ToPointer(""), + SecretKey: ToPointer(""), + IAMRole: ToPointer("arn:aws:iam::123456789012:role/S3Access"), }) }) if err != nil { @@ -269,9 +269,9 @@ func TestClient_Kinesis(t *testing.T) { ServiceID: testServiceID, ServiceVersion: v.Number, Name: "test-kinesis-2", - AccessKey: String("AKIAIOSFODNN7EXAMPLE"), - SecretKey: String("wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"), - IAMRole: String(""), + AccessKey: ToPointer("AKIAIOSFODNN7EXAMPLE"), + SecretKey: ToPointer("wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"), + IAMRole: ToPointer(""), }) }) if err != nil { @@ -285,7 +285,7 @@ func TestClient_Kinesis(t *testing.T) { ServiceID: testServiceID, ServiceVersion: v.Number, Name: "test-kinesis", - IAMRole: String("badarn"), + IAMRole: ToPointer("badarn"), }) }) if err == nil { diff --git a/fastly/logentries_test.go b/fastly/logentries_test.go index 0272ae5a8..aee4531b2 100644 --- a/fastly/logentries_test.go +++ b/fastly/logentries_test.go @@ -19,13 +19,13 @@ func TestClient_Logentries(t *testing.T) { le, err = c.CreateLogentries(&CreateLogentriesInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-logentries"), - Port: Int(0), - UseTLS: CBool(true), - Token: String("abcd1234"), - Format: String("format"), - Placement: String("waf_debug"), - Region: String("us"), + Name: ToPointer("test-logentries"), + Port: ToPointer(0), + UseTLS: ToPointer(Compatibool(true)), + Token: ToPointer("abcd1234"), + Format: ToPointer("format"), + Placement: ToPointer("waf_debug"), + Region: ToPointer("us"), }) }) if err != nil { @@ -130,9 +130,9 @@ func TestClient_Logentries(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-logentries", - NewName: String("new-test-logentries"), - FormatVersion: Int(2), - Region: String("ap"), + NewName: ToPointer("new-test-logentries"), + FormatVersion: ToPointer(2), + Region: ToPointer("ap"), }) }) if err != nil { diff --git a/fastly/loggly_test.go b/fastly/loggly_test.go index d3b123892..497ff2e50 100644 --- a/fastly/loggly_test.go +++ b/fastly/loggly_test.go @@ -19,10 +19,10 @@ func TestClient_Loggly(t *testing.T) { lg, err = c.CreateLoggly(&CreateLogglyInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-loggly"), - Token: String("abcd1234"), - Format: String("format"), - Placement: String("waf_debug"), + Name: ToPointer("test-loggly"), + Token: ToPointer("abcd1234"), + Format: ToPointer("format"), + Placement: ToPointer("waf_debug"), }) }) if err != nil { @@ -112,8 +112,8 @@ func TestClient_Loggly(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-loggly", - NewName: String("new-test-loggly"), - FormatVersion: Int(2), + NewName: ToPointer("new-test-loggly"), + FormatVersion: ToPointer(2), }) }) if err != nil { diff --git a/fastly/logshuttle_test.go b/fastly/logshuttle_test.go index 2c7b697c6..edf7c111e 100644 --- a/fastly/logshuttle_test.go +++ b/fastly/logshuttle_test.go @@ -19,12 +19,12 @@ func TestClient_Logshuttles(t *testing.T) { l, err = c.CreateLogshuttle(&CreateLogshuttleInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-logshuttle"), - Format: String("%h %l %u %t \"%r\" %>s %b"), - FormatVersion: Int(2), - Placement: String("waf_debug"), - Token: String("super-secure-token"), - URL: String("https://logs.example.com"), + Name: ToPointer("test-logshuttle"), + Format: ToPointer("%h %l %u %t \"%r\" %>s %b"), + FormatVersion: ToPointer(2), + Placement: ToPointer("waf_debug"), + Token: ToPointer("super-secure-token"), + URL: ToPointer("https://logs.example.com"), }) }) if err != nil { @@ -120,9 +120,9 @@ func TestClient_Logshuttles(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-logshuttle", - NewName: String("new-test-logshuttle"), - Token: String("new-token"), - URL: String("https://logs2.example.com"), + NewName: ToPointer("new-test-logshuttle"), + Token: ToPointer("new-token"), + URL: ToPointer("https://logs2.example.com"), }) }) if err != nil { diff --git a/fastly/newrelic_test.go b/fastly/newrelic_test.go index 1b146e912..9dfa41653 100644 --- a/fastly/newrelic_test.go +++ b/fastly/newrelic_test.go @@ -19,11 +19,11 @@ func TestClient_NewRelic(t *testing.T) { newRelicResp1, err = c.CreateNewRelic(&CreateNewRelicInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-newrelic"), - Token: String("abcd1234"), - Format: String("format"), - Placement: String("waf_debug"), - Region: String("us"), + Name: ToPointer("test-newrelic"), + Token: ToPointer("abcd1234"), + Format: ToPointer("format"), + Placement: ToPointer("waf_debug"), + Region: ToPointer("us"), }) }) if err != nil { @@ -34,11 +34,11 @@ func TestClient_NewRelic(t *testing.T) { newRelicResp2, err = c.CreateNewRelic(&CreateNewRelicInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-newrelic-2"), - Token: String("abcd1234"), - Format: String("format"), - Placement: String("waf_debug"), - Region: String("eu"), + Name: ToPointer("test-newrelic-2"), + Token: ToPointer("abcd1234"), + Format: ToPointer("format"), + Placement: ToPointer("waf_debug"), + Region: ToPointer("eu"), }) }) if err != nil { @@ -50,11 +50,11 @@ func TestClient_NewRelic(t *testing.T) { _, err = c.CreateNewRelic(&CreateNewRelicInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-newrelic-3"), - Token: String("abcd1234"), - Format: String("format"), - Placement: String("waf_debug"), - Region: String("abc"), + Name: ToPointer("test-newrelic-3"), + Token: ToPointer("abcd1234"), + Format: ToPointer("format"), + Placement: ToPointer("waf_debug"), + Region: ToPointer("abc"), }) }) if err == nil { @@ -206,9 +206,9 @@ func TestClient_NewRelic(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-newrelic", - NewName: String("new-test-newrelic"), - FormatVersion: Int(2), - Region: String("eu"), + NewName: ToPointer("new-test-newrelic"), + FormatVersion: ToPointer(2), + Region: ToPointer("eu"), }) }) if err != nil { @@ -221,7 +221,7 @@ func TestClient_NewRelic(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "new-test-newrelic", - Region: String("zz"), + Region: ToPointer("zz"), }) }) if err == nil { diff --git a/fastly/newrelicotlp_test.go b/fastly/newrelicotlp_test.go index e61a2ea70..0a67724ac 100644 --- a/fastly/newrelicotlp_test.go +++ b/fastly/newrelicotlp_test.go @@ -19,11 +19,11 @@ func TestClient_NewRelicOTLP(t *testing.T) { n, err = c.CreateNewRelicOTLP(&CreateNewRelicOTLPInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-newrelicotlp"), - Token: String("abcd1234"), - URL: String("https://example.nr-data.net"), - Format: String("format"), - Placement: String("waf_debug"), + Name: ToPointer("test-newrelicotlp"), + Token: ToPointer("abcd1234"), + URL: ToPointer("https://example.nr-data.net"), + Format: ToPointer("format"), + Placement: ToPointer("waf_debug"), }) }) if err != nil { @@ -119,8 +119,8 @@ func TestClient_NewRelicOTLP(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-newrelicotlp", - NewName: String("new-test-newrelicotlp"), - FormatVersion: Int(2), + NewName: ToPointer("new-test-newrelicotlp"), + FormatVersion: ToPointer(2), }) }) if err != nil { diff --git a/fastly/openstack_test.go b/fastly/openstack_test.go index f2337f650..a03ecff35 100644 --- a/fastly/openstack_test.go +++ b/fastly/openstack_test.go @@ -19,20 +19,20 @@ func TestClient_Openstack(t *testing.T) { osCreateResp1, err = c.CreateOpenstack(&CreateOpenstackInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-openstack"), - User: String("user"), - AccessKey: String("secret-key"), - BucketName: String("bucket-name"), - URL: String("https://logs.example.com/v1.0"), - Path: String("/path"), - Period: Int(12), - CompressionCodec: String("snappy"), - Format: String("format"), - FormatVersion: Int(2), - TimestampFormat: String("%Y"), - MessageType: String("classic"), - Placement: String("waf_debug"), - PublicKey: String(pgpPublicKey()), + Name: ToPointer("test-openstack"), + User: ToPointer("user"), + AccessKey: ToPointer("secret-key"), + BucketName: ToPointer("bucket-name"), + URL: ToPointer("https://logs.example.com/v1.0"), + Path: ToPointer("/path"), + Period: ToPointer(12), + CompressionCodec: ToPointer("snappy"), + Format: ToPointer("format"), + FormatVersion: ToPointer(2), + TimestampFormat: ToPointer("%Y"), + MessageType: ToPointer("classic"), + Placement: ToPointer("waf_debug"), + PublicKey: ToPointer(pgpPublicKey()), }) }) if err != nil { @@ -43,20 +43,20 @@ func TestClient_Openstack(t *testing.T) { osCreateResp2, err = c.CreateOpenstack(&CreateOpenstackInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-openstack-2"), - User: String("user"), - AccessKey: String("secret-key"), - BucketName: String("bucket-name"), - URL: String("https://logs.example.com/v1.0"), - Path: String("/path"), - Period: Int(12), - GzipLevel: Int(8), - Format: String("format"), - FormatVersion: Int(2), - TimestampFormat: String("%Y"), - MessageType: String("classic"), - Placement: String("waf_debug"), - PublicKey: String(pgpPublicKey()), + Name: ToPointer("test-openstack-2"), + User: ToPointer("user"), + AccessKey: ToPointer("secret-key"), + BucketName: ToPointer("bucket-name"), + URL: ToPointer("https://logs.example.com/v1.0"), + Path: ToPointer("/path"), + Period: ToPointer(12), + GzipLevel: ToPointer(8), + Format: ToPointer("format"), + FormatVersion: ToPointer(2), + TimestampFormat: ToPointer("%Y"), + MessageType: ToPointer("classic"), + Placement: ToPointer("waf_debug"), + PublicKey: ToPointer(pgpPublicKey()), }) }) if err != nil { @@ -67,20 +67,20 @@ func TestClient_Openstack(t *testing.T) { osCreateResp3, err = c.CreateOpenstack(&CreateOpenstackInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-openstack-3"), - User: String("user"), - AccessKey: String("secret-key"), - BucketName: String("bucket-name"), - URL: String("https://logs.example.com/v1.0"), - Path: String("/path"), - Period: Int(12), - CompressionCodec: String("snappy"), - Format: String("format"), - FormatVersion: Int(2), - TimestampFormat: String("%Y"), - MessageType: String("classic"), - Placement: String("waf_debug"), - PublicKey: String(pgpPublicKey()), + Name: ToPointer("test-openstack-3"), + User: ToPointer("user"), + AccessKey: ToPointer("secret-key"), + BucketName: ToPointer("bucket-name"), + URL: ToPointer("https://logs.example.com/v1.0"), + Path: ToPointer("/path"), + Period: ToPointer(12), + CompressionCodec: ToPointer("snappy"), + Format: ToPointer("format"), + FormatVersion: ToPointer(2), + TimestampFormat: ToPointer("%Y"), + MessageType: ToPointer("classic"), + Placement: ToPointer("waf_debug"), + PublicKey: ToPointer(pgpPublicKey()), }) }) if err != nil { @@ -93,21 +93,21 @@ func TestClient_Openstack(t *testing.T) { _, err = c.CreateOpenstack(&CreateOpenstackInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-openstack-4"), - User: String("user"), - AccessKey: String("secret-key"), - BucketName: String("bucket-name"), - URL: String("https://logs.example.com/v1.0"), - Path: String("/path"), - Period: Int(12), - CompressionCodec: String("snappy"), - GzipLevel: Int(8), - Format: String("format"), - FormatVersion: Int(2), - TimestampFormat: String("%Y"), - MessageType: String("classic"), - Placement: String("waf_debug"), - PublicKey: String(pgpPublicKey()), + Name: ToPointer("test-openstack-4"), + User: ToPointer("user"), + AccessKey: ToPointer("secret-key"), + BucketName: ToPointer("bucket-name"), + URL: ToPointer("https://logs.example.com/v1.0"), + Path: ToPointer("/path"), + Period: ToPointer(12), + CompressionCodec: ToPointer("snappy"), + GzipLevel: ToPointer(8), + Format: ToPointer("format"), + FormatVersion: ToPointer(2), + TimestampFormat: ToPointer("%Y"), + MessageType: ToPointer("classic"), + Placement: ToPointer("waf_debug"), + PublicKey: ToPointer(pgpPublicKey()), }) }) if err == nil { @@ -283,9 +283,9 @@ func TestClient_Openstack(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-openstack", - User: String("new-user"), - NewName: String("new-test-openstack"), - CompressionCodec: String("zstd"), + User: ToPointer("new-user"), + NewName: ToPointer("new-test-openstack"), + CompressionCodec: ToPointer("zstd"), }) }) if err != nil { @@ -297,7 +297,7 @@ func TestClient_Openstack(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-openstack-2", - CompressionCodec: String("zstd"), + CompressionCodec: ToPointer("zstd"), }) }) if err != nil { @@ -309,7 +309,7 @@ func TestClient_Openstack(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-openstack-3", - GzipLevel: Int(9), + GzipLevel: ToPointer(9), }) }) if err != nil { diff --git a/fastly/papertrail_test.go b/fastly/papertrail_test.go index d149e301e..d8c3fb148 100644 --- a/fastly/papertrail_test.go +++ b/fastly/papertrail_test.go @@ -19,12 +19,12 @@ func TestClient_Papertrails(t *testing.T) { p, err = c.CreatePapertrail(&CreatePapertrailInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-papertrail"), - Address: String("integ-test.go-fastly.com"), - Port: Int(1234), - FormatVersion: Int(2), - Format: String("format"), - Placement: String("waf_debug"), + Name: ToPointer("test-papertrail"), + Address: ToPointer("integ-test.go-fastly.com"), + Port: ToPointer(1234), + FormatVersion: ToPointer(2), + Format: ToPointer("format"), + Placement: ToPointer("waf_debug"), }) }) if err != nil { @@ -120,7 +120,7 @@ func TestClient_Papertrails(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-papertrail", - NewName: String("new-test-papertrail"), + NewName: ToPointer("new-test-papertrail"), }) }) if err != nil { diff --git a/fastly/pool_test.go b/fastly/pool_test.go index ef3e63751..6aa3955c7 100644 --- a/fastly/pool_test.go +++ b/fastly/pool_test.go @@ -17,14 +17,14 @@ func TestClient_Pools(t *testing.T) { var p *Pool record(t, "pools/create", func(c *Client) { p, err = c.CreatePool(&CreatePoolInput{ - Comment: String("test pool"), - Name: String("test_pool"), - Quorum: Int(50), + Comment: ToPointer("test pool"), + Name: ToPointer("test_pool"), + Quorum: ToPointer(50), ServiceID: testServiceID, ServiceVersion: tv.Number, - TLSCertHostname: String("example.com"), + TLSCertHostname: ToPointer("example.com"), Type: PoolTypePtr(PoolTypeRandom), - UseTLS: CBool(true), + UseTLS: ToPointer(Compatibool(true)), }) }) if err != nil { @@ -112,8 +112,8 @@ func TestClient_Pools(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test_pool", - NewName: String("new_test_pool"), - Quorum: Int(0), + NewName: ToPointer("new_test_pool"), + Quorum: ToPointer(0), Type: PoolTypePtr(PoolTypeHash), }) }) @@ -162,7 +162,7 @@ func TestClient_CreatePool_validation(t *testing.T) { var err error _, err = testClient.CreatePool(&CreatePoolInput{ - Name: String("test"), + Name: ToPointer("test"), ServiceVersion: 1, }) if err != ErrMissingServiceID { @@ -170,7 +170,7 @@ func TestClient_CreatePool_validation(t *testing.T) { } _, err = testClient.CreatePool(&CreatePoolInput{ - Name: String("test"), + Name: ToPointer("test"), ServiceID: "foo", }) if err != ErrMissingServiceVersion { diff --git a/fastly/pubsub_test.go b/fastly/pubsub_test.go index 0391e6f75..31937a574 100644 --- a/fastly/pubsub_test.go +++ b/fastly/pubsub_test.go @@ -20,15 +20,15 @@ func TestClient_Pubsubs(t *testing.T) { pubsub, err = c.CreatePubsub(&CreatePubsubInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-pubsub"), - Topic: String("topic"), - User: String("user"), - AccountName: String("service-account"), - SecretKey: String("-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC9aQoqdHVA86oq\nTdRQ5HqwMfpiLBBMKNQcAJsO71RKNrDWwJJZiyYbvM4FOWRZFtRSdPIDgX0C0Wg1\nNnqWYvHDyA5Ug+T8kowiQDn56dU6Km2FWO4wnqZeA8q5G7rQVXlqdibuiP7FglHA\neURUzFsqyymXMUGrqDPqrHsVWC2E3NTJEb4QlywtrwI13qbhlvTx6/9oRfUjytXJ\nRuUIE5xL8yhRCagNr5ZW250aa+wBwu5DSCk5fDNr0eDuZjw84WHDll+mHxBFGV+X\nKJ5jCOmGumGqjVWZesJpNN1My3M9bsY9layNJJ0eiDeHDEi/yXhhO/mNEXhvhq/R\nfN0Jh2A3AgMBAAECggEAef+CEL5aF6/aVs0yh7fiXkKSp1ECXkud8ztgpEn63KJF\nXM1EdnBt50fA2xSQUeGmeEXi6+cngf0nRb8FToAEgLoGoOEjSJuLrzP3I8U9Fe3m\nBRG2uZI2Ti/bD0eRGEc1oSDhCpsqnkTGK1bwcD4AKpwY+c08Izh/2BOoY6McDoqh\ndQ89jzTuMtD4cNlnPiIrY9HbxoNjshK2ax1OaeXyYKZFG1TxqMFv5gA/G5+S3Cwr\nVG4fkAxYi5vdIK3b8jUXrTM/kpoTl+d3dlQ7rRZYf7KyT31/HtJ/GNzxFI6upzO7\niDNrrUOyeOPjWXdzUh9budv3j+6UfbYK7uZIoebHIQKBgQDykYX1L/akGaOC2tfS\njzCWUzPxGFYVZQ7zD1PM6UyouuS1KLURDEGk9RxqVzTPh/pYd8Ivnz3vOVski5Zt\n19ozLGxdtDhn122DcnVpfCdYzHBdAzPCzORenFohX+MhiX5fEotTlVi7wfOmzTP5\nhUCMSd/17bJrV4XMLhkdrMRBFQKBgQDH5fwV7o+Ej/ZfcdGIa3mAFazToPDzxhHU\nnwADxaxpNGKRU03XCaiYkykarLYdG6Rk+7dXUv8eLy+6Dcq1SWQtfCWKEor++IIp\n1RwWmFHfYriHGkmxSkkEkLFvL8old9xM5YWbEXc4QIXvnfR4BZxdyJHVzIDdbI2i\nFgcn17U3GwKBgDd1njMY7ENIuWHJt16k7m7wRwfwkH4DxQ89ieNn0+cgE/p3fC6R\nptCYWg7WMXThmhNwDi3lMrvnWTdZ0uL6XyEkHwKtmdfkIV3UZZPglv5uf6JEgSkg\nv3YCOXk3+y5HyWTjUIejtc334kVY1XFPThrFKTeJSSnRsP2l7IgkYBqhAoGAYGsr\nM3z1FrDF2nWw5odIfKJ30UAw2LRyB0eGH0uqhLgyzvwKcK2E98sLqYUi9llN6zOK\n1IEA8xM5hxl97AFxY4sdJEMbbi55wim7uZ5Q51nbvbbNUsmM/Lm6C/JWI8pzpVeU\nIR7EjYp50AE1WOsD6CyFQ0W35pWkn0jWvL4L938CgYEAlax4dLE5+YCG5DeLT1/N\nin6kQjl7JS4oCNlPEj6aRPLX2OJresI7oOn+uNatKvlVyfPm6rdxeHCmER1FpR7Q\nA/aNVjPeViKT/R4nK9ytsa+s/1IJVrwLFHJK3toGE660g5w3vKrCjWisMdP4yzzQ\nbv1KwcKoQbNVXwauH79JKc0=\n-----END PRIVATE KEY-----\n"), - ProjectID: String("project-id"), - FormatVersion: Int(2), - Format: String("format"), - Placement: String("waf_debug"), + Name: ToPointer("test-pubsub"), + Topic: ToPointer("topic"), + User: ToPointer("user"), + AccountName: ToPointer("service-account"), + SecretKey: ToPointer("-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC9aQoqdHVA86oq\nTdRQ5HqwMfpiLBBMKNQcAJsO71RKNrDWwJJZiyYbvM4FOWRZFtRSdPIDgX0C0Wg1\nNnqWYvHDyA5Ug+T8kowiQDn56dU6Km2FWO4wnqZeA8q5G7rQVXlqdibuiP7FglHA\neURUzFsqyymXMUGrqDPqrHsVWC2E3NTJEb4QlywtrwI13qbhlvTx6/9oRfUjytXJ\nRuUIE5xL8yhRCagNr5ZW250aa+wBwu5DSCk5fDNr0eDuZjw84WHDll+mHxBFGV+X\nKJ5jCOmGumGqjVWZesJpNN1My3M9bsY9layNJJ0eiDeHDEi/yXhhO/mNEXhvhq/R\nfN0Jh2A3AgMBAAECggEAef+CEL5aF6/aVs0yh7fiXkKSp1ECXkud8ztgpEn63KJF\nXM1EdnBt50fA2xSQUeGmeEXi6+cngf0nRb8FToAEgLoGoOEjSJuLrzP3I8U9Fe3m\nBRG2uZI2Ti/bD0eRGEc1oSDhCpsqnkTGK1bwcD4AKpwY+c08Izh/2BOoY6McDoqh\ndQ89jzTuMtD4cNlnPiIrY9HbxoNjshK2ax1OaeXyYKZFG1TxqMFv5gA/G5+S3Cwr\nVG4fkAxYi5vdIK3b8jUXrTM/kpoTl+d3dlQ7rRZYf7KyT31/HtJ/GNzxFI6upzO7\niDNrrUOyeOPjWXdzUh9budv3j+6UfbYK7uZIoebHIQKBgQDykYX1L/akGaOC2tfS\njzCWUzPxGFYVZQ7zD1PM6UyouuS1KLURDEGk9RxqVzTPh/pYd8Ivnz3vOVski5Zt\n19ozLGxdtDhn122DcnVpfCdYzHBdAzPCzORenFohX+MhiX5fEotTlVi7wfOmzTP5\nhUCMSd/17bJrV4XMLhkdrMRBFQKBgQDH5fwV7o+Ej/ZfcdGIa3mAFazToPDzxhHU\nnwADxaxpNGKRU03XCaiYkykarLYdG6Rk+7dXUv8eLy+6Dcq1SWQtfCWKEor++IIp\n1RwWmFHfYriHGkmxSkkEkLFvL8old9xM5YWbEXc4QIXvnfR4BZxdyJHVzIDdbI2i\nFgcn17U3GwKBgDd1njMY7ENIuWHJt16k7m7wRwfwkH4DxQ89ieNn0+cgE/p3fC6R\nptCYWg7WMXThmhNwDi3lMrvnWTdZ0uL6XyEkHwKtmdfkIV3UZZPglv5uf6JEgSkg\nv3YCOXk3+y5HyWTjUIejtc334kVY1XFPThrFKTeJSSnRsP2l7IgkYBqhAoGAYGsr\nM3z1FrDF2nWw5odIfKJ30UAw2LRyB0eGH0uqhLgyzvwKcK2E98sLqYUi9llN6zOK\n1IEA8xM5hxl97AFxY4sdJEMbbi55wim7uZ5Q51nbvbbNUsmM/Lm6C/JWI8pzpVeU\nIR7EjYp50AE1WOsD6CyFQ0W35pWkn0jWvL4L938CgYEAlax4dLE5+YCG5DeLT1/N\nin6kQjl7JS4oCNlPEj6aRPLX2OJresI7oOn+uNatKvlVyfPm6rdxeHCmER1FpR7Q\nA/aNVjPeViKT/R4nK9ytsa+s/1IJVrwLFHJK3toGE660g5w3vKrCjWisMdP4yzzQ\nbv1KwcKoQbNVXwauH79JKc0=\n-----END PRIVATE KEY-----\n"), + ProjectID: ToPointer("project-id"), + FormatVersion: ToPointer(2), + Format: ToPointer("format"), + Placement: ToPointer("waf_debug"), }) }) if err != nil { @@ -166,8 +166,8 @@ bv1KwcKoQbNVXwauH79JKc0= ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-pubsub", - NewName: String("new-test-pubsub"), - Topic: String("new-topic"), + NewName: ToPointer("new-test-pubsub"), + Topic: ToPointer("new-topic"), }) }) if err != nil { diff --git a/fastly/request_setting.go b/fastly/request_setting.go index 0d83e299f..3407d5267 100644 --- a/fastly/request_setting.go +++ b/fastly/request_setting.go @@ -18,12 +18,6 @@ const ( // RequestSettingAction is a type of request setting action. type RequestSettingAction string -// RequestSettingActionPtr returns a pointer to a RequestSettingAction. -func RequestSettingActionPtr(v RequestSettingAction) *RequestSettingAction { - rsa := &v - return rsa -} - const ( // RequestSettingXFFClear clears any X-Forwarded-For headers. RequestSettingXFFClear RequestSettingXFF = "clear" @@ -45,12 +39,6 @@ const ( // RequestSettingXFF is a type of X-Forwarded-For value to set. type RequestSettingXFF string -// RequestSettingXFFPtr returns a pointer to a RequestSettingXFF. -func RequestSettingXFFPtr(v RequestSettingXFF) *RequestSettingXFF { - rsx := &v - return rsx -} - // RequestSetting represents a request setting response from the Fastly API. type RequestSetting struct { Action RequestSettingAction `mapstructure:"action"` diff --git a/fastly/request_setting_test.go b/fastly/request_setting_test.go index b70bd428c..09843df0a 100644 --- a/fastly/request_setting_test.go +++ b/fastly/request_setting_test.go @@ -19,17 +19,17 @@ func TestClient_RequestSettings(t *testing.T) { rs, err = c.CreateRequestSetting(&CreateRequestSettingInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-request-setting"), - ForceMiss: CBool(true), - ForceSSL: CBool(true), - Action: RequestSettingActionPtr(RequestSettingActionLookup), - BypassBusyWait: CBool(true), - MaxStaleAge: Int(30), - HashKeys: String("a,b,c"), - XForwardedFor: RequestSettingXFFPtr(RequestSettingXFFLeave), - TimerSupport: CBool(true), - GeoHeaders: CBool(true), - DefaultHost: String("example.com"), + Name: ToPointer("test-request-setting"), + ForceMiss: ToPointer(Compatibool(true)), + ForceSSL: ToPointer(Compatibool(true)), + Action: ToPointer(RequestSettingActionLookup), + BypassBusyWait: ToPointer(Compatibool(true)), + MaxStaleAge: ToPointer(30), + HashKeys: ToPointer("a,b,c"), + XForwardedFor: ToPointer(RequestSettingXFFLeave), + TimerSupport: ToPointer(Compatibool(true)), + GeoHeaders: ToPointer(Compatibool(true)), + DefaultHost: ToPointer("example.com"), }) }) if err != nil { @@ -155,7 +155,7 @@ func TestClient_RequestSettings(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-request-setting", - NewName: String("new-test-request-setting"), + NewName: ToPointer("new-test-request-setting"), }) }) if err != nil { diff --git a/fastly/resource_test.go b/fastly/resource_test.go index 6922bc01b..ce8592c0a 100644 --- a/fastly/resource_test.go +++ b/fastly/resource_test.go @@ -47,8 +47,8 @@ func TestClient_Resources(t *testing.T) { r, err = c.CreateResource(&CreateResourceInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String(kvStoreNameForServiceLinking), - ResourceID: String(o.ID), + Name: ToPointer(kvStoreNameForServiceLinking), + ResourceID: ToPointer(o.ID), }) }) if err != nil { @@ -108,7 +108,7 @@ func TestClient_Resources(t *testing.T) { ID: r.ID, ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("new-kv-store-alias-for-my-service"), + Name: ToPointer("new-kv-store-alias-for-my-service"), }) }) if err != nil { diff --git a/fastly/response_object_test.go b/fastly/response_object_test.go index 6379e89e1..8e2eb9507 100644 --- a/fastly/response_object_test.go +++ b/fastly/response_object_test.go @@ -19,11 +19,11 @@ func TestClient_ResponseObjects(t *testing.T) { ro, err = c.CreateResponseObject(&CreateResponseObjectInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-response-object"), - Status: Int(200), - Response: String("Ok"), - Content: String("abcd"), - ContentType: String("text/plain"), + Name: ToPointer("test-response-object"), + Status: ToPointer(200), + Response: ToPointer("Ok"), + Content: ToPointer("abcd"), + ContentType: ToPointer("text/plain"), }) }) if err != nil { @@ -113,7 +113,7 @@ func TestClient_ResponseObjects(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-response-object", - NewName: String("new-test-response-object"), + NewName: ToPointer("new-test-response-object"), }) }) if err != nil { diff --git a/fastly/s3.go b/fastly/s3.go index 81b1e5f8b..57ca8aa30 100644 --- a/fastly/s3.go +++ b/fastly/s3.go @@ -10,27 +10,12 @@ import ( // S3Redundancy represents the redundancy variants for S3. type S3Redundancy string -// S3RedundancyPtr returns a pointer to a S3Redundancy. -func S3RedundancyPtr(v S3Redundancy) *S3Redundancy { - return &v -} - // S3ServerSideEncryption represents the encryption variants for S3. type S3ServerSideEncryption string -// S3ServerSideEncryptionPtr returns a pointer to a S3ServerSideEncryption. -func S3ServerSideEncryptionPtr(v S3ServerSideEncryption) *S3ServerSideEncryption { - return &v -} - // S3AccessControlList represents the control list variants for S3. type S3AccessControlList string -// S3AccessControlListPtr returns a pointer to a S3AccessControlList. -func S3AccessControlListPtr(v S3AccessControlList) *S3AccessControlList { - return &v -} - const ( // S3RedundancyStandard represents a redundancy variant. S3RedundancyStandard S3Redundancy = "standard" diff --git a/fastly/s3_test.go b/fastly/s3_test.go index 5e9b124f2..ac074ebe5 100644 --- a/fastly/s3_test.go +++ b/fastly/s3_test.go @@ -21,25 +21,25 @@ func TestClient_S3s(t *testing.T) { s3CreateResp1, err = c.CreateS3(&CreateS3Input{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-s3"), - BucketName: String("bucket-name"), - Domain: String("s3.us-east-1.amazonaws.com"), - AccessKey: String("AKIAIOSFODNN7EXAMPLE"), - SecretKey: String("wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"), - Path: String("/path"), - Period: Int(12), - CompressionCodec: String("snappy"), - Format: String("format"), - FormatVersion: Int(2), - TimestampFormat: String("%Y"), - MessageType: String("classic"), - Redundancy: S3RedundancyPtr(S3RedundancyReduced), - Placement: String("waf_debug"), - PublicKey: String(pgpPublicKey()), - ServerSideEncryptionKMSKeyID: String("1234"), - ServerSideEncryption: S3ServerSideEncryptionPtr(S3ServerSideEncryptionKMS), - ACL: S3AccessControlListPtr(S3AccessControlListPrivate), - FileMaxBytes: Int(MiB), + Name: ToPointer("test-s3"), + BucketName: ToPointer("bucket-name"), + Domain: ToPointer("s3.us-east-1.amazonaws.com"), + AccessKey: ToPointer("AKIAIOSFODNN7EXAMPLE"), + SecretKey: ToPointer("wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"), + Path: ToPointer("/path"), + Period: ToPointer(12), + CompressionCodec: ToPointer("snappy"), + Format: ToPointer("format"), + FormatVersion: ToPointer(2), + TimestampFormat: ToPointer("%Y"), + MessageType: ToPointer("classic"), + Redundancy: ToPointer(S3RedundancyReduced), + Placement: ToPointer("waf_debug"), + PublicKey: ToPointer(pgpPublicKey()), + ServerSideEncryptionKMSKeyID: ToPointer("1234"), + ServerSideEncryption: ToPointer(S3ServerSideEncryptionKMS), + ACL: ToPointer(S3AccessControlListPrivate), + FileMaxBytes: ToPointer(MiB), }) }) if err != nil { @@ -50,25 +50,25 @@ func TestClient_S3s(t *testing.T) { s3CreateResp2, err = c.CreateS3(&CreateS3Input{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-s3-2"), - BucketName: String("bucket-name"), - Domain: String("s3.us-east-1.amazonaws.com"), - AccessKey: String("AKIAIOSFODNN7EXAMPLE"), - SecretKey: String("wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"), - Path: String("/path"), - Period: Int(12), - GzipLevel: Int(8), - Format: String("format"), - FormatVersion: Int(2), - TimestampFormat: String("%Y"), - MessageType: String("classic"), - Redundancy: S3RedundancyPtr(S3RedundancyOneZoneIA), - Placement: String("waf_debug"), - PublicKey: String(pgpPublicKey()), - ServerSideEncryptionKMSKeyID: String("1234"), - ServerSideEncryption: S3ServerSideEncryptionPtr(S3ServerSideEncryptionKMS), - ACL: S3AccessControlListPtr(S3AccessControlListAuthenticatedRead), - FileMaxBytes: Int(10 * MiB), + Name: ToPointer("test-s3-2"), + BucketName: ToPointer("bucket-name"), + Domain: ToPointer("s3.us-east-1.amazonaws.com"), + AccessKey: ToPointer("AKIAIOSFODNN7EXAMPLE"), + SecretKey: ToPointer("wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"), + Path: ToPointer("/path"), + Period: ToPointer(12), + GzipLevel: ToPointer(8), + Format: ToPointer("format"), + FormatVersion: ToPointer(2), + TimestampFormat: ToPointer("%Y"), + MessageType: ToPointer("classic"), + Redundancy: ToPointer(S3RedundancyOneZoneIA), + Placement: ToPointer("waf_debug"), + PublicKey: ToPointer(pgpPublicKey()), + ServerSideEncryptionKMSKeyID: ToPointer("1234"), + ServerSideEncryption: ToPointer(S3ServerSideEncryptionKMS), + ACL: ToPointer(S3AccessControlListAuthenticatedRead), + FileMaxBytes: ToPointer(10 * MiB), }) }) if err != nil { @@ -78,24 +78,24 @@ func TestClient_S3s(t *testing.T) { s3CreateResp3, err = c.CreateS3(&CreateS3Input{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-s3-3"), - BucketName: String("bucket-name"), - Domain: String("s3.us-east-1.amazonaws.com"), - AccessKey: String("AKIAIOSFODNN7EXAMPLE"), - SecretKey: String("wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"), - Path: String("/path"), - Period: Int(12), - Format: String("format"), - CompressionCodec: String("snappy"), - FormatVersion: Int(2), - TimestampFormat: String("%Y"), - MessageType: String("classic"), - Redundancy: S3RedundancyPtr(S3RedundancyStandardIA), - Placement: String("waf_debug"), - PublicKey: String(pgpPublicKey()), - ServerSideEncryptionKMSKeyID: String("1234"), - ServerSideEncryption: S3ServerSideEncryptionPtr(S3ServerSideEncryptionKMS), - ACL: S3AccessControlListPtr(S3AccessControlListBucketOwnerFullControl), + Name: ToPointer("test-s3-3"), + BucketName: ToPointer("bucket-name"), + Domain: ToPointer("s3.us-east-1.amazonaws.com"), + AccessKey: ToPointer("AKIAIOSFODNN7EXAMPLE"), + SecretKey: ToPointer("wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"), + Path: ToPointer("/path"), + Period: ToPointer(12), + Format: ToPointer("format"), + CompressionCodec: ToPointer("snappy"), + FormatVersion: ToPointer(2), + TimestampFormat: ToPointer("%Y"), + MessageType: ToPointer("classic"), + Redundancy: ToPointer(S3RedundancyStandardIA), + Placement: ToPointer("waf_debug"), + PublicKey: ToPointer(pgpPublicKey()), + ServerSideEncryptionKMSKeyID: ToPointer("1234"), + ServerSideEncryption: ToPointer(S3ServerSideEncryptionKMS), + ACL: ToPointer(S3AccessControlListBucketOwnerFullControl), }) }) if err != nil { @@ -106,23 +106,23 @@ func TestClient_S3s(t *testing.T) { s3CreateResp4, err = c.CreateS3(&CreateS3Input{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-s3-4"), - BucketName: String("bucket-name"), - Domain: String("s3.us-east-1.amazonaws.com"), - IAMRole: String("arn:aws:iam::123456789012:role/S3Access"), - Path: String("/path"), - Period: Int(12), - Format: String("format"), - CompressionCodec: String("snappy"), - FormatVersion: Int(2), - TimestampFormat: String("%Y"), - MessageType: String("classic"), - Placement: String("waf_debug"), - Redundancy: S3RedundancyPtr(S3RedundancyStandard), - PublicKey: String(pgpPublicKey()), - ServerSideEncryptionKMSKeyID: String("1234"), - ServerSideEncryption: S3ServerSideEncryptionPtr(S3ServerSideEncryptionKMS), - FileMaxBytes: Int(10 * MiB), + Name: ToPointer("test-s3-4"), + BucketName: ToPointer("bucket-name"), + Domain: ToPointer("s3.us-east-1.amazonaws.com"), + IAMRole: ToPointer("arn:aws:iam::123456789012:role/S3Access"), + Path: ToPointer("/path"), + Period: ToPointer(12), + Format: ToPointer("format"), + CompressionCodec: ToPointer("snappy"), + FormatVersion: ToPointer(2), + TimestampFormat: ToPointer("%Y"), + MessageType: ToPointer("classic"), + Placement: ToPointer("waf_debug"), + Redundancy: ToPointer(S3RedundancyStandard), + PublicKey: ToPointer(pgpPublicKey()), + ServerSideEncryptionKMSKeyID: ToPointer("1234"), + ServerSideEncryption: ToPointer(S3ServerSideEncryptionKMS), + FileMaxBytes: ToPointer(10 * MiB), }) }) if err != nil { @@ -134,24 +134,24 @@ func TestClient_S3s(t *testing.T) { _, err = c.CreateS3(&CreateS3Input{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-s3"), - BucketName: String("bucket-name"), - Domain: String("s3.us-east-1.amazonaws.com"), - AccessKey: String("AKIAIOSFODNN7EXAMPLE"), - SecretKey: String("wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"), - IAMRole: String("arn:aws:iam::123456789012:role/S3Access"), - Path: String("/path"), - Period: Int(12), - CompressionCodec: String("snappy"), - Format: String("format"), - FormatVersion: Int(2), - TimestampFormat: String("%Y"), - MessageType: String("classic"), - Redundancy: S3RedundancyPtr(S3RedundancyReduced), - Placement: String("waf_debug"), - PublicKey: String(pgpPublicKey()), - ServerSideEncryptionKMSKeyID: String("1234"), - ServerSideEncryption: S3ServerSideEncryptionPtr(S3ServerSideEncryptionKMS), + Name: ToPointer("test-s3"), + BucketName: ToPointer("bucket-name"), + Domain: ToPointer("s3.us-east-1.amazonaws.com"), + AccessKey: ToPointer("AKIAIOSFODNN7EXAMPLE"), + SecretKey: ToPointer("wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"), + IAMRole: ToPointer("arn:aws:iam::123456789012:role/S3Access"), + Path: ToPointer("/path"), + Period: ToPointer(12), + CompressionCodec: ToPointer("snappy"), + Format: ToPointer("format"), + FormatVersion: ToPointer(2), + TimestampFormat: ToPointer("%Y"), + MessageType: ToPointer("classic"), + Redundancy: ToPointer(S3RedundancyReduced), + Placement: ToPointer("waf_debug"), + PublicKey: ToPointer(pgpPublicKey()), + ServerSideEncryptionKMSKeyID: ToPointer("1234"), + ServerSideEncryption: ToPointer(S3ServerSideEncryptionKMS), }) }) if err == nil { @@ -163,22 +163,22 @@ func TestClient_S3s(t *testing.T) { _, err = c.CreateS3(&CreateS3Input{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-s3"), - BucketName: String("bucket-name"), - Domain: String("s3.us-east-1.amazonaws.com"), - IAMRole: String("badarn"), - Path: String("/path"), - Period: Int(12), - CompressionCodec: String("snappy"), - Format: String("format"), - FormatVersion: Int(2), - TimestampFormat: String("%Y"), - MessageType: String("classic"), - Redundancy: S3RedundancyPtr(S3RedundancyReduced), - Placement: String("waf_debug"), - PublicKey: String(pgpPublicKey()), - ServerSideEncryptionKMSKeyID: String("1234"), - ServerSideEncryption: S3ServerSideEncryptionPtr(S3ServerSideEncryptionKMS), + Name: ToPointer("test-s3"), + BucketName: ToPointer("bucket-name"), + Domain: ToPointer("s3.us-east-1.amazonaws.com"), + IAMRole: ToPointer("badarn"), + Path: ToPointer("/path"), + Period: ToPointer(12), + CompressionCodec: ToPointer("snappy"), + Format: ToPointer("format"), + FormatVersion: ToPointer(2), + TimestampFormat: ToPointer("%Y"), + MessageType: ToPointer("classic"), + Redundancy: ToPointer(S3RedundancyReduced), + Placement: ToPointer("waf_debug"), + PublicKey: ToPointer(pgpPublicKey()), + ServerSideEncryptionKMSKeyID: ToPointer("1234"), + ServerSideEncryption: ToPointer(S3ServerSideEncryptionKMS), }) }) if err == nil { @@ -191,24 +191,24 @@ func TestClient_S3s(t *testing.T) { _, err = c.CreateS3(&CreateS3Input{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-s3-2"), - BucketName: String("bucket-name"), - Domain: String("s3.us-east-1.amazonaws.com"), - AccessKey: String("AKIAIOSFODNN7EXAMPLE"), - SecretKey: String("wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"), - Path: String("/path"), - Period: Int(12), - CompressionCodec: String("snappy"), - GzipLevel: Int(8), - Format: String("format"), - FormatVersion: Int(2), - TimestampFormat: String("%Y"), - MessageType: String("classic"), - Redundancy: S3RedundancyPtr(S3RedundancyReduced), - Placement: String("waf_debug"), - PublicKey: String(pgpPublicKey()), - ServerSideEncryptionKMSKeyID: String("1234"), - ServerSideEncryption: S3ServerSideEncryptionPtr(S3ServerSideEncryptionKMS), + Name: ToPointer("test-s3-2"), + BucketName: ToPointer("bucket-name"), + Domain: ToPointer("s3.us-east-1.amazonaws.com"), + AccessKey: ToPointer("AKIAIOSFODNN7EXAMPLE"), + SecretKey: ToPointer("wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"), + Path: ToPointer("/path"), + Period: ToPointer(12), + CompressionCodec: ToPointer("snappy"), + GzipLevel: ToPointer(8), + Format: ToPointer("format"), + FormatVersion: ToPointer(2), + TimestampFormat: ToPointer("%Y"), + MessageType: ToPointer("classic"), + Redundancy: ToPointer(S3RedundancyReduced), + Placement: ToPointer("waf_debug"), + PublicKey: ToPointer(pgpPublicKey()), + ServerSideEncryptionKMSKeyID: ToPointer("1234"), + ServerSideEncryption: ToPointer(S3ServerSideEncryptionKMS), }) }) if err == nil { @@ -470,10 +470,10 @@ func TestClient_S3s(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-s3", - NewName: String("new-test-s3"), - PublicKey: String(pgpPublicKeyUpdate()), - CompressionCodec: String("zstd"), - FileMaxBytes: Int(5 * MiB), + NewName: ToPointer("new-test-s3"), + PublicKey: ToPointer(pgpPublicKeyUpdate()), + CompressionCodec: ToPointer("zstd"), + FileMaxBytes: ToPointer(5 * MiB), }) }) if err != nil { @@ -487,7 +487,7 @@ func TestClient_S3s(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-s3-2", - CompressionCodec: String("zstd"), + CompressionCodec: ToPointer("zstd"), }) }) if err != nil { @@ -501,7 +501,7 @@ func TestClient_S3s(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-s3-3", - GzipLevel: Int(9), + GzipLevel: ToPointer(9), }) }) if err != nil { @@ -515,9 +515,9 @@ func TestClient_S3s(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "new-test-s3", - AccessKey: String(""), - SecretKey: String(""), - IAMRole: String("arn:aws:iam::123456789012:role/S3Access"), + AccessKey: ToPointer(""), + SecretKey: ToPointer(""), + IAMRole: ToPointer("arn:aws:iam::123456789012:role/S3Access"), }) }) if err != nil { @@ -531,9 +531,9 @@ func TestClient_S3s(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-s3-4", - AccessKey: String("AKIAIOSFODNN7EXAMPLE"), - SecretKey: String("wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"), - IAMRole: String(""), + AccessKey: ToPointer("AKIAIOSFODNN7EXAMPLE"), + SecretKey: ToPointer("wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"), + IAMRole: ToPointer(""), }) }) if err != nil { @@ -547,7 +547,7 @@ func TestClient_S3s(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-s3", - IAMRole: String("badarn"), + IAMRole: ToPointer("badarn"), }) }) if err == nil { @@ -636,9 +636,9 @@ func TestClient_CreateS3_validation(t *testing.T) { var err error _, err = testClient.CreateS3(&CreateS3Input{ - Name: String("test-service"), - ServerSideEncryption: S3ServerSideEncryptionPtr(S3ServerSideEncryptionKMS), - ServerSideEncryptionKMSKeyID: String("1234"), + Name: ToPointer("test-service"), + ServerSideEncryption: ToPointer(S3ServerSideEncryptionKMS), + ServerSideEncryptionKMSKeyID: ToPointer("1234"), ServiceVersion: 1, }) if err != ErrMissingServiceID { @@ -646,9 +646,9 @@ func TestClient_CreateS3_validation(t *testing.T) { } _, err = testClient.CreateS3(&CreateS3Input{ - Name: String("test-service"), - ServerSideEncryption: S3ServerSideEncryptionPtr(S3ServerSideEncryptionKMS), - ServerSideEncryptionKMSKeyID: String("1234"), + Name: ToPointer("test-service"), + ServerSideEncryption: ToPointer(S3ServerSideEncryptionKMS), + ServerSideEncryptionKMSKeyID: ToPointer("1234"), ServiceID: "foo", }) if err != ErrMissingServiceVersion { @@ -656,9 +656,9 @@ func TestClient_CreateS3_validation(t *testing.T) { } _, err = testClient.CreateS3(&CreateS3Input{ - Name: String("test-service"), - ServerSideEncryption: S3ServerSideEncryptionPtr(S3ServerSideEncryptionKMS), - ServerSideEncryptionKMSKeyID: String(""), + Name: ToPointer("test-service"), + ServerSideEncryption: ToPointer(S3ServerSideEncryptionKMS), + ServerSideEncryptionKMSKeyID: ToPointer(""), ServiceID: "foo", ServiceVersion: 1, }) @@ -724,8 +724,8 @@ func TestClient_UpdateS3_validation(t *testing.T) { _, err = testClient.UpdateS3(&UpdateS3Input{ Name: "test-service", - ServerSideEncryption: S3ServerSideEncryptionPtr(S3ServerSideEncryptionKMS), - ServerSideEncryptionKMSKeyID: String(""), + ServerSideEncryption: ToPointer(S3ServerSideEncryptionKMS), + ServerSideEncryptionKMSKeyID: ToPointer(""), ServiceID: "foo", ServiceVersion: 1, }) diff --git a/fastly/scalyr_test.go b/fastly/scalyr_test.go index 2b50759df..773f93d33 100644 --- a/fastly/scalyr_test.go +++ b/fastly/scalyr_test.go @@ -19,12 +19,12 @@ func TestClient_Scalyrs(t *testing.T) { s, err = c.CreateScalyr(&CreateScalyrInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-scalyr"), - Format: String("%h %l %u %t \"%r\" %>s %b"), - FormatVersion: Int(2), - Placement: String("waf_debug"), - Region: String("US"), - Token: String("super-secure-token"), + Name: ToPointer("test-scalyr"), + Format: ToPointer("%h %l %u %t \"%r\" %>s %b"), + FormatVersion: ToPointer(2), + Placement: ToPointer("waf_debug"), + Region: ToPointer("US"), + Token: ToPointer("super-secure-token"), }) }) if err != nil { @@ -120,9 +120,9 @@ func TestClient_Scalyrs(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-scalyr", - NewName: String("new-test-scalyr"), - Region: String("EU"), - Token: String("new-token"), + NewName: ToPointer("new-test-scalyr"), + Region: ToPointer("EU"), + Token: ToPointer("new-token"), }) }) if err != nil { diff --git a/fastly/server_test.go b/fastly/server_test.go index 57beb5158..23c376fc3 100644 --- a/fastly/server_test.go +++ b/fastly/server_test.go @@ -20,7 +20,7 @@ func TestClient_Servers(t *testing.T) { server, err = c.CreateServer(&CreateServerInput{ ServiceID: testServiceID, PoolID: testPool.ID, - Address: String("127.0.0.1"), + Address: ToPointer("127.0.0.1"), }) if err != nil { t.Fatal(err) @@ -30,7 +30,7 @@ func TestClient_Servers(t *testing.T) { altServer, err = c.CreateServer(&CreateServerInput{ ServiceID: testServiceID, PoolID: testPool.ID, - Address: String("altserver.example.com"), + Address: ToPointer("altserver.example.com"), }) if err != nil { t.Fatal(err) @@ -109,8 +109,8 @@ func TestClient_Servers(t *testing.T) { ServiceID: testServiceID, PoolID: testPool.ID, Server: server.ID, - Address: String("0.0.0.0"), - Weight: Int(50), + Address: ToPointer("0.0.0.0"), + Weight: ToPointer(50), }) }) if err != nil { diff --git a/fastly/service_test.go b/fastly/service_test.go index 105524829..a5789907d 100644 --- a/fastly/service_test.go +++ b/fastly/service_test.go @@ -13,8 +13,8 @@ func TestClient_Services(t *testing.T) { var s *Service record(t, "services/create", func(c *Client) { s, err = c.CreateService(&CreateServiceInput{ - Name: String("test-service"), - Comment: String("comment"), + Name: ToPointer("test-service"), + Comment: ToPointer("comment"), }) }) if err != nil { @@ -150,7 +150,7 @@ func TestClient_Services(t *testing.T) { record(t, "services/update", func(c *Client) { us, err = c.UpdateService(&UpdateServiceInput{ ServiceID: s.ID, - Name: String("new-test-service"), + Name: ToPointer("new-test-service"), }) }) if err != nil { diff --git a/fastly/settings_test.go b/fastly/settings_test.go index 17d414f9c..434a2951a 100644 --- a/fastly/settings_test.go +++ b/fastly/settings_test.go @@ -37,8 +37,8 @@ func TestClient_Settings(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, DefaultTTL: 1800, - StaleIfError: Bool(true), - StaleIfErrorTTL: Uint(57600), + StaleIfError: ToPointer(true), + StaleIfErrorTTL: ToPointer(uint(57600)), }) }) if err != nil { diff --git a/fastly/sftp_test.go b/fastly/sftp_test.go index 20fdc7ba3..b47b30967 100644 --- a/fastly/sftp_test.go +++ b/fastly/sftp_test.go @@ -21,22 +21,22 @@ func TestClient_SFTPs(t *testing.T) { sftpCreateResp1, err = c.CreateSFTP(&CreateSFTPInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-sftp"), - Address: String("example.com"), - Port: Int(1234), - PublicKey: String(pgpPublicKey()), - SecretKey: String(privateKey()), - SSHKnownHosts: String(knownHosts), - User: String("username"), - Password: String("password"), - Path: String("/dir"), - Period: Int(12), - CompressionCodec: String("snappy"), - FormatVersion: Int(2), - Format: String("format"), - MessageType: String("blank"), - TimestampFormat: String("%Y"), - Placement: String("waf_debug"), + Name: ToPointer("test-sftp"), + Address: ToPointer("example.com"), + Port: ToPointer(1234), + PublicKey: ToPointer(pgpPublicKey()), + SecretKey: ToPointer(privateKey()), + SSHKnownHosts: ToPointer(knownHosts), + User: ToPointer("username"), + Password: ToPointer("password"), + Path: ToPointer("/dir"), + Period: ToPointer(12), + CompressionCodec: ToPointer("snappy"), + FormatVersion: ToPointer(2), + Format: ToPointer("format"), + MessageType: ToPointer("blank"), + TimestampFormat: ToPointer("%Y"), + Placement: ToPointer("waf_debug"), }) }) if err != nil { @@ -47,22 +47,22 @@ func TestClient_SFTPs(t *testing.T) { sftpCreateResp2, err = c.CreateSFTP(&CreateSFTPInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-sftp-2"), - Address: String("example.com"), - Port: Int(1234), - PublicKey: String(pgpPublicKey()), - SecretKey: String(privateKey()), - SSHKnownHosts: String(knownHosts), - User: String("username"), - Password: String("password"), - Path: String("/dir"), - Period: Int(12), - GzipLevel: Int(8), - FormatVersion: Int(2), - Format: String("format"), - MessageType: String("blank"), - TimestampFormat: String("%Y"), - Placement: String("waf_debug"), + Name: ToPointer("test-sftp-2"), + Address: ToPointer("example.com"), + Port: ToPointer(1234), + PublicKey: ToPointer(pgpPublicKey()), + SecretKey: ToPointer(privateKey()), + SSHKnownHosts: ToPointer(knownHosts), + User: ToPointer("username"), + Password: ToPointer("password"), + Path: ToPointer("/dir"), + Period: ToPointer(12), + GzipLevel: ToPointer(8), + FormatVersion: ToPointer(2), + Format: ToPointer("format"), + MessageType: ToPointer("blank"), + TimestampFormat: ToPointer("%Y"), + Placement: ToPointer("waf_debug"), }) }) if err != nil { @@ -73,22 +73,22 @@ func TestClient_SFTPs(t *testing.T) { sftpCreateResp3, err = c.CreateSFTP(&CreateSFTPInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-sftp-3"), - Address: String("example.com"), - Port: Int(1234), - PublicKey: String(pgpPublicKey()), - SecretKey: String(privateKey()), - SSHKnownHosts: String(knownHosts), - User: String("username"), - Password: String("password"), - Path: String("/dir"), - Period: Int(12), - CompressionCodec: String("snappy"), - FormatVersion: Int(2), - Format: String("format"), - MessageType: String("blank"), - TimestampFormat: String("%Y"), - Placement: String("waf_debug"), + Name: ToPointer("test-sftp-3"), + Address: ToPointer("example.com"), + Port: ToPointer(1234), + PublicKey: ToPointer(pgpPublicKey()), + SecretKey: ToPointer(privateKey()), + SSHKnownHosts: ToPointer(knownHosts), + User: ToPointer("username"), + Password: ToPointer("password"), + Path: ToPointer("/dir"), + Period: ToPointer(12), + CompressionCodec: ToPointer("snappy"), + FormatVersion: ToPointer(2), + Format: ToPointer("format"), + MessageType: ToPointer("blank"), + TimestampFormat: ToPointer("%Y"), + Placement: ToPointer("waf_debug"), }) }) if err != nil { @@ -101,23 +101,23 @@ func TestClient_SFTPs(t *testing.T) { _, err = c.CreateSFTP(&CreateSFTPInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-sftp-4"), - Address: String("example.com"), - Port: Int(1234), - PublicKey: String(pgpPublicKey()), - SecretKey: String(privateKey()), - SSHKnownHosts: String(knownHosts), - User: String("username"), - Password: String("password"), - Path: String("/dir"), - Period: Int(12), - CompressionCodec: String("snappy"), - GzipLevel: Int(8), - FormatVersion: Int(2), - Format: String("format"), - MessageType: String("blank"), - TimestampFormat: String("%Y"), - Placement: String("waf_debug"), + Name: ToPointer("test-sftp-4"), + Address: ToPointer("example.com"), + Port: ToPointer(1234), + PublicKey: ToPointer(pgpPublicKey()), + SecretKey: ToPointer(privateKey()), + SSHKnownHosts: ToPointer(knownHosts), + User: ToPointer("username"), + Password: ToPointer("password"), + Path: ToPointer("/dir"), + Period: ToPointer(12), + CompressionCodec: ToPointer("snappy"), + GzipLevel: ToPointer(8), + FormatVersion: ToPointer(2), + Format: ToPointer("format"), + MessageType: ToPointer("blank"), + TimestampFormat: ToPointer("%Y"), + Placement: ToPointer("waf_debug"), }) }) if err == nil { @@ -305,9 +305,9 @@ func TestClient_SFTPs(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-sftp", - NewName: String("new-test-sftp"), - GzipLevel: Int(8), - MessageType: String("classic"), + NewName: ToPointer("new-test-sftp"), + GzipLevel: ToPointer(8), + MessageType: ToPointer("classic"), }) }) if err != nil { @@ -319,7 +319,7 @@ func TestClient_SFTPs(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-sftp-2", - CompressionCodec: String("zstd"), + CompressionCodec: ToPointer("zstd"), }) }) if err != nil { @@ -331,7 +331,7 @@ func TestClient_SFTPs(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-sftp-3", - GzipLevel: Int(9), + GzipLevel: ToPointer(9), }) }) if err != nil { diff --git a/fastly/splunk_test.go b/fastly/splunk_test.go index 0f8701a19..ad9812f8b 100644 --- a/fastly/splunk_test.go +++ b/fastly/splunk_test.go @@ -40,19 +40,19 @@ Wm7DCfrPNGVwFWUQOmsPue9rZBgO s, err = c.CreateSplunk(&CreateSplunkInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-splunk"), - URL: String("https://mysplunkendpoint.example.com/services/collector/event"), - RequestMaxEntries: Int(1), - RequestMaxBytes: Int(1000), - Format: String("%h %l %u %t \"%r\" %>s %b"), - FormatVersion: Int(2), - Placement: String("waf_debug"), - Token: String("super-secure-token"), - UseTLS: CBool(true), - TLSCACert: String(caCert), - TLSHostname: String("example.com"), - TLSClientCert: String(clientCert), - TLSClientKey: String(clientKey), + Name: ToPointer("test-splunk"), + URL: ToPointer("https://mysplunkendpoint.example.com/services/collector/event"), + RequestMaxEntries: ToPointer(1), + RequestMaxBytes: ToPointer(1000), + Format: ToPointer("%h %l %u %t \"%r\" %>s %b"), + FormatVersion: ToPointer(2), + Placement: ToPointer("waf_debug"), + Token: ToPointer("super-secure-token"), + UseTLS: ToPointer(Compatibool(true)), + TLSCACert: ToPointer(caCert), + TLSHostname: ToPointer("example.com"), + TLSClientCert: ToPointer(clientCert), + TLSClientKey: ToPointer(clientKey), }) }) if err != nil { @@ -190,7 +190,7 @@ Wm7DCfrPNGVwFWUQOmsPue9rZBgO ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-splunk", - NewName: String("new-test-splunk"), + NewName: ToPointer("new-test-splunk"), }) }) if err != nil { diff --git a/fastly/sumologic_test.go b/fastly/sumologic_test.go index ae7234f88..d6c37c327 100644 --- a/fastly/sumologic_test.go +++ b/fastly/sumologic_test.go @@ -19,12 +19,12 @@ func TestClient_Sumologics(t *testing.T) { s, err = c.CreateSumologic(&CreateSumologicInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-sumologic"), - URL: String("https://foo.sumologic.com"), - Format: String("format"), - FormatVersion: Int(1), - MessageType: String("classic"), - Placement: String("waf_debug"), + Name: ToPointer("test-sumologic"), + URL: ToPointer("https://foo.sumologic.com"), + Format: ToPointer("format"), + FormatVersion: ToPointer(1), + MessageType: ToPointer("classic"), + Placement: ToPointer("waf_debug"), }) }) if err != nil { @@ -120,7 +120,7 @@ func TestClient_Sumologics(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-sumologic", - NewName: String("new-test-sumologic"), + NewName: ToPointer("new-test-sumologic"), }) }) if err != nil { diff --git a/fastly/syslog_test.go b/fastly/syslog_test.go index f9715228e..98186d3b0 100644 --- a/fastly/syslog_test.go +++ b/fastly/syslog_test.go @@ -40,20 +40,20 @@ Wm7DCfrPNGVwFWUQOmsPue9rZBgO s, err = c.CreateSyslog(&CreateSyslogInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-syslog"), - Address: String("example.com"), - Hostname: String("example.com"), - Port: Int(1234), - UseTLS: CBool(true), - TLSCACert: String(caCert), - TLSHostname: String("example.com"), - TLSClientCert: String(clientCert), - TLSClientKey: String(clientKey), - Token: String("abcd1234"), - Format: String("format"), - FormatVersion: Int(2), - MessageType: String("classic"), - Placement: String("waf_debug"), + Name: ToPointer("test-syslog"), + Address: ToPointer("example.com"), + Hostname: ToPointer("example.com"), + Port: ToPointer(1234), + UseTLS: ToPointer(Compatibool(true)), + TLSCACert: ToPointer(caCert), + TLSHostname: ToPointer("example.com"), + TLSClientCert: ToPointer(clientCert), + TLSClientKey: ToPointer(clientKey), + Token: ToPointer("abcd1234"), + Format: ToPointer("format"), + FormatVersion: ToPointer(2), + MessageType: ToPointer("classic"), + Placement: ToPointer("waf_debug"), }) }) if err != nil { @@ -197,8 +197,8 @@ Wm7DCfrPNGVwFWUQOmsPue9rZBgO ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-syslog", - NewName: String("new-test-syslog"), - FormatVersion: Int(2), + NewName: ToPointer("new-test-syslog"), + FormatVersion: ToPointer(2), }) }) if err != nil { diff --git a/fastly/tls_subscription_test.go b/fastly/tls_subscription_test.go index 0339fde51..934cedfb3 100644 --- a/fastly/tls_subscription_test.go +++ b/fastly/tls_subscription_test.go @@ -38,8 +38,8 @@ func TestClient_TLSSubscription(t *testing.T) { _, err = c.CreateDomain(&CreateDomainInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String(domain1), - Comment: String("comment"), + Name: ToPointer(domain1), + Comment: ToPointer("comment"), }) }) if err != nil { @@ -50,8 +50,8 @@ func TestClient_TLSSubscription(t *testing.T) { _, err = c.CreateDomain(&CreateDomainInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String(domain2), - Comment: String("comment"), + Name: ToPointer(domain2), + Comment: ToPointer("comment"), }) }) if err != nil { diff --git a/fastly/user_test.go b/fastly/user_test.go index 0ae67c246..ead302f6e 100644 --- a/fastly/user_test.go +++ b/fastly/user_test.go @@ -31,9 +31,9 @@ func TestClient_Users(t *testing.T) { var u *User record(t, fixtureBase+"create", func(c *Client) { u, err = c.CreateUser(&CreateUserInput{ - Login: String(login), - Name: String("test user"), - Role: String("engineer"), + Login: ToPointer(login), + Name: ToPointer("test user"), + Role: ToPointer("engineer"), }) }) if err != nil { @@ -94,8 +94,8 @@ func TestClient_Users(t *testing.T) { record(t, fixtureBase+"update", func(c *Client) { uu, err = c.UpdateUser(&UpdateUserInput{ ID: u.ID, - Name: String("updated user"), - Role: String("superuser"), + Name: ToPointer("updated user"), + Role: ToPointer("superuser"), }) }) if err != nil { diff --git a/fastly/vcl_snippets_test.go b/fastly/vcl_snippets_test.go index ebb0817ff..ab13b22f3 100644 --- a/fastly/vcl_snippets_test.go +++ b/fastly/vcl_snippets_test.go @@ -27,9 +27,9 @@ func TestClient_Snippets(t *testing.T) { record(t, "vcl_snippets/create_with_required_fields_only", func(c *Client) { cs, err = c.CreateSnippet(&CreateSnippetInput{ - Content: String(vclContent), - Dynamic: Int(0), - Name: String(svName), + Content: ToPointer(vclContent), + Dynamic: ToPointer(0), + Name: ToPointer(svName), ServiceID: testServiceID, ServiceVersion: tv.Number, Type: SnippetTypePtr(SnippetTypeFetch), @@ -65,11 +65,11 @@ func TestClient_Snippets(t *testing.T) { cs, err = c.CreateSnippet(&CreateSnippetInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String(sdName), - Content: String(vclContent), + Name: ToPointer(sdName), + Content: ToPointer(vclContent), Type: SnippetTypePtr(SnippetTypeFetch), - Dynamic: Int(dynamic), - Priority: Int(priority), + Dynamic: ToPointer(dynamic), + Priority: ToPointer(priority), }) }) @@ -200,9 +200,9 @@ func TestClient_Snippets(t *testing.T) { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: svName, - NewName: String(svNameUpdated), - Priority: Int(priority), - Content: String(vclContentUpdated), + NewName: ToPointer(svNameUpdated), + Priority: ToPointer(priority), + Content: ToPointer(vclContentUpdated), Type: &hit, }) }) @@ -233,7 +233,7 @@ func TestClient_Snippets(t *testing.T) { ds, err = c.UpdateDynamicSnippet(&UpdateDynamicSnippetInput{ ServiceID: testServiceID, ID: cs.ID, - Content: String(vclContentUpdated), + Content: ToPointer(vclContentUpdated), }) }) diff --git a/fastly/vcl_test.go b/fastly/vcl_test.go index 93d7fd946..015661eed 100644 --- a/fastly/vcl_test.go +++ b/fastly/vcl_test.go @@ -40,8 +40,8 @@ sub vcl_hash { vcl, err = c.CreateVCL(&CreateVCLInput{ ServiceID: testServiceID, ServiceVersion: tv.Number, - Name: String("test-vcl"), - Content: String(content), + Name: ToPointer("test-vcl"), + Content: ToPointer(content), }) }) if err != nil { @@ -113,7 +113,7 @@ sub vcl_hash { ServiceID: testServiceID, ServiceVersion: tv.Number, Name: "test-vcl", - NewName: String("new-test-vcl"), + NewName: ToPointer("new-test-vcl"), }) }) if err != nil { diff --git a/fastly/version_test.go b/fastly/version_test.go index d36b4733d..2a38122e6 100644 --- a/fastly/version_test.go +++ b/fastly/version_test.go @@ -18,7 +18,7 @@ func TestClient_Versions(t *testing.T) { record(t, "versions/create", func(c *Client) { v, err = c.CreateVersion(&CreateVersionInput{ ServiceID: testServiceID, - Comment: String("test comment"), + Comment: ToPointer("test comment"), }) }) if err != nil { @@ -72,7 +72,7 @@ func TestClient_Versions(t *testing.T) { uv, err = c.UpdateVersion(&UpdateVersionInput{ ServiceID: testServiceID, ServiceVersion: v.Number, - Comment: String("new comment"), + Comment: ToPointer("new comment"), }) }) if err != nil { diff --git a/fastly/waf_test.go b/fastly/waf_test.go index bb3540d0c..748b05808 100644 --- a/fastly/waf_test.go +++ b/fastly/waf_test.go @@ -115,7 +115,7 @@ func TestClient_WAFs(t *testing.T) { record(t, fixtureBase+"/disable", func(c *Client) { dwaf, err = c.UpdateWAF(&UpdateWAFInput{ ID: waf.ID, - Disabled: Bool(true), + Disabled: ToPointer(true), }) }) if err != nil { @@ -129,7 +129,7 @@ func TestClient_WAFs(t *testing.T) { record(t, fixtureBase+"/enable", func(c *Client) { ewaf, err = c.UpdateWAF(&UpdateWAFInput{ ID: waf.ID, - Disabled: Bool(false), + Disabled: ToPointer(false), }) }) if err != nil { @@ -245,7 +245,7 @@ func TestClient_UpdateWAF_Enable_validation(t *testing.T) { var err error _, err = testClient.UpdateWAF(&UpdateWAFInput{ ID: "", - Disabled: Bool(false), + Disabled: ToPointer(false), }) if err != ErrMissingID { t.Errorf("bad error: %s", err) @@ -256,7 +256,7 @@ func TestClient_UpdateWAF_Disable_validation(t *testing.T) { var err error _, err = testClient.UpdateWAF(&UpdateWAFInput{ ID: "", - Disabled: Bool(true), + Disabled: ToPointer(true), }) if err != ErrMissingID { t.Errorf("bad error: %s", err)