Skip to content

Commit

Permalink
Make forgotten URIs formatting style consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
itsmatinx committed May 19, 2021
1 parent 0e0a80b commit d52387a
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions firewall.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,38 +101,38 @@ 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
// identifier.
//
// 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 &
// access rule identifiers.
//
// 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
// access rule identifiers.
//
// 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
Expand All @@ -142,38 +142,38 @@ 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
// account identifier.
//
// 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
// account & access rule identifiers.
//
// 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
// account and access rule identifiers.
//
// 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) {
Expand Down

0 comments on commit d52387a

Please sign in to comment.