Skip to content

Commit 2415508

Browse files
committed
Updated documentation and polish for the new OS-KSCATALOG operations
1 parent 66eed91 commit 2415508

9 files changed

Lines changed: 286 additions & 73 deletions

File tree

src/Documentation/SharedTokens.tokens

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@
2727
</para>
2828
</item>
2929

30+
<item id="NullIfNotIncluded">
31+
<para>-or-</para>
32+
<para>
33+
<see langword="null"/> if the underlying property was not included in the JSON representation of the object.
34+
</para>
35+
</item>
36+
3037
<!--
3138
The following items can only be used in <token> elements that appear in **MAML topics**.
3239
-->

src/corelib/Core/Domain/EndpointTemplate.cs

Lines changed: 40 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,60 @@
55
using Newtonsoft.Json;
66

77
/// <summary>
8-
/// A personality that a user assumes when performing a specific set of operations. A role
9-
/// includes a set of right and privileges. A user assuming that role inherits those rights
10-
/// and privileges.
8+
/// This class models the JSON representation of an endpoint template resource in the OpenStack Identity Service V2.
119
/// </summary>
1210
/// <remarks>
13-
/// In OpenStack Identity Service, a token that is issued to a user includes the list of
14-
/// roles that user can assume. Services that are being called by that user determine how
15-
/// they interpret the set of roles a user has and to which operations or resources each
16-
/// role grants access.
11+
/// <para>This object is part of the <c>OS-KSCATALOG</c> extension to the OpenStack Identity Service V2.</para>
1712
/// </remarks>
13+
/// <seealso href="http://developer.openstack.org/api-ref-identity-v2.html#os-kscatalog-ext">OS-KSCATALOG admin extension (Identity API v2.0 - OpenStack Complete API Reference)</seealso>
1814
/// <threadsafety static="true" instance="false"/>
15+
/// <preliminary/>
1916
[JsonObject(MemberSerialization.OptIn)]
2017
[DebuggerDisplay("{Id, nq}")]
21-
public class EndpointTemplate
18+
public class EndpointTemplate : ExtensibleJsonObject
2219
{
2320
/// <summary>
24-
/// Gets the unique identifier for the Endpoint Template.
21+
/// This is the backing field for the <see cref="Id"/> property.
2522
/// </summary>
26-
[JsonProperty("id")]
27-
public string Id { get; private set; }
23+
[JsonProperty("id", DefaultValueHandling = DefaultValueHandling.Ignore)]
24+
private EndpointTemplateId _id;
2825

29-
public EndpointTemplate(string id)
26+
/// <summary>
27+
/// Initializes a new instance of the <see cref="EndpointTemplate"/> class
28+
/// during JSON deserialization.
29+
/// </summary>
30+
[JsonConstructor]
31+
protected EndpointTemplate()
32+
{
33+
}
34+
35+
/// <summary>
36+
/// Initializes a new instance of the <see cref="EndpointTemplate"/> class with the specified endpoint template
37+
/// identifier.
38+
/// </summary>
39+
/// <param name="id">The unique identifier of the endpoint template.</param>
40+
/// <exception cref="ArgumentNullException">If <paramref name="id"/> is <see langword="null"/>.</exception>
41+
public EndpointTemplate(EndpointTemplateId id)
3042
{
3143
if (id == null)
3244
throw new ArgumentNullException("id");
3345

34-
Id = id;
46+
_id = id;
47+
}
48+
49+
/// <summary>
50+
/// Gets the unique identifier for the endpoint template.
51+
/// </summary>
52+
/// <value>
53+
/// <para>The unique identifier for the endpoint template.</para>
54+
/// <token>NullIfNotIncluded</token>
55+
/// </value>
56+
public EndpointTemplateId Id
57+
{
58+
get
59+
{
60+
return _id;
61+
}
3562
}
3663
}
3764
}
38-
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
namespace net.openstack.Core.Domain
2+
{
3+
using System;
4+
using net.openstack.Core;
5+
using Newtonsoft.Json;
6+
7+
/// <summary>
8+
/// Represents the unique identifier of an <see cref="EndpointTemplate"/>.
9+
/// </summary>
10+
/// <remarks>
11+
/// <para>This object is part of the <c>OS-KSCATALOG</c> extension to the OpenStack Identity Service V2.</para>
12+
/// </remarks>
13+
/// <seealso cref="EndpointTemplate.Id"/>
14+
/// <threadsafety static="true" instance="false"/>
15+
/// <preliminary/>
16+
[JsonConverter(typeof(EndpointTemplateId.Converter))]
17+
public sealed class EndpointTemplateId : ResourceIdentifier<EndpointTemplateId>
18+
{
19+
/// <summary>
20+
/// Initializes a new instance of the <see cref="EndpointTemplateId"/> class
21+
/// with the specified identifier value.
22+
/// </summary>
23+
/// <param name="id">The identifier value.</param>
24+
/// <exception cref="ArgumentNullException">If <paramref name="id"/> is <see langword="null"/>.</exception>
25+
/// <exception cref="ArgumentException">If <paramref name="id"/> is empty.</exception>
26+
public EndpointTemplateId(string id)
27+
: base(id)
28+
{
29+
}
30+
31+
/// <summary>
32+
/// Provides support for serializing and deserializing <see cref="EndpointTemplateId"/>
33+
/// objects to JSON string values.
34+
/// </summary>
35+
/// <threadsafety static="true" instance="false"/>
36+
private sealed class Converter : ConverterBase
37+
{
38+
/// <inheritdoc/>
39+
protected override EndpointTemplateId FromValue(string id)
40+
{
41+
return new EndpointTemplateId(id);
42+
}
43+
}
44+
}
45+
}

0 commit comments

Comments
 (0)