Skip to content
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
8 changes: 4 additions & 4 deletions src/corelib/Providers/Rackspace/CloudIdentityProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,23 +122,23 @@ public CloudIdentityProvider(CloudIdentity defaultIdentity, IRestService restSer
}

/// <inheritdoc/>
public IEnumerable<Role> ListRoles(string serviceId = null, string markerId = null, int? limit = null, CloudIdentity identity = null)
public IEnumerable<Role> ListRoles(string serviceId = null, int? marker = null, int? limit = null, CloudIdentity identity = null)
{
if (limit < 0)
throw new ArgumentOutOfRangeException("limit");

var provider = GetProvider(identity);
return provider.ListRoles(serviceId, markerId, limit, identity);
return provider.ListRoles(serviceId, marker, limit, identity);
}

/// <inheritdoc/>
public IEnumerable<User> ListUsersByRole(string roleId, bool? enabled = null, string markerId = null, int? limit = null, CloudIdentity identity = null)
public IEnumerable<User> ListUsersByRole(string roleId, bool? enabled = null, int? marker = null, int? limit = null, CloudIdentity identity = null)
{
if (limit < 0 || limit > 1000)
throw new ArgumentOutOfRangeException("limit");

var provider = GetProvider(identity);
return provider.ListUsersByRole(roleId, enabled, markerId, limit, identity);
return provider.ListUsersByRole(roleId, enabled, marker, limit, identity);
}

/// <inheritdoc/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public GeographicalCloudIdentityProvider(Uri urlBase, CloudIdentity identity, IR
#region Roles

/// <inheritdoc/>
public IEnumerable<Role> ListRoles(string serviceId = null, string markerId = null, int? limit = null, CloudIdentity identity = null)
public IEnumerable<Role> ListRoles(string serviceId = null, int? marker = null, int? limit = null, CloudIdentity identity = null)
{
if (limit < 0)
throw new ArgumentOutOfRangeException("limit");
Expand All @@ -45,7 +45,7 @@ public IEnumerable<Role> ListRoles(string serviceId = null, string markerId = nu
var parameters = BuildOptionalParameterList(new Dictionary<string, string>
{
{"serviceId", serviceId},
{"marker", markerId},
{"marker", !marker.HasValue ? null : marker.Value.ToString()},
{"limit", !limit.HasValue ? null : limit.Value.ToString()},
});

Expand Down Expand Up @@ -156,7 +156,7 @@ public bool DeleteRoleFromUser(string userId, string roleId, CloudIdentity ident
}

/// <inheritdoc/>
public IEnumerable<User> ListUsersByRole(string roleId, bool? enabled = null, string markerId = null, int? limit = null, CloudIdentity identity = null)
public IEnumerable<User> ListUsersByRole(string roleId, bool? enabled = null, int? marker = null, int? limit = null, CloudIdentity identity = null)
{
if (limit < 0 || limit > 1000)
throw new ArgumentOutOfRangeException("limit");
Expand All @@ -166,7 +166,7 @@ public IEnumerable<User> ListUsersByRole(string roleId, bool? enabled = null, st
var parameters = BuildOptionalParameterList(new Dictionary<string, string>
{
{"enabled", !enabled.HasValue ? null : enabled.Value ? "true" : "false"},
{"marker", markerId},
{"marker", !marker.HasValue ? null : marker.Value.ToString()},
{"limit", !limit.HasValue ? null : limit.Value.ToString()},
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public interface IExtendedCloudIdentityProvider : IIdentityProvider
/// <note type="warning">The behavior of this API method is not defined. Do not use.</note>
/// </summary>
/// <param name="serviceId">The "serviceId".</param>
/// <param name="markerId">The <see cref="Role.Id"/> of the last item in the previous list. Used for pagination. If the value is <c>null</c>, the list starts at the beginning.</param>
/// <param name="marker">The index of the last item in the previous list. Used for pagination. If the value is <c>null</c>, the list starts at the beginning.</param>
/// <param name="limit">Indicates the maximum number of items to return. Used for pagination. If the value is <c>null</c>, a provider-specific default value is used.</param>
/// <param name="identity">The cloud identity to use for this request. If not specified, the default identity for the current provider instance will be used.</param>
/// <returns>A collection of <see cref="Role"/> objects describing the requested roles.</returns>
Expand All @@ -28,23 +28,22 @@ public interface IExtendedCloudIdentityProvider : IIdentityProvider
/// <exception cref="InvalidOperationException">If <paramref name="identity"/> is <c>null</c> and no default identity is available for the provider.</exception>
/// <exception cref="ResponseException">If the REST API request failed.</exception>
/// <seealso href="http://docs.rackspace.com/openstack-extensions/auth/OS-KSADM-admin-devguide/content/GET_listRoles_v2.0_OS-KSADM_roles_Admin_API_Service_Developer_Operations-d1e1357.html">List Roles (Rackspace OS-KSADM Extension - API v2.0)</seealso>
IEnumerable<Role> ListRoles(string serviceId = null, string markerId = null, int? limit = null, CloudIdentity identity = null);
IEnumerable<Role> ListRoles(string serviceId = null, int? marker = null, int? limit = null, CloudIdentity identity = null);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation link on the previous line lists this argument as a string. Even if the behavior is an index (as opposed to every other pagination method), you cannot assume that the value is an int.


/// <summary>
/// Lists all roles.
/// <note type="warning">The behavior of this API method is not defined. Do not use.</note>
/// Lists all users for a given role.
/// </summary>
/// <param name="roleId">The role ID. The behavior is unspecified if this is not obtained from <see cref="Role.Id"/>.</param>
/// <param name="enabled">Allows you to filter enabled or un-enabled users. If the value is <c>null</c>, a provider-specific default value is used.</param>
/// <param name="markerId">The <see cref="Role.Id"/> of the last item in the previous list. Used for pagination. If the value is <c>null</c>, the list starts at the beginning.</param>
/// <param name="marker">The index of the last item in the previous list. Used for pagination. If the value is <c>null</c>, the list starts at the beginning.</param>
/// <param name="limit">Indicates the maximum number of items to return. Used for pagination. If the value is <c>null</c>, a provider-specific default value is used.</param>
/// <param name="identity">The cloud identity to use for this request. If not specified, the default identity for the current provider instance will be used.</param>
/// <returns>A collection of <see cref="Role"/> objects describing the requested roles.</returns>
/// <exception cref="ArgumentOutOfRangeException">If <paramref name="limit"/> is less than 0 or greater than 1000.</exception>
/// <exception cref="NotSupportedException">If the provider does not support the given <paramref name="identity"/> type.</exception>
/// <exception cref="InvalidOperationException">If <paramref name="identity"/> is <c>null</c> and no default identity is available for the provider.</exception>
/// <exception cref="ResponseException">If the REST API request failed.</exception>
IEnumerable<User> ListUsersByRole(string roleId, bool? enabled = null, string markerId = null, int? limit = null, CloudIdentity identity = null);
IEnumerable<User> ListUsersByRole(string roleId, bool? enabled = null, int? marker = null, int? limit = null, CloudIdentity identity = null);

/// <summary>
/// Create a new role.
Expand Down