From d52387ac00c5cd5380d735de8c01102d828114cf Mon Sep 17 00:00:00 2001 From: Matin Rahmanian Date: Wed, 19 May 2021 11:49:36 +0200 Subject: [PATCH] Make forgotten URIs formatting style consistent --- firewall.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/firewall.go b/firewall.go index 1fc84d1e84b..cbf78da5bbf 100644 --- a/firewall.go +++ b/firewall.go @@ -101,7 +101,7 @@ func (api *API) DeleteUserAccessRule(ctx context.Context, accessRuleID string) ( // // API reference: https://api.cloudflare.com/#firewall-access-rule-for-a-zone-list-access-rules func (api *API) ListZoneAccessRules(ctx context.Context, zoneID string, accessRule AccessRule, page int) (*AccessRuleListResponse, error) { - return api.listAccessRules(ctx, "/zones/"+zoneID, accessRule, page) + return api.listAccessRules(ctx, fmt.Sprintf("/zones/%s", zoneID), accessRule, page) } // CreateZoneAccessRule creates a firewall access rule for the given zone @@ -109,14 +109,14 @@ func (api *API) ListZoneAccessRules(ctx context.Context, zoneID string, accessRu // // API reference: https://api.cloudflare.com/#firewall-access-rule-for-a-zone-create-access-rule func (api *API) CreateZoneAccessRule(ctx context.Context, zoneID string, accessRule AccessRule) (*AccessRuleResponse, error) { - return api.createAccessRule(ctx, "/zones/"+zoneID, accessRule) + return api.createAccessRule(ctx, fmt.Sprintf("/zones/%s", zoneID), accessRule) } // ZoneAccessRule returns the details of a zone's access rule. // // API reference: https://api.cloudflare.com/#firewall-access-rule-for-a-zone-list-access-rules func (api *API) ZoneAccessRule(ctx context.Context, zoneID string, accessRuleID string) (*AccessRuleResponse, error) { - return api.retrieveAccessRule(ctx, "/zones/"+zoneID, accessRuleID) + return api.retrieveAccessRule(ctx, fmt.Sprintf("/zones/%s", zoneID), accessRuleID) } // UpdateZoneAccessRule updates a single access rule for the given zone & @@ -124,7 +124,7 @@ func (api *API) ZoneAccessRule(ctx context.Context, zoneID string, accessRuleID // // API reference: https://api.cloudflare.com/#firewall-access-rule-for-a-zone-update-access-rule func (api *API) UpdateZoneAccessRule(ctx context.Context, zoneID, accessRuleID string, accessRule AccessRule) (*AccessRuleResponse, error) { - return api.updateAccessRule(ctx, "/zones/"+zoneID, accessRuleID, accessRule) + return api.updateAccessRule(ctx, fmt.Sprintf("/zones/%s", zoneID), accessRuleID, accessRule) } // DeleteZoneAccessRule deletes a single access rule for the given zone and @@ -132,7 +132,7 @@ func (api *API) UpdateZoneAccessRule(ctx context.Context, zoneID, accessRuleID s // // API reference: https://api.cloudflare.com/#firewall-access-rule-for-a-zone-delete-access-rule func (api *API) DeleteZoneAccessRule(ctx context.Context, zoneID, accessRuleID string) (*AccessRuleResponse, error) { - return api.deleteAccessRule(ctx, "/zones/"+zoneID, accessRuleID) + return api.deleteAccessRule(ctx, fmt.Sprintf("/zones/%s", zoneID), accessRuleID) } // ListAccountAccessRules returns a slice of access rules for the given @@ -142,7 +142,7 @@ func (api *API) DeleteZoneAccessRule(ctx context.Context, zoneID, accessRuleID s // // API reference: https://api.cloudflare.com/#account-level-firewall-access-rule-list-access-rules func (api *API) ListAccountAccessRules(ctx context.Context, accountID string, accessRule AccessRule, page int) (*AccessRuleListResponse, error) { - return api.listAccessRules(ctx, "/accounts/"+accountID, accessRule, page) + return api.listAccessRules(ctx, fmt.Sprintf("/accounts/%s", accountID), accessRule, page) } // CreateAccountAccessRule creates a firewall access rule for the given @@ -150,14 +150,14 @@ func (api *API) ListAccountAccessRules(ctx context.Context, accountID string, ac // // API reference: https://api.cloudflare.com/#account-level-firewall-access-rule-create-access-rule func (api *API) CreateAccountAccessRule(ctx context.Context, accountID string, accessRule AccessRule) (*AccessRuleResponse, error) { - return api.createAccessRule(ctx, "/accounts/"+accountID, accessRule) + return api.createAccessRule(ctx, fmt.Sprintf("/accounts/%s", accountID), accessRule) } // AccountAccessRule returns the details of an account's access rule. // // API reference: https://api.cloudflare.com/#account-level-firewall-access-rule-access-rule-details func (api *API) AccountAccessRule(ctx context.Context, accountID string, accessRuleID string) (*AccessRuleResponse, error) { - return api.retrieveAccessRule(ctx, "/accounts/"+accountID, accessRuleID) + return api.retrieveAccessRule(ctx, fmt.Sprintf("/accounts/%s", accountID), accessRuleID) } // UpdateAccountAccessRule updates a single access rule for the given @@ -165,7 +165,7 @@ func (api *API) AccountAccessRule(ctx context.Context, accountID string, accessR // // API reference: https://api.cloudflare.com/#account-level-firewall-access-rule-update-access-rule func (api *API) UpdateAccountAccessRule(ctx context.Context, accountID, accessRuleID string, accessRule AccessRule) (*AccessRuleResponse, error) { - return api.updateAccessRule(ctx, "/accounts/"+accountID, accessRuleID, accessRule) + return api.updateAccessRule(ctx, fmt.Sprintf("/accounts/%s", accountID), accessRuleID, accessRule) } // DeleteAccountAccessRule deletes a single access rule for the given @@ -173,7 +173,7 @@ func (api *API) UpdateAccountAccessRule(ctx context.Context, accountID, accessRu // // API reference: https://api.cloudflare.com/#account-level-firewall-access-rule-delete-access-rule func (api *API) DeleteAccountAccessRule(ctx context.Context, accountID, accessRuleID string) (*AccessRuleResponse, error) { - return api.deleteAccessRule(ctx, "/accounts/"+accountID, accessRuleID) + return api.deleteAccessRule(ctx, fmt.Sprintf("/accounts/%s", accountID), accessRuleID) } func (api *API) listAccessRules(ctx context.Context, prefix string, accessRule AccessRule, page int) (*AccessRuleListResponse, error) {