Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update API documentation URLs #3741

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,7 @@ BREAKING CHANGES:

NOTES:

- pages: removed the v1 logs endpoint for Pages deployments. Please switch to v2: https://developers.cloudflare.com/api/operations/pages-deployment-get-deployment-logs ([#1135](https://github.com/cloudflare/cloudflare-go/issues/1135))
- pages: removed the v1 logs endpoint for Pages deployments. Please switch to v2: https://developers.cloudflare.com/api/resources/pages/subresources/projects/subresources/deployments/subresources/history/subresources/logs/methods/get/ ([#1135](https://github.com/cloudflare/cloudflare-go/issues/1135))

ENHANCEMENTS:

Expand Down
4 changes: 2 additions & 2 deletions access_seats.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ type UpdateAccessUserSeatResponse struct {

// UpdateAccessUserSeat updates a single Access User Seat.
//
// API documentation: https://developers.cloudflare.com/api/operations/zero-trust-seats-update-a-user-seat
// API documentation: https://developers.cloudflare.com/api/resources/zero_trust/subresources/seats/methods/edit/
func (api *API) UpdateAccessUserSeat(ctx context.Context, rc *ResourceContainer, params UpdateAccessUserSeatParams) ([]AccessUpdateAccessUserSeatResult, error) {
if rc.Level != AccountRouteLevel {
return []AccessUpdateAccessUserSeatResult{}, fmt.Errorf(errInvalidResourceContainerAccess, rc.Level)
Expand Down Expand Up @@ -77,7 +77,7 @@ func (api *API) UpdateAccessUserSeat(ctx context.Context, rc *ResourceContainer,

// UpdateAccessUsersSeats updates many Access User Seats.
//
// API documentation: https://developers.cloudflare.com/api/operations/zero-trust-seats-update-a-user-seat
// API documentation: https://developers.cloudflare.com/api/resources/zero_trust/subresources/seats/methods/edit/
func (api *API) UpdateAccessUsersSeats(ctx context.Context, rc *ResourceContainer, params UpdateAccessUsersSeatsParams) ([]AccessUpdateAccessUserSeatResult, error) {
if rc.Level != AccountRouteLevel {
return []AccessUpdateAccessUserSeatResult{}, fmt.Errorf(errInvalidResourceContainerAccess, rc.Level)
Expand Down
10 changes: 5 additions & 5 deletions access_users.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ type GetAccessUserSingleActiveSessionResult struct {

// ListAccessUsers returns a list of users for a single cloudflare access/zerotrust account.
//
// API documentation: https://developers.cloudflare.com/api/operations/zero-trust-users-get-users
// API documentation: https://developers.cloudflare.com/api/resources/zero_trust/subresources/access/subresources/users/methods/list/
func (api *API) ListAccessUsers(ctx context.Context, rc *ResourceContainer, params AccessUserParams) ([]AccessUser, *ResultInfo, error) {
if rc.Level != AccountRouteLevel {
return []AccessUser{}, &ResultInfo{}, fmt.Errorf(errInvalidResourceContainerAccess, rc.Level)
Expand Down Expand Up @@ -250,7 +250,7 @@ func (api *API) ListAccessUsers(ctx context.Context, rc *ResourceContainer, para

// GetAccessUserActiveSessions returns a list of active sessions for an user.
//
// API documentation: https://developers.cloudflare.com/api/operations/zero-trust-users-get-active-sessions
// API documentation: https://developers.cloudflare.com/api/resources/zero_trust/subresources/access/subresources/users/subresources/active_sessions/methods/list/
func (api *API) GetAccessUserActiveSessions(ctx context.Context, rc *ResourceContainer, userID string) ([]AccessUserActiveSessionResult, error) {
if rc.Level != AccountRouteLevel {
return []AccessUserActiveSessionResult{}, fmt.Errorf(errInvalidResourceContainerAccess, rc.Level)
Expand Down Expand Up @@ -278,7 +278,7 @@ func (api *API) GetAccessUserActiveSessions(ctx context.Context, rc *ResourceCon

// GetAccessUserSingleActiveSession returns a single active session for a user.
//
// API documentation: https://developers.cloudflare.com/api/operations/zero-trust-users-get-active-session
// API documentation: https://developers.cloudflare.com/api/resources/zero_trust/subresources/access/subresources/users/subresources/active_sessions/methods/get/
func (api *API) GetAccessUserSingleActiveSession(ctx context.Context, rc *ResourceContainer, userID string, sessionID string) (GetAccessUserSingleActiveSessionResult, error) {
if rc.Level != AccountRouteLevel {
return GetAccessUserSingleActiveSessionResult{}, fmt.Errorf(errInvalidResourceContainerAccess, rc.Level)
Expand Down Expand Up @@ -307,7 +307,7 @@ func (api *API) GetAccessUserSingleActiveSession(ctx context.Context, rc *Resour

// GetAccessUserFailedLogins returns a list of failed logins for a user.
//
// API documentation: https://developers.cloudflare.com/api/operations/zero-trust-users-get-failed-logins
// API documentation: https://developers.cloudflare.com/api/resources/zero_trust/subresources/access/subresources/users/subresources/failed_logins/methods/list/
func (api *API) GetAccessUserFailedLogins(ctx context.Context, rc *ResourceContainer, userID string) ([]AccessUserFailedLoginResult, error) {
if rc.Level != AccountRouteLevel {
return []AccessUserFailedLoginResult{}, fmt.Errorf(errInvalidResourceContainerAccess, rc.Level)
Expand Down Expand Up @@ -335,7 +335,7 @@ func (api *API) GetAccessUserFailedLogins(ctx context.Context, rc *ResourceConta

// GetAccessUserLastSeenIdentity returns the last seen identity for a user.
//
// API documentation: https://developers.cloudflare.com/api/operations/zero-trust-users-get-last-seen-identity
// API documentation: https://developers.cloudflare.com/api/resources/zero_trust/subresources/access/subresources/users/subresources/last_seen_identity/methods/get/
func (api *API) GetAccessUserLastSeenIdentity(ctx context.Context, rc *ResourceContainer, userID string) (GetAccessUserLastSeenIdentityResult, error) {
if rc.Level != AccountRouteLevel {
return GetAccessUserLastSeenIdentityResult{}, fmt.Errorf(errInvalidResourceContainerAccess, rc.Level)
Expand Down
4 changes: 2 additions & 2 deletions account_roles.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ type ListAccountRolesParams struct {

// ListAccountRoles returns all roles of an account.
//
// API reference: https://developers.cloudflare.com/api/operations/account-roles-list-roles
// API reference: https://developers.cloudflare.com/api/resources/accounts/subresources/roles/methods/list/
func (api *API) ListAccountRoles(ctx context.Context, rc *ResourceContainer, params ListAccountRolesParams) ([]AccountRole, error) {
if rc.Identifier == "" {
return []AccountRole{}, ErrMissingAccountID
Expand Down Expand Up @@ -89,7 +89,7 @@ func (api *API) ListAccountRoles(ctx context.Context, rc *ResourceContainer, par

// GetAccountRole returns the details of a single account role.
//
// API reference: https://developers.cloudflare.com/api/operations/account-roles-role-details
// API reference: https://developers.cloudflare.com/api/resources/accounts/subresources/roles/methods/get/
func (api *API) GetAccountRole(ctx context.Context, rc *ResourceContainer, roleID string) (AccountRole, error) {
if rc.Identifier == "" {
return AccountRole{}, ErrMissingAccountID
Expand Down
22 changes: 11 additions & 11 deletions addressing_address_map.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ type DeleteIPAddressFromAddressMapParams struct {

// ListAddressMaps lists all address maps owned by the account.
//
// API reference: https://developers.cloudflare.com/api/operations/ip-address-management-address-maps-list-address-maps
// API reference: https://developers.cloudflare.com/api/resources/addressing/subresources/address_maps/methods/list/
func (api *API) ListAddressMaps(ctx context.Context, rc *ResourceContainer, params ListAddressMapsParams) ([]AddressMap, error) {
if rc.Level != AccountRouteLevel {
return []AddressMap{}, ErrRequiredAccountLevelResourceContainer
Expand All @@ -143,7 +143,7 @@ func (api *API) ListAddressMaps(ctx context.Context, rc *ResourceContainer, para

// CreateAddressMap creates a new address map under the account.
//
// API reference: https://developers.cloudflare.com/api/operations/ip-address-management-address-maps-create-address-map
// API reference: https://developers.cloudflare.com/api/resources/addressing/subresources/address_maps/methods/create/
func (api *API) CreateAddressMap(ctx context.Context, rc *ResourceContainer, params CreateAddressMapParams) (AddressMap, error) {
if rc.Level != AccountRouteLevel {
return AddressMap{}, ErrRequiredAccountLevelResourceContainer
Expand All @@ -165,7 +165,7 @@ func (api *API) CreateAddressMap(ctx context.Context, rc *ResourceContainer, par

// GetAddressMap returns a specific address map.
//
// API reference: https://developers.cloudflare.com/api/operations/ip-address-management-address-maps-address-map-details
// API reference: https://developers.cloudflare.com/api/resources/addressing/subresources/address_maps/methods/get/
func (api *API) GetAddressMap(ctx context.Context, rc *ResourceContainer, id string) (AddressMap, error) {
if rc.Level != AccountRouteLevel {
return AddressMap{}, ErrRequiredAccountLevelResourceContainer
Expand All @@ -187,7 +187,7 @@ func (api *API) GetAddressMap(ctx context.Context, rc *ResourceContainer, id str

// UpdateAddressMap modifies properties of an address map owned by the account.
//
// API reference: https://developers.cloudflare.com/api/operations/ip-address-management-address-maps-update-address-map
// API reference: https://developers.cloudflare.com/api/resources/addressing/subresources/address_maps/methods/edit/
func (api *API) UpdateAddressMap(ctx context.Context, rc *ResourceContainer, params UpdateAddressMapParams) (AddressMap, error) {
if rc.Level != AccountRouteLevel {
return AddressMap{}, ErrRequiredAccountLevelResourceContainer
Expand All @@ -209,7 +209,7 @@ func (api *API) UpdateAddressMap(ctx context.Context, rc *ResourceContainer, par

// DeleteAddressMap deletes a particular address map owned by the account.
//
// API reference: https://developers.cloudflare.com/api/operations/ip-address-management-address-maps-delete-address-map
// API reference: https://developers.cloudflare.com/api/resources/addressing/subresources/address_maps/methods/delete/
func (api *API) DeleteAddressMap(ctx context.Context, rc *ResourceContainer, id string) error {
if rc.Level != AccountRouteLevel {
return ErrRequiredAccountLevelResourceContainer
Expand All @@ -222,7 +222,7 @@ func (api *API) DeleteAddressMap(ctx context.Context, rc *ResourceContainer, id

// CreateIPAddressToAddressMap adds an IP address from a prefix owned by the account to a particular address map.
//
// API reference: https://developers.cloudflare.com/api/operations/ip-address-management-address-maps-add-an-ip-to-an-address-map
// API reference: https://developers.cloudflare.com/api/resources/addressing/subresources/address_maps/subresources/ips/methods/update/
func (api *API) CreateIPAddressToAddressMap(ctx context.Context, rc *ResourceContainer, params CreateIPAddressToAddressMapParams) error {
if rc.Level != AccountRouteLevel {
return ErrRequiredAccountLevelResourceContainer
Expand All @@ -235,7 +235,7 @@ func (api *API) CreateIPAddressToAddressMap(ctx context.Context, rc *ResourceCon

// DeleteIPAddressFromAddressMap removes an IP address from a particular address map.
//
// API reference: https://developers.cloudflare.com/api/operations/ip-address-management-address-maps-remove-an-ip-from-an-address-map
// API reference: https://developers.cloudflare.com/api/resources/addressing/subresources/address_maps/subresources/ips/methods/delete/
func (api *API) DeleteIPAddressFromAddressMap(ctx context.Context, rc *ResourceContainer, params DeleteIPAddressFromAddressMapParams) error {
if rc.Level != AccountRouteLevel {
return ErrRequiredAccountLevelResourceContainer
Expand All @@ -249,8 +249,8 @@ func (api *API) DeleteIPAddressFromAddressMap(ctx context.Context, rc *ResourceC
// CreateMembershipToAddressMap adds a zone/account as a member of a particular address map.
//
// API reference:
// - account: https://developers.cloudflare.com/api/operations/ip-address-management-address-maps-add-an-account-membership-to-an-address-map
// - zone: https://developers.cloudflare.com/api/operations/ip-address-management-address-maps-add-a-zone-membership-to-an-address-map
// - account: https://developers.cloudflare.com/api/resources/addressing/subresources/address_maps/subresources/accounts/methods/update/
// - zone: https://developers.cloudflare.com/api/resources/addressing/subresources/address_maps/subresources/zones/methods/update/
func (api *API) CreateMembershipToAddressMap(ctx context.Context, rc *ResourceContainer, params CreateMembershipToAddressMapParams) error {
if rc.Level != AccountRouteLevel {
return ErrRequiredAccountLevelResourceContainer
Expand All @@ -268,8 +268,8 @@ func (api *API) CreateMembershipToAddressMap(ctx context.Context, rc *ResourceCo
// DeleteMembershipFromAddressMap removes a zone/account as a member of a particular address map.
//
// API reference:
// - account: https://developers.cloudflare.com/api/operations/ip-address-management-address-maps-remove-an-account-membership-from-an-address-map
// - zone: https://developers.cloudflare.com/api/operations/ip-address-management-address-maps-remove-a-zone-membership-from-an-address-map
// - account: https://developers.cloudflare.com/api/resources/addressing/subresources/address_maps/subresources/accounts/methods/delete/
// - zone: https://developers.cloudflare.com/api/resources/addressing/subresources/address_maps/subresources/zones/methods/delete/
func (api *API) DeleteMembershipFromAddressMap(ctx context.Context, rc *ResourceContainer, params DeleteMembershipFromAddressMapParams) error {
if rc.Level != AccountRouteLevel {
return ErrRequiredAccountLevelResourceContainer
Expand Down
12 changes: 6 additions & 6 deletions api_shield_api_discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ type APIShieldDiscoveryOperation struct {

// ListAPIShieldDiscoveryOperationsParams represents the parameters to pass when retrieving discovered operations.
//
// API documentation: https://developers.cloudflare.com/api/operations/api-shield-api-discovery-retrieve-discovered-operations-on-a-zone
// API documentation: https://developers.cloudflare.com/api/resources/api_gateway/subresources/discovery/subresources/operations/methods/list/
type ListAPIShieldDiscoveryOperationsParams struct {
// Direction to order results.
Direction string `url:"direction,omitempty"`
Expand All @@ -80,7 +80,7 @@ type ListAPIShieldDiscoveryOperationsParams struct {

// UpdateAPIShieldDiscoveryOperationParams represents the parameters to pass to patch a discovery operation
//
// API documentation: https://developers.cloudflare.com/api/operations/api-shield-api-patch-discovered-operation
// API documentation: https://developers.cloudflare.com/api/resources/api_gateway/subresources/discovery/subresources/operations/methods/edit/
type UpdateAPIShieldDiscoveryOperationParams struct {
// OperationID is the ID, formatted as UUID, of the operation to be updated
OperationID string `json:"-" url:"-"`
Expand All @@ -95,7 +95,7 @@ type UpdateAPIShieldDiscoveryOperationParams struct {
// "99522293-a505-45e5-bbad-bbc339f5dc40": PatchAPIShieldDiscoveryOperation{ State: "review" },
// }
//
// API documentation: https://developers.cloudflare.com/api/operations/api-shield-api-patch-discovered-operations
// API documentation: https://developers.cloudflare.com/api/resources/api_gateway/subresources/discovery/subresources/operations/methods/bulk_edit/
type UpdateAPIShieldDiscoveryOperationsParams map[string]UpdateAPIShieldDiscoveryOperation

// UpdateAPIShieldDiscoveryOperation represents the state to set on a discovery operation.
Expand Down Expand Up @@ -125,7 +125,7 @@ type APIShieldPatchDiscoveryOperationsResponse struct {

// ListAPIShieldDiscoveryOperations retrieve the most up to date view of discovered operations.
//
// API documentation: https://developers.cloudflare.com/api/operations/api-shield-api-discovery-retrieve-discovered-operations-on-a-zone
// API documentation: https://developers.cloudflare.com/api/resources/api_gateway/subresources/discovery/subresources/operations/methods/list/
func (api *API) ListAPIShieldDiscoveryOperations(ctx context.Context, rc *ResourceContainer, params ListAPIShieldDiscoveryOperationsParams) ([]APIShieldDiscoveryOperation, ResultInfo, error) {
uri := buildURI(fmt.Sprintf("/zones/%s/api_gateway/discovery/operations", rc.Identifier), params)

Expand All @@ -145,7 +145,7 @@ func (api *API) ListAPIShieldDiscoveryOperations(ctx context.Context, rc *Resour

// UpdateAPIShieldDiscoveryOperation updates certain fields on a discovered operation.
//
// API Documentation: https://developers.cloudflare.com/api/operations/api-shield-api-patch-discovered-operation
// API Documentation: https://developers.cloudflare.com/api/resources/api_gateway/subresources/discovery/subresources/operations/methods/edit/
func (api *API) UpdateAPIShieldDiscoveryOperation(ctx context.Context, rc *ResourceContainer, params UpdateAPIShieldDiscoveryOperationParams) (*UpdateAPIShieldDiscoveryOperation, error) {
if params.OperationID == "" {
return nil, fmt.Errorf("operation ID must be provided")
Expand All @@ -170,7 +170,7 @@ func (api *API) UpdateAPIShieldDiscoveryOperation(ctx context.Context, rc *Resou

// UpdateAPIShieldDiscoveryOperations bulk updates certain fields on multiple discovered operations
//
// API documentation: https://developers.cloudflare.com/api/operations/api-shield-api-patch-discovered-operations
// API documentation: https://developers.cloudflare.com/api/resources/api_gateway/subresources/discovery/subresources/operations/methods/bulk_edit/
func (api *API) UpdateAPIShieldDiscoveryOperations(ctx context.Context, rc *ResourceContainer, params UpdateAPIShieldDiscoveryOperationsParams) (*UpdateAPIShieldDiscoveryOperationsParams, error) {
uri := fmt.Sprintf("/zones/%s/api_gateway/discovery/operations", rc.Identifier)

Expand Down
Loading
Loading