diff --git a/management/actions.go b/management/actions.go index a868a550..580fec0c 100644 --- a/management/actions.go +++ b/management/actions.go @@ -250,7 +250,9 @@ func (m *ActionManager) Delete(ctx context.Context, id string, opts ...RequestOp return m.management.Request(ctx, "DELETE", m.management.URI("actions", "actions", id), nil, opts...) } -// List all actions. +// List actions. +// +// For information on how to paginate using this function see https://pkg.go.dev/github.com/auth0/go-auth0/management#hdr-Page_Based_Pagination // // See: https://auth0.com/docs/api/management/v2#!/Actions/get_actions func (m *ActionManager) List(ctx context.Context, opts ...RequestOption) (l *ActionList, err error) { @@ -266,7 +268,9 @@ func (m *ActionManager) Version(ctx context.Context, id string, versionID string return } -// Versions lists all versions of an action. +// Versions lists versions of an action. +// +// For information on how to paginate using this function see https://pkg.go.dev/github.com/auth0/go-auth0/management#hdr-Page_Based_Pagination // // See: https://auth0.com/docs/api/management/v2/#!/Actions/get_action_versions func (m *ActionManager) Versions(ctx context.Context, id string, opts ...RequestOption) (c *ActionVersionList, err error) { @@ -286,6 +290,8 @@ func (m *ActionManager) UpdateBindings(ctx context.Context, triggerID string, b // Bindings lists the bindings of a trigger. // +// For information on how to paginate using this function see https://pkg.go.dev/github.com/auth0/go-auth0/management#hdr-Page_Based_Pagination +// // See: https://auth0.com/docs/api/management/v2/#!/Actions/get_bindings func (m *ActionManager) Bindings(ctx context.Context, triggerID string, opts ...RequestOption) (bl *ActionBindingList, err error) { err = m.management.Request(ctx, "GET", m.management.URI("actions", "triggers", triggerID, "bindings"), &bl, applyActionsListDefaults(opts)) diff --git a/management/blacklist.go b/management/blacklist.go index e2204cb8..9763586b 100644 --- a/management/blacklist.go +++ b/management/blacklist.go @@ -20,7 +20,7 @@ type BlacklistToken struct { // BlacklistManager manages Auth0 BlacklistToken resources. type BlacklistManager manager -// List all tokens that are blacklisted. +// List tokens that are blacklisted. // // Note: The JWT specification states that the `jti` field can be used to // prevent replay attacks. Though Auth0 tokens do not include a `jti`, you can @@ -30,6 +30,7 @@ type BlacklistManager manager // token gets stolen, it (or the tokens issued after it) should be blacklisted // and let expire. // +// For information on how to paginate using this function see https://pkg.go.dev/github.com/auth0/go-auth0/management#hdr-Page_Based_Pagination // See: https://auth0.com/docs/api/management/v2#!/Blacklists/get_tokens func (m *BlacklistManager) List(ctx context.Context, opts ...RequestOption) (bl []*BlacklistToken, err error) { err = m.management.Request(ctx, "GET", m.management.URI("blacklists", "tokens"), &bl, applyListDefaults(opts)) diff --git a/management/client.go b/management/client.go index d106532a..a122303d 100644 --- a/management/client.go +++ b/management/client.go @@ -529,7 +529,9 @@ func (m *ClientManager) Read(ctx context.Context, id string, opts ...RequestOpti return } -// List all client applications. +// List client applications. +// +// For information on how to paginate using this function see https://pkg.go.dev/github.com/auth0/go-auth0/management#hdr-Page_Based_Pagination // // See: https://auth0.com/docs/api/management/v2#!/Clients/get_clients func (m *ClientManager) List(ctx context.Context, opts ...RequestOption) (c *ClientList, err error) { @@ -587,7 +589,9 @@ func (m *ClientManager) UpdateCredential(ctx context.Context, clientID, credenti return nil } -// ListCredentials lists all client credentials associated with the client application. +// ListCredentials lists client credentials associated with the client application. +// +// For information on how to paginate using this function see https://pkg.go.dev/github.com/auth0/go-auth0/management#hdr-Page_Based_Pagination func (m *ClientManager) ListCredentials(ctx context.Context, clientID string, opts ...RequestOption) (c []*Credential, err error) { err = m.management.Request(ctx, "GET", m.management.URI("clients", clientID, "credentials"), &c, applyListDefaults(opts)) return diff --git a/management/client_grant.go b/management/client_grant.go index c591fdb0..221ad75d 100644 --- a/management/client_grant.go +++ b/management/client_grant.go @@ -86,11 +86,13 @@ func (m *ClientGrantManager) Delete(ctx context.Context, id string, opts ...Requ return m.management.Request(ctx, "DELETE", m.management.URI("client-grants", id), nil, opts...) } -// List all client grants. +// List client grants. // // This method forces the `include_totals=true` and defaults to `per_page=50` if // not provided. // +// For information on how to paginate using this function see https://pkg.go.dev/github.com/auth0/go-auth0/management#hdr-Page_Based_Pagination +// // See: https://auth0.com/docs/api/management/v2#!/Client_Grants/get_client_grants func (m *ClientGrantManager) List(ctx context.Context, opts ...RequestOption) (gs *ClientGrantList, err error) { err = m.management.Request(ctx, "GET", m.management.URI("client-grants"), &gs, applyListDefaults(opts)) @@ -101,6 +103,8 @@ func (m *ClientGrantManager) List(ctx context.Context, opts ...RequestOption) (g // // This method forces the `include_totals=true` and defaults to `per_page=50` if // not provided. +// +// For information on how to paginate using this function see https://pkg.go.dev/github.com/auth0/go-auth0/management#hdr-Page_Based_Pagination func (m *ClientGrantManager) Organizations(ctx context.Context, id string, opts ...RequestOption) (o *OrganizationList, err error) { err = m.management.Request(ctx, "GET", m.management.URI("client-grants", id, "organizations"), &o, applyListDefaults(opts)) return diff --git a/management/connection.go b/management/connection.go index 5de93475..376ecbc4 100644 --- a/management/connection.go +++ b/management/connection.go @@ -1231,7 +1231,9 @@ func (m *ConnectionManager) Read(ctx context.Context, id string, opts ...Request return } -// List all connections. +// List connections. +// +// For information on how to paginate using this function see https://pkg.go.dev/github.com/auth0/go-auth0/management#hdr-Page_Based_Pagination // // See: https://auth0.com/docs/api/management/v2#!/Connections/get_connections func (m *ConnectionManager) List(ctx context.Context, opts ...RequestOption) (c *ConnectionList, err error) { diff --git a/management/grant.go b/management/grant.go index 12ab63d2..549c9244 100644 --- a/management/grant.go +++ b/management/grant.go @@ -32,6 +32,8 @@ type GrantManager manager // List the grants associated with your account. // +// For information on how to paginate using this function see https://pkg.go.dev/github.com/auth0/go-auth0/management#hdr-Page_Based_Pagination +// // See: https://auth0.com/docs/api/management/v2#!/Grants/get_grants func (m *GrantManager) List(ctx context.Context, opts ...RequestOption) (g *GrantList, err error) { err = m.management.Request(ctx, "GET", m.management.URI("grants"), &g, applyListDefaults(opts)) diff --git a/management/hook.go b/management/hook.go index c0b546bb..e381b0b7 100644 --- a/management/hook.go +++ b/management/hook.go @@ -108,7 +108,9 @@ func (m *HookManager) Delete(ctx context.Context, id string, opts ...RequestOpti return m.management.Request(ctx, "DELETE", m.management.URI("hooks", id), nil, opts...) } -// List all hooks. +// List hooks. +// +// For information on how to paginate using this function see https://pkg.go.dev/github.com/auth0/go-auth0/management#hdr-Page_Based_Pagination // // See: https://auth0.com/docs/api/management/v2/#!/Hooks/get_hooks func (m *HookManager) List(ctx context.Context, opts ...RequestOption) (l *HookList, err error) { diff --git a/management/organization.go b/management/organization.go index 3fcd44a6..92e0d546 100644 --- a/management/organization.go +++ b/management/organization.go @@ -192,6 +192,8 @@ type OrganizationManager manager // List available organizations. // +// For information on how to paginate using this function see https://pkg.go.dev/github.com/auth0/go-auth0/management#hdr-Page_Based_Pagination +// // See: https://auth0.com/docs/api/management/v2/#!/Organizations/get_organizations func (m *OrganizationManager) List(ctx context.Context, opts ...RequestOption) (o *OrganizationList, err error) { err = m.management.Request(ctx, "GET", m.management.URI("organizations"), &o, applyListDefaults(opts)) @@ -240,6 +242,8 @@ func (m *OrganizationManager) ReadByName(ctx context.Context, name string, opts // Connections retrieves connections enabled for an organization. // +// For information on how to paginate using this function see https://pkg.go.dev/github.com/auth0/go-auth0/management#hdr-Page_Based_Pagination +// // See: https://auth0.com/docs/api/management/v2/#!/Organizations/get_enabled_connections func (m *OrganizationManager) Connections(ctx context.Context, id string, opts ...RequestOption) (c *OrganizationConnectionList, err error) { err = m.management.Request(ctx, "GET", m.management.URI("organizations", id, "enabled_connections"), &c, applyListDefaults(opts)) @@ -279,6 +283,8 @@ func (m *OrganizationManager) UpdateConnection(ctx context.Context, id string, c } // Invitations retrieves invitations to organization. +// +// For information on how to paginate using this function see https://pkg.go.dev/github.com/auth0/go-auth0/management#hdr-Page_Based_Pagination // Note that when paginating this response the `HasNext` helper cannot be used, so instead check the length of the returned list // manually and break when there are 0 entries. See https://github.com/auth0/go-auth0/issues/48 for more context. // @@ -314,6 +320,8 @@ func (m *OrganizationManager) DeleteInvitation(ctx context.Context, id string, i // Members lists organization members. // +// For information on how to paginate using this function see https://pkg.go.dev/github.com/auth0/go-auth0/management#hdr-Page_Based_Pagination +// // See: https://auth0.com/docs/api/management/v2/#!/Organizations/get_members func (m *OrganizationManager) Members(ctx context.Context, id string, opts ...RequestOption) (o *OrganizationMemberList, err error) { err = m.management.Request(ctx, "GET", m.management.URI("organizations", id, "members"), &o, applyListDefaults(opts)) @@ -348,6 +356,8 @@ func (m *OrganizationManager) DeleteMembers(ctx context.Context, id string, memb // MemberRoles retrieves the roles assigned to an organization member. // +// For information on how to paginate using this function see https://pkg.go.dev/github.com/auth0/go-auth0/management#hdr-Page_Based_Pagination +// // See: https://auth0.com/docs/api/management/v2/#!/Organizations/get_organization_member_roles func (m *OrganizationManager) MemberRoles(ctx context.Context, id string, memberID string, opts ...RequestOption) (r *OrganizationMemberRoleList, err error) { err = m.management.Request(ctx, "GET", m.management.URI("organizations", id, "members", memberID, "roles"), &r, applyListDefaults(opts)) @@ -381,6 +391,8 @@ func (m *OrganizationManager) DeleteMemberRoles(ctx context.Context, id string, } // ClientGrants retrieves the client grants assigned to an organization. +// +// For information on how to paginate using this function see https://pkg.go.dev/github.com/auth0/go-auth0/management#hdr-Page_Based_Pagination func (m *OrganizationManager) ClientGrants(ctx context.Context, id string, opts ...RequestOption) (g *ClientGrantList, err error) { err = m.management.Request(ctx, "GET", m.management.URI("organizations", id, "client-grants"), &g, applyListDefaults(opts)) return @@ -393,12 +405,12 @@ func (m *OrganizationManager) AssociateClientGrant(ctx context.Context, id strin }{ GrantID: grantID, } - err = m.management.Request(ctx, "POST", m.management.URI("organizations", id, "client-grants"), &body, applyListDefaults(opts)) + err = m.management.Request(ctx, "POST", m.management.URI("organizations", id, "client-grants"), &body, opts...) return } // RemoveClientGrant removes a client grant from an organization. func (m *OrganizationManager) RemoveClientGrant(ctx context.Context, id string, grantID string, opts ...RequestOption) (err error) { - err = m.management.Request(ctx, "DELETE", m.management.URI("organizations", id, "client-grants", grantID), nil, applyListDefaults(opts)) + err = m.management.Request(ctx, "DELETE", m.management.URI("organizations", id, "client-grants", grantID), nil, opts...) return } diff --git a/management/resource_server.go b/management/resource_server.go index 5e651cc6..19a17e6a 100644 --- a/management/resource_server.go +++ b/management/resource_server.go @@ -100,7 +100,9 @@ func (m *ResourceServerManager) Delete(ctx context.Context, id string, opts ...R return m.management.Request(ctx, "DELETE", m.management.URI("resource-servers", id), nil, opts...) } -// List all resource server. +// List resource server. +// +// For information on how to paginate using this function see https://pkg.go.dev/github.com/auth0/go-auth0/management#hdr-Page_Based_Pagination // // See: https://auth0.com/docs/api/management/v2#!/Resource_Servers/get_resource_servers func (m *ResourceServerManager) List(ctx context.Context, opts ...RequestOption) (rl *ResourceServerList, err error) { diff --git a/management/role.go b/management/role.go index 9264e253..c77da152 100644 --- a/management/role.go +++ b/management/role.go @@ -77,7 +77,9 @@ func (m *RoleManager) Delete(ctx context.Context, id string, opts ...RequestOpti return m.management.Request(ctx, "DELETE", m.management.URI("roles", id), &Role{}, opts...) } -// List all roles that can be assigned to users or groups. +// List roles that can be assigned to users or groups. +// +// For information on how to paginate using this function see https://pkg.go.dev/github.com/auth0/go-auth0/management#hdr-Page_Based_Pagination // // See: https://auth0.com/docs/api/management/v2#!/Roles/get_roles func (m *RoleManager) List(ctx context.Context, opts ...RequestOption) (r *RoleList, err error) { @@ -97,7 +99,9 @@ func (m *RoleManager) AssignUsers(ctx context.Context, id string, users []*User, return m.management.Request(ctx, "POST", m.management.URI("roles", id, "users"), &u, opts...) } -// Users retrieves all users associated with a role. +// Users retrieves users associated with a role. +// +// For information on how to paginate using this function see https://pkg.go.dev/github.com/auth0/go-auth0/management#hdr-Page_Based_Pagination // // See: https://auth0.com/docs/api/management/v2#!/Roles/get_role_user func (m *RoleManager) Users(ctx context.Context, id string, opts ...RequestOption) (u *UserList, err error) { @@ -114,7 +118,9 @@ func (m *RoleManager) AssociatePermissions(ctx context.Context, id string, permi return m.management.Request(ctx, "POST", m.management.URI("roles", id, "permissions"), &p, opts...) } -// Permissions retrieves all permissions granted by a role. +// Permissions retrieves permissions granted by a role. +// +// For information on how to paginate using this function see https://pkg.go.dev/github.com/auth0/go-auth0/management#hdr-Page_Based_Pagination // // See: https://auth0.com/docs/api/management/v2#!/Roles/get_role_permission func (m *RoleManager) Permissions(ctx context.Context, id string, opts ...RequestOption) (p *PermissionList, err error) { diff --git a/management/rule.go b/management/rule.go index 2ab8d3d8..18e66cd6 100644 --- a/management/rule.go +++ b/management/rule.go @@ -64,7 +64,9 @@ func (m *RuleManager) Delete(ctx context.Context, id string, opts ...RequestOpti return m.management.Request(ctx, "DELETE", m.management.URI("rules", id), nil, opts...) } -// List all rules. +// List rules. +// +// For information on how to paginate using this function see https://pkg.go.dev/github.com/auth0/go-auth0/management#hdr-Page_Based_Pagination // // See: https://auth0.com/docs/api/management/v2#!/Rules/get_rules func (m *RuleManager) List(ctx context.Context, opts ...RequestOption) (r *RuleList, err error) { diff --git a/management/rule_config.go b/management/rule_config.go index 4e70b393..f585b099 100644 --- a/management/rule_config.go +++ b/management/rule_config.go @@ -47,7 +47,9 @@ func (m *RuleConfigManager) Delete(ctx context.Context, key string, opts ...Requ return m.management.Request(ctx, "DELETE", m.management.URI("rules-configs", key), nil, opts...) } -// List all rule configuration variables. +// List rule configuration variables. +// +// For information on how to paginate using this function see https://pkg.go.dev/github.com/auth0/go-auth0/management#hdr-Page_Based_Pagination // // See: https://auth0.com/docs/api/management/v2#!/Rules_Configs/get_rules_configs func (m *RuleConfigManager) List(ctx context.Context, opts ...RequestOption) (r []*RuleConfig, err error) { diff --git a/management/user.go b/management/user.go index 5dcead9c..fc4a68d4 100644 --- a/management/user.go +++ b/management/user.go @@ -445,7 +445,9 @@ func (m *UserManager) Delete(ctx context.Context, id string, opts ...RequestOpti return m.management.Request(ctx, "DELETE", m.management.URI("users", id), nil, opts...) } -// List all users. This method forces the `include_totals` option. +// List users. This method forces the `include_totals` option. +// +// For information on how to paginate using this function see https://pkg.go.dev/github.com/auth0/go-auth0/management#hdr-Page_Based_Pagination // // See: https://auth0.com/docs/api/management/v2#!/Users/get_users func (m *UserManager) List(ctx context.Context, opts ...RequestOption) (ul *UserList, err error) { @@ -478,7 +480,9 @@ func (m *UserManager) ListByEmail(ctx context.Context, email string, opts ...Req return } -// Roles lists all roles associated with a user. +// Roles lists roles associated with a user. +// +// For information on how to paginate using this function see https://pkg.go.dev/github.com/auth0/go-auth0/management#hdr-Page_Based_Pagination // // See: https://auth0.com/docs/api/management/v2#!/Users/get_user_roles func (m *UserManager) Roles(ctx context.Context, id string, opts ...RequestOption) (r *RoleList, err error) { @@ -512,6 +516,8 @@ func (m *UserManager) RemoveRoles(ctx context.Context, id string, roles []*Role, // Permissions lists the permissions associated to the user. // +// For information on how to paginate using this function see https://pkg.go.dev/github.com/auth0/go-auth0/management#hdr-Page_Based_Pagination +// // See: https://auth0.com/docs/api/management/v2#!/Users/get_permissions func (m *UserManager) Permissions(ctx context.Context, id string, opts ...RequestOption) (p *PermissionList, err error) { err = m.management.Request(ctx, "GET", m.management.URI("users", id, "permissions"), &p, applyListDefaults(opts)) @@ -653,6 +659,8 @@ func (m *UserManager) Unlink(ctx context.Context, id, provider, userID string, o // Organizations lists user's organizations. // +// For information on how to paginate using this function see https://pkg.go.dev/github.com/auth0/go-auth0/management#hdr-Page_Based_Pagination +// // See: https://auth0.com/docs/api/management/v2#!/Users/get_organizations func (m *UserManager) Organizations(ctx context.Context, id string, opts ...RequestOption) (p *OrganizationList, err error) { err = m.management.Request(ctx, "GET", m.management.URI("users", id, "organizations"), &p, applyListDefaults(opts)) @@ -661,6 +669,8 @@ func (m *UserManager) Organizations(ctx context.Context, id string, opts ...Requ // ListAuthenticationMethods retrieves a list of authentication methods. // +// For information on how to paginate using this function see https://pkg.go.dev/github.com/auth0/go-auth0/management#hdr-Page_Based_Pagination +// // See: https://auth0.com/docs/api/management/v2#!/Users/get_authentication_methods func (m *UserManager) ListAuthenticationMethods(ctx context.Context, userID string, opts ...RequestOption) (a *AuthenticationMethodList, err error) { err = m.management.Request(ctx, "GET", m.management.URI("users", userID, "authentication-methods"), &a, applyListDefaults(opts)) @@ -671,7 +681,7 @@ func (m *UserManager) ListAuthenticationMethods(ctx context.Context, userID stri // // See: https://auth0.com/docs/api/management/v2#!/Users/get_authentication_methods_by_authentication_method_id func (m *UserManager) GetAuthenticationMethodByID(ctx context.Context, userID string, id string, opts ...RequestOption) (a *AuthenticationMethod, err error) { - err = m.management.Request(ctx, "GET", m.management.URI("users", userID, "authentication-methods", id), &a, applyListDefaults(opts)) + err = m.management.Request(ctx, "GET", m.management.URI("users", userID, "authentication-methods", id), &a, opts...) return }