Skip to content

Commit d8625c2

Browse files
committed
Only 1 top-level type per file
1 parent 64e5982 commit d8625c2

7 files changed

Lines changed: 98 additions & 82 deletions

File tree

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using net.openstack.Core.Domain;
4+
5+
namespace net.openstack.Providers.Rackspace.Objects
6+
{
7+
/// <summary>
8+
/// Describes an object which could not be deleted by a bulk deletion operation,
9+
/// along with a status providing the reason why the deletion failed.
10+
/// </summary>
11+
/// <threadsafety static="true" instance="false"/>
12+
[Serializable]
13+
public class BulkDeletionFailedObject
14+
{
15+
/// <summary>
16+
/// Gets a <see cref="Status"/> object describing the reason the object
17+
/// could not be deleted.
18+
/// </summary>
19+
public Status Status { get; private set; }
20+
21+
/// <summary>
22+
/// Gets the name of the object which could not be deleted.
23+
/// </summary>
24+
public string Object { get; private set; }
25+
26+
/// <summary>
27+
/// Initializes a new instance of the <see cref="BulkDeletionFailedObject"/> class
28+
/// with the specified object name and status.
29+
/// </summary>
30+
/// <param name="obj">The name of the object which could not be deleted.</param>
31+
/// <param name="status">A <see cref="Status"/> object describing the reason the object could not be deleted.</param>
32+
/// <exception cref="ArgumentNullException">
33+
/// If <paramref name="obj"/> is <c>null</c>.
34+
/// <para>-or-</para>
35+
/// <para>If <paramref name="status"/> is <c>null</c>.</para>
36+
/// </exception>
37+
/// <exception cref="ArgumentException">If <paramref name="obj"/> is empty.</exception>
38+
public BulkDeletionFailedObject(string obj, Status status)
39+
{
40+
if (obj == null)
41+
throw new ArgumentNullException("obj");
42+
if (status == null)
43+
throw new ArgumentNullException("status");
44+
if (string.IsNullOrEmpty(obj))
45+
throw new ArgumentException("obj cannot be empty");
46+
47+
Object = obj;
48+
Status = status;
49+
}
50+
}
51+
}

src/corelib/Providers/Rackspace/Objects/BulkDeletionResults.cs

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -40,49 +40,4 @@ public BulkDeletionResults(IEnumerable<string> successfulObjects, IEnumerable<Bu
4040
FailedObjects = failedObjects;
4141
}
4242
}
43-
44-
/// <summary>
45-
/// Describes an object which could not be deleted by a bulk deletion operation,
46-
/// along with a status providing the reason why the deletion failed.
47-
/// </summary>
48-
/// <threadsafety static="true" instance="false"/>
49-
[Serializable]
50-
public class BulkDeletionFailedObject
51-
{
52-
/// <summary>
53-
/// Gets a <see cref="Status"/> object describing the reason the object
54-
/// could not be deleted.
55-
/// </summary>
56-
public Status Status { get; private set; }
57-
58-
/// <summary>
59-
/// Gets the name of the object which could not be deleted.
60-
/// </summary>
61-
public string Object { get; private set; }
62-
63-
/// <summary>
64-
/// Initializes a new instance of the <see cref="BulkDeletionFailedObject"/> class
65-
/// with the specified object name and status.
66-
/// </summary>
67-
/// <param name="obj">The name of the object which could not be deleted.</param>
68-
/// <param name="status">A <see cref="Status"/> object describing the reason the object could not be deleted.</param>
69-
/// <exception cref="ArgumentNullException">
70-
/// If <paramref name="obj"/> is <c>null</c>.
71-
/// <para>-or-</para>
72-
/// <para>If <paramref name="status"/> is <c>null</c>.</para>
73-
/// </exception>
74-
/// <exception cref="ArgumentException">If <paramref name="obj"/> is empty.</exception>
75-
public BulkDeletionFailedObject(string obj, Status status)
76-
{
77-
if (obj == null)
78-
throw new ArgumentNullException("obj");
79-
if (status == null)
80-
throw new ArgumentNullException("status");
81-
if (string.IsNullOrEmpty(obj))
82-
throw new ArgumentException("obj cannot be empty");
83-
84-
Object = obj;
85-
Status = status;
86-
}
87-
}
8843
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
namespace net.openstack.Providers.Rackspace.Objects
2+
{
3+
/// <summary>
4+
/// Represents a particular Rackspace entity where a user's account is located.
5+
/// </summary>
6+
public enum CloudInstance
7+
{
8+
/// <summary>
9+
/// The Rackspace cloud for US-based accounts.
10+
/// </summary>
11+
US,
12+
13+
/// <summary>
14+
/// The Rackspace cloud for UK-based accounts.
15+
/// </summary>
16+
UK,
17+
18+
/// <summary>
19+
/// The default Rackspace cloud, which is currently equal to <see cref="US"/>.
20+
/// </summary>
21+
Default = US,
22+
}
23+
}

src/corelib/Providers/Rackspace/Objects/RackspaceCloudIdentity.cs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -59,25 +59,4 @@ public RackspaceCloudIdentity(CloudIdentity cloudIdentity) : this()
5959
/// </remarks>
6060
public Domain Domain { get; set; }
6161
}
62-
63-
/// <summary>
64-
/// Represents a particular Rackspace entity where a user's account is located.
65-
/// </summary>
66-
public enum CloudInstance
67-
{
68-
/// <summary>
69-
/// The Rackspace cloud for US-based accounts.
70-
/// </summary>
71-
US,
72-
73-
/// <summary>
74-
/// The Rackspace cloud for UK-based accounts.
75-
/// </summary>
76-
UK,
77-
78-
/// <summary>
79-
/// The default Rackspace cloud, which is currently equal to <see cref="US"/>.
80-
/// </summary>
81-
Default = US,
82-
}
8362
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
namespace net.openstack.Providers.Rackspace.Objects.Response
2+
{
3+
using net.openstack.Core.Domain;
4+
using Newtonsoft.Json;
5+
6+
/// <summary>
7+
/// This models the JSON response used for the Add Role and Get Role by Name requests.
8+
/// </summary>
9+
/// <seealso href="http://docs.openstack.org/api/openstack-identity-service/2.0/content/POST_addRole_v2.0_OS-KSADM_roles_Role_Operations_OS-KSADM.html">Add Role (OpenStack Identity Service API v2.0 Reference)</seealso>
10+
/// <seealso href="http://docs.openstack.org/api/openstack-identity-service/2.0/content/GET_getRoleByName_v2.0_OS-KSADM_roles_Role_Operations_OS-KSADM.html">Get Role by Name (OpenStack Identity Service API v2.0 Reference)</seealso>
11+
/// <threadsafety static="true" instance="false"/>
12+
[JsonObject(MemberSerialization.OptIn)]
13+
internal class RoleResponse
14+
{
15+
/// <summary>
16+
/// Gets information about the role.
17+
/// </summary>
18+
[JsonProperty("role")]
19+
public Role Role { get; private set; }
20+
}
21+
}

src/corelib/Providers/Rackspace/Objects/Response/RolesResponse.cs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,4 @@ internal class RolesResponse
2424
[JsonProperty("roles_links")]
2525
public string[] RoleLinks { get; private set; }
2626
}
27-
28-
/// <summary>
29-
/// This models the JSON response used for the Add Role and Get Role by Name requests.
30-
/// </summary>
31-
/// <seealso href="http://docs.openstack.org/api/openstack-identity-service/2.0/content/POST_addRole_v2.0_OS-KSADM_roles_Role_Operations_OS-KSADM.html">Add Role (OpenStack Identity Service API v2.0 Reference)</seealso>
32-
/// <seealso href="http://docs.openstack.org/api/openstack-identity-service/2.0/content/GET_getRoleByName_v2.0_OS-KSADM_roles_Role_Operations_OS-KSADM.html">Get Role by Name (OpenStack Identity Service API v2.0 Reference)</seealso>
33-
/// <threadsafety static="true" instance="false"/>
34-
[JsonObject(MemberSerialization.OptIn)]
35-
internal class RoleResponse
36-
{
37-
/// <summary>
38-
/// Gets information about the role.
39-
/// </summary>
40-
[JsonProperty("role")]
41-
public Role Role { get; private set; }
42-
}
4327
}

src/corelib/corelib.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,9 @@
137137
<Compile Include="Core\Exceptions\ServerEnteredErrorStateException.cs" />
138138
<Compile Include="Providers\Rackspace\Exceptions\NamespaceDoc.cs" />
139139
<Compile Include="Providers\Rackspace\NamespaceDoc.cs" />
140+
<Compile Include="Providers\Rackspace\Objects\BulkDeletionFailedObject.cs" />
140141
<Compile Include="Providers\Rackspace\Objects\BulkDeletionResults.cs" />
142+
<Compile Include="Providers\Rackspace\Objects\CloudInstance.cs" />
141143
<Compile Include="Providers\Rackspace\Objects\Domain.cs" />
142144
<Compile Include="Providers\Rackspace\Objects\Mapping\BulkDeletionResultMapper.cs" />
143145
<Compile Include="Providers\Rackspace\Objects\Mapping\NamespaceDoc.cs" />
@@ -149,6 +151,7 @@
149151
<Compile Include="Providers\Rackspace\Objects\Response\MetadataItemResponse.cs" />
150152
<Compile Include="Providers\Rackspace\Objects\Response\ListVirtualInterfacesResponse.cs" />
151153
<Compile Include="Providers\Rackspace\Objects\Response\NamespaceDoc.cs" />
154+
<Compile Include="Providers\Rackspace\Objects\Response\RoleResponse.cs" />
152155
<Compile Include="Providers\Rackspace\Validators\CloudFilesValidator.cs" />
153156
<Compile Include="Core\Validators\IObjectStorageValidator.cs" />
154157
<Compile Include="Providers\Rackspace\EncodeDecodeProvider.cs" />

0 commit comments

Comments
 (0)