< Summary

Class:Microsoft.Azure.Batch.Certificate
Assembly:Microsoft.Azure.Batch
File(s):C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\Certificate.cs
C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\Generated\Certificate.cs
Covered lines:144
Uncovered lines:87
Coverable lines:231
Total lines:530
Line coverage:62.3% (144 of 231)
Covered branches:0
Total branches:0

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_DeleteCertificateError()-100%100%
get_Password()-100%100%
set_Password(...)-100%100%
get_PreviousState()-100%100%
get_PreviousStateTransitionTime()-100%100%
get_PublicData()-100%100%
get_State()-100%100%
get_StateTransitionTime()-100%100%
get_Thumbprint()-100%100%
set_Thumbprint(...)-100%100%
get_ThumbprintAlgorithm()-100%100%
set_ThumbprintAlgorithm(...)-100%100%
get_Url()-100%100%
Microsoft.Azure.Batch.IModifiable.get_HasBeenModified()-100%100%
Microsoft.Azure.Batch.IReadOnly.get_IsReadOnly()-100%100%
Microsoft.Azure.Batch.IReadOnly.set_IsReadOnly(...)-100%100%
Microsoft.Azure.Batch.ITransportObjectProvider<Microsoft.Azure.Batch.Protocol.Models.CertificateAddParameter>.GetTransportObject()-100%100%
.ctor(...)-100%100%
.ctor()-100%100%
CommitAsync()-100%100%
.ctor(...)-100%100%
Commit(...)-100%100%
DeleteAsync()-100%100%
Delete(...)-0%100%
.ctor(...)-100%100%
CancelDeleteAsync()-100%100%
.ctor(...)-100%100%
CancelDelete(...)-0%100%
get_CustomBehaviors()-100%100%
RefreshAsync()-100%100%
get_CertificateFormat()-100%100%
set_CertificateFormat(...)-100%100%
get_Data()-100%100%
set_Data(...)-100%100%
Refresh(...)-0%100%
.ctor()-100%100%
.ctor(...)-0%100%
.ctor(...)-100%100%
.ctor(...)-0%100%
get_CustomBehaviors()-0%100%
get_CertificateFormat()-0%100%
set_CertificateFormat(...)-100%100%
get_Data()-0%100%
set_Data(...)-100%100%
get_DeleteCertificateError()-0%100%
get_Password()-0%100%
set_Password(...)-100%100%
get_PreviousState()-0%100%
get_PreviousStateTransitionTime()-0%100%
get_PublicData()-0%100%
get_State()-0%100%
get_StateTransitionTime()-0%100%
get_Thumbprint()-100%100%
set_Thumbprint(...)-100%100%
get_ThumbprintAlgorithm()-100%100%
set_ThumbprintAlgorithm(...)-100%100%
get_Url()-0%100%
Microsoft.Azure.Batch.IModifiable.get_HasBeenModified()-0%100%
Microsoft.Azure.Batch.IReadOnly.get_IsReadOnly()-0%100%
Microsoft.Azure.Batch.IReadOnly.set_IsReadOnly(...)-0%100%
Microsoft.Azure.Batch.ITransportObjectProvider<Microsoft.Azure.Batch.Protocol.Models.CertificateAddParameter>.GetTransportObject()-0%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\Certificate.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License. See License.txt in the project root for license information.
 3
 4namespace Microsoft.Azure.Batch
 5{
 6    using System.Collections.Generic;
 7    using System.Threading;
 8    using System.Threading.Tasks;
 9    using Microsoft.Rest.Azure;
 10    using Models = Microsoft.Azure.Batch.Protocol.Models;
 11
 12
 13    /// <summary>
 14    /// A certificate that can be installed on compute nodes and can be used to authenticate operations on a node.
 15    /// </summary>
 16    public partial class Certificate : IRefreshable
 17    {
 18        internal Certificate(BatchClient parentBatchClient, Models.CertificateAddParameter protocolObject, IEnumerable<B
 10919            this(
 10920            parentBatchClient,
 10921            baseBehaviors,
 10922            protocolObject.Data,
 10923            protocolObject.Thumbprint,
 10924            protocolObject.ThumbprintAlgorithm,
 10925            UtilitiesInternal.MapNullableEnum<Models.CertificateFormat, Common.CertificateFormat>(protocolObject.Certifi
 10926            protocolObject.Password)
 27        {
 10928        }
 29
 30#region Certificate
 31
 32        /// <summary>
 33        /// Adds the certificate to the Batch account.
 34        /// </summary>
 35        /// <param name="additionalBehaviors">A collection of <see cref="BatchClientBehavior"/> instances that are appli
 36        /// <param name="cancellationToken">A <see cref="CancellationToken"/> for controlling the lifetime of the asynch
 37        /// <returns>A <see cref="System.Threading.Tasks.Task"/> that represents the asynchronous operation.</returns>
 38        /// <remarks>The commit operation runs asynchronously.</remarks>
 39        public async Task CommitAsync(IEnumerable<BatchClientBehavior> additionalBehaviors = null, CancellationToken can
 10740        {
 41            // create the behavior manager
 10842            BehaviorManager bhMgr = new BehaviorManager(this.CustomBehaviors, additionalBehaviors);
 10743
 10744            // start the operation
 10845            Task asyncTask = this.parentBatchClient.ProtocolLayer.AddCertificate(this.GetTransportObject(), bhMgr, cance
 10746
 10747            // a-wait for comletion
 10848            await asyncTask.ConfigureAwait(continueOnCapturedContext: false);
 10849        }
 10750
 10751        /// <summary>
 10752        /// Adds the certificate to the Batch account.
 10753        /// </summary>
 10754        /// <param name="additionalBehaviors">A collection of <see cref="BatchClientBehavior"/> instances that are appli
 55        /// <remarks>This is a blocking operation. For a non-blocking equivalent, see <see cref="CommitAsync"/>.</remark
 100156        public void Commit(IEnumerable<BatchClientBehavior> additionalBehaviors = null)
 57        {
 100158            Task asyncTask = CommitAsync(additionalBehaviors);
 100159            asyncTask.WaitAndUnaggregateException(this.CustomBehaviors, additionalBehaviors);
 100160        }
 100161
 100162        /// <summary>
 100163        /// Deletes the certificate from the Batch account.
 100164        /// </summary>
 150365        /// <param name="additionalBehaviors">A collection of <see cref="BatchClientBehavior"/> instances that are appli
 100166        /// <param name="cancellationToken">A <see cref="CancellationToken"/> for controlling the lifetime of the asynch
 100167        /// <returns>A <see cref="System.Threading.Tasks.Task"/> that represents the asynchronous operation.</returns>
 100168        /// <remarks>
 100169        /// <para>The delete operation requests that the certificate be deleted.  The request puts the certificate in th
 100170        /// The Batch service will perform the actual certificate deletion without any further client action.</para>
 100171        /// <para>You cannot delete a certificate if a resource (pool or compute node) is using it. Before you can delet
 100172        /// <list type="bullet">
 100173        /// <item><description>The certificate is not associated with any pools.</description></item>
 100174        /// <item><description>The certificate is not installed on any compute nodes.  (Even if you remove a certificate
 100175        /// </list>
 100176        /// <para>If you try to delete a certificate that is in use, the deletion fails. The certificate state changes t
 100177        /// You can use <see cref="CancelDeleteAsync"/> to set the status back to Active if you decide that you want to 
 100178        /// <para>The delete operation runs asynchronously.</para>
 100179        /// </remarks>
 100180        public async Task DeleteAsync(IEnumerable<BatchClientBehavior> additionalBehaviors = null, CancellationToken can
 100181        {
 100182            // create the behavior manager
 100183            BehaviorManager bhMgr = new BehaviorManager(this.CustomBehaviors, additionalBehaviors);
 100184
 100185            Task asyncTask = this.parentBatchClient.ProtocolLayer.DeleteCertificate(this.ThumbprintAlgorithm, this.Thumb
 100186
 100187            await asyncTask.ConfigureAwait(continueOnCapturedContext: false);
 100188        }
 100189
 100190        /// <summary>
 100191        /// Deletes the certificate from the Batch account.
 100192        /// </summary>
 100193        /// <param name="additionalBehaviors">A collection of <see cref="BatchClientBehavior"/> instances that are appli
 100194        /// <returns>A <see cref="System.Threading.Tasks.Task"/> that represents the asynchronous operation.</returns>
 100195        /// <remarks>
 100196        /// <para>The delete operation requests that the certificate be deleted.  The request puts the certificate in th
 100197        /// The Batch service will perform the actual certificate deletion without any further client action.</para>
 100198        /// <para>You cannot delete a certificate if a resource (pool or compute node) is using it. Before you can delet
 100199        /// <list type="bullet">
 1001100        /// <item><description>The certificate is not associated with any pools.</description></item>
 1001101        /// <item><description>The certificate is not installed on any compute nodes.  (Even if you remove a certificate
 1001102        /// </list>
 1001103        /// <para>If you try to delete a certificate that is in use, the deletion fails. The certificate state changes t
 104        /// You can use <see cref="CancelDeleteAsync"/> to set the status back to Active if you decide that you want to 
 105        /// <para>This is a blocking operation. For a non-blocking equivalent, see <see cref="DeleteAsync"/>.</para>
 106        /// </remarks>
 107        public void Delete(IEnumerable<BatchClientBehavior> additionalBehaviors = null)
 108        {
 0109            Task asyncTask = DeleteAsync(additionalBehaviors);
 0110            asyncTask.WaitAndUnaggregateException(this.CustomBehaviors, additionalBehaviors);
 0111        }
 112
 113        /// <summary>
 114        /// Cancels a failed deletion of the certificate.  This can be done only when
 115        /// the certificate is in the <see cref="Common.CertificateState.DeleteFailed"/> state, and restores the certifi
 116        /// </summary>
 117        /// <param name="additionalBehaviors">A collection of <see cref="BatchClientBehavior"/> instances that are appli
 118        /// <param name="cancellationToken">A <see cref="CancellationToken"/> for controlling the lifetime of the asynch
 119        /// <returns>A <see cref="System.Threading.Tasks.Task"/> object that represents the asynchronous operation.</ret
 120        /// <remarks>
 121        /// <para>If you still wish to delete the certificate (instead of returning it to Active), you do not need to ca
 122        /// the failed deletion. You must make sure that the certificate is not being used by any resources, and then yo
 107123        /// can try again to delete the certificate (see <see cref="DeleteAsync"/>.</para>
 107124        /// <para>The cancel delete operation runs asynchronously.</para>
 107125        /// </remarks>
 107126        public async Task CancelDeleteAsync(IEnumerable<BatchClientBehavior> additionalBehaviors = null, CancellationTok
 107127        {
 107128            // create the behavior manager
 107129            BehaviorManager bhMgr = new BehaviorManager(this.CustomBehaviors, additionalBehaviors);
 107130
 131            // start operation
 107132            Task asyncTask = this.parentBatchClient.ProtocolLayer.CancelDeleteCertificate(this.ThumbprintAlgorithm, this
 107133
 107134            // wait for completion
 107135            await asyncTask.ConfigureAwait(continueOnCapturedContext: false);
 107136        }
 107137
 107138        /// <summary>
 107139        /// Cancels a failed deletion of the certificate.  This can be done only when
 107140        /// the certificate is in the <see cref="Common.CertificateState.DeleteFailed"/> state, and restores the certifi
 141        /// </summary>
 1000142        /// <param name="additionalBehaviors">A collection of <see cref="BatchClientBehavior"/> instances that are appli
 1000143        /// <remarks>
 1000144        /// <para>If you still wish to delete the certificate (instead of returning it to Active), you do not need to ca
 1000145        /// the failed deletion. You must make sure that the certificate is not being used by any resources, and then yo
 146        /// can try again to delete the certificate (see <see cref="Delete"/>.</para>
 1000147        /// <para>This is a blocking operation. For a non-blocking equivalent, see <see cref="CancelDeleteAsync"/>.</par
 1000148        /// </remarks>
 1000149        public void CancelDelete(IEnumerable<BatchClientBehavior> additionalBehaviors = null)
 1000150        {
 0151            Task asyncTask = CancelDeleteAsync(additionalBehaviors);
 0152            asyncTask.WaitAndUnaggregateException(this.CustomBehaviors, additionalBehaviors);
 0153        }
 154
 155#endregion Certificate
 156
 157
 158#region IRefreshable
 159
 160        /// <summary>
 161        /// Refreshes the current <see cref="Certificate"/>.
 162        /// </summary>
 163        /// <param name="detailLevel">The detail level for the refresh.  If a detail level which omits the <see cref="Th
 1160164        /// <param name="additionalBehaviors">A collection of <see cref="BatchClientBehavior"/> instances that are appli
 165        /// <param name="cancellationToken">A <see cref="CancellationToken"/> for controlling the lifetime of the asynch
 166        /// <returns>A <see cref="Task"/> representing the asynchronous refresh operation.</returns>
 167        public async Task RefreshAsync(DetailLevel detailLevel = null, IEnumerable<BatchClientBehavior> additionalBehavi
 168        {
 169            // set up behavior manager
 2170            BehaviorManager bhMgr = new BehaviorManager(this.CustomBehaviors, additionalBehaviors, detailLevel);
 171
 172            // start operation
 2173            Task<AzureOperationResponse<Models.Certificate, Models.CertificateGetHeaders>> asyncTask =
 2174                this.parentBatchClient.ProtocolLayer.GetCertificate(this.ThumbprintAlgorithm, this.Thumbprint, bhMgr, ca
 202175
 333176            AzureOperationResponse<Models.Certificate, Models.CertificateGetHeaders> response = await asyncTask.Configur
 177
 178            // extract the refreshed protocol object
 1179            Models.Certificate refreshedProtoCert = response.Body;
 180
 181            // swap in the new protocol object
 1182            this.propertyContainer = new PropertyContainer(refreshedProtoCert);
 1183        }
 184
 185        /// <summary>
 186        /// Refreshes the current <see cref="Certificate"/>.
 187        /// </summary>
 188        /// <param name="detailLevel">The detail level for the refresh.  If a detail level which omits the <see cref="Th
 202189        /// <param name="additionalBehaviors">A collection of <see cref="BatchClientBehavior"/> instances that are appli
 323190        public void Refresh(DetailLevel detailLevel = null, IEnumerable<BatchClientBehavior> additionalBehaviors = null)
 191        {
 0192            Task asynctask = RefreshAsync(detailLevel, additionalBehaviors);
 0193            asynctask.WaitAndUnaggregateException(this.CustomBehaviors, additionalBehaviors);
 0194        }
 195
 196#endregion IRefreshable
 197
 198    }
 199}

C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\Generated\Certificate.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License. See License.txt in the project root for license information.
 3//
 4// Code generated by Microsoft (R) AutoRest Code Generator.
 5// Changes may cause incorrect behavior and will be lost if the code is
 6// regenerated.
 7
 8//
 9// This file was autogenerated by a tool.
 10// Do not modify it.
 11//
 12
 13namespace Microsoft.Azure.Batch
 14{
 15    using Models = Microsoft.Azure.Batch.Protocol.Models;
 16    using System;
 17    using System.Collections.Generic;
 18    using System.Linq;
 19
 20    /// <summary>
 21    /// A certificate that can be installed on compute nodes and can be used to authenticate operations on a node.
 22    /// </summary>
 23    public partial class Certificate : ITransportObjectProvider<Models.CertificateAddParameter>, IInheritedBehaviors, IP
 24    {
 25        private class PropertyContainer : PropertyCollection
 26        {
 27            public readonly PropertyAccessor<Common.CertificateFormat?> CertificateFormatProperty;
 28            public readonly PropertyAccessor<string> DataProperty;
 29            public readonly PropertyAccessor<DeleteCertificateError> DeleteCertificateErrorProperty;
 30            public readonly PropertyAccessor<string> PasswordProperty;
 31            public readonly PropertyAccessor<Common.CertificateState?> PreviousStateProperty;
 32            public readonly PropertyAccessor<DateTime?> PreviousStateTransitionTimeProperty;
 33            public readonly PropertyAccessor<string> PublicDataProperty;
 34            public readonly PropertyAccessor<Common.CertificateState?> StateProperty;
 35            public readonly PropertyAccessor<DateTime?> StateTransitionTimeProperty;
 36            public readonly PropertyAccessor<string> ThumbprintProperty;
 37            public readonly PropertyAccessor<string> ThumbprintAlgorithmProperty;
 38            public readonly PropertyAccessor<string> UrlProperty;
 39
 440            public PropertyContainer() : base(BindingState.Unbound)
 41            {
 442                this.CertificateFormatProperty = this.CreatePropertyAccessor<Common.CertificateFormat?>(nameof(Certifica
 443                this.DataProperty = this.CreatePropertyAccessor<string>(nameof(Data), BindingAccess.Read | BindingAccess
 444                this.DeleteCertificateErrorProperty = this.CreatePropertyAccessor<DeleteCertificateError>(nameof(DeleteC
 445                this.PasswordProperty = this.CreatePropertyAccessor<string>(nameof(Password), BindingAccess.Read | Bindi
 446                this.PreviousStateProperty = this.CreatePropertyAccessor<Common.CertificateState?>(nameof(PreviousState)
 447                this.PreviousStateTransitionTimeProperty = this.CreatePropertyAccessor<DateTime?>(nameof(PreviousStateTr
 448                this.PublicDataProperty = this.CreatePropertyAccessor<string>(nameof(PublicData), BindingAccess.None);
 449                this.StateProperty = this.CreatePropertyAccessor<Common.CertificateState?>(nameof(State), BindingAccess.
 450                this.StateTransitionTimeProperty = this.CreatePropertyAccessor<DateTime?>(nameof(StateTransitionTime), B
 451                this.ThumbprintProperty = this.CreatePropertyAccessor<string>(nameof(Thumbprint), BindingAccess.Read | B
 452                this.ThumbprintAlgorithmProperty = this.CreatePropertyAccessor<string>(nameof(ThumbprintAlgorithm), Bind
 453                this.UrlProperty = this.CreatePropertyAccessor<string>(nameof(Url), BindingAccess.None);
 454            }
 55
 056            public PropertyContainer(Models.Certificate protocolObject) : base(BindingState.Bound)
 57            {
 058                this.CertificateFormatProperty = this.CreatePropertyAccessor<Common.CertificateFormat?>(
 059                    nameof(CertificateFormat),
 060                    BindingAccess.None);
 061                this.DataProperty = this.CreatePropertyAccessor<string>(
 062                    nameof(Data),
 063                    BindingAccess.None);
 064                this.DeleteCertificateErrorProperty = this.CreatePropertyAccessor(
 065                    UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.DeleteCertificateError, o => new DeleteCe
 066                    nameof(DeleteCertificateError),
 067                    BindingAccess.Read);
 068                this.PasswordProperty = this.CreatePropertyAccessor<string>(
 069                    nameof(Password),
 070                    BindingAccess.None);
 071                this.PreviousStateProperty = this.CreatePropertyAccessor(
 072                    UtilitiesInternal.MapNullableEnum<Models.CertificateState, Common.CertificateState>(protocolObject.P
 073                    nameof(PreviousState),
 074                    BindingAccess.Read);
 075                this.PreviousStateTransitionTimeProperty = this.CreatePropertyAccessor(
 076                    protocolObject.PreviousStateTransitionTime,
 077                    nameof(PreviousStateTransitionTime),
 078                    BindingAccess.Read);
 079                this.PublicDataProperty = this.CreatePropertyAccessor(
 080                    protocolObject.PublicData,
 081                    nameof(PublicData),
 082                    BindingAccess.Read);
 083                this.StateProperty = this.CreatePropertyAccessor(
 084                    UtilitiesInternal.MapNullableEnum<Models.CertificateState, Common.CertificateState>(protocolObject.S
 085                    nameof(State),
 086                    BindingAccess.Read);
 087                this.StateTransitionTimeProperty = this.CreatePropertyAccessor(
 088                    protocolObject.StateTransitionTime,
 089                    nameof(StateTransitionTime),
 090                    BindingAccess.Read);
 091                this.ThumbprintProperty = this.CreatePropertyAccessor(
 092                    protocolObject.Thumbprint,
 093                    nameof(Thumbprint),
 094                    BindingAccess.Read);
 095                this.ThumbprintAlgorithmProperty = this.CreatePropertyAccessor(
 096                    protocolObject.ThumbprintAlgorithm,
 097                    nameof(ThumbprintAlgorithm),
 098                    BindingAccess.Read);
 099                this.UrlProperty = this.CreatePropertyAccessor(
 0100                    protocolObject.Url,
 0101                    nameof(Url),
 0102                    BindingAccess.Read);
 0103            }
 104        }
 105
 106        private PropertyContainer propertyContainer;
 107
 108        private readonly BatchClient parentBatchClient;
 109
 110        #region Constructors
 111
 112        /// <summary>
 113        /// Initializes a new instance of the <see cref="Certificate"/> class.
 114        /// </summary>
 115        /// <param name='parentBatchClient'>The parent <see cref="BatchClient"/> to use.</param>
 116        /// <param name='baseBehaviors'>The base behaviors to use.</param>
 117        /// <param name='data'>The base64-encoded raw certificate data (contents of the .pfx or .cer file or data from w
 118        /// was created).</param>
 119        /// <param name='thumbprint'>The thumbprint of the certificate. This is a sequence of up to 40 hex digits.</para
 120        /// <param name='thumbprintAlgorithm'>The algorithm used to derive the thumbprint.</param>
 121        /// <param name='certificateFormat'>The format of the certificate data.</param>
 122        /// <param name='password'>The password to access the certificate private key.</param>
 4123        internal Certificate(
 4124            BatchClient parentBatchClient,
 4125            IEnumerable<BatchClientBehavior> baseBehaviors,
 4126            string data,
 4127            string thumbprint,
 4128            string thumbprintAlgorithm,
 4129            Common.CertificateFormat? certificateFormat = default(Common.CertificateFormat?),
 4130            string password = default(string))
 131        {
 4132            this.propertyContainer = new PropertyContainer();
 4133            this.parentBatchClient = parentBatchClient;
 4134            this.Data = data;
 4135            this.Thumbprint = thumbprint;
 4136            this.ThumbprintAlgorithm = thumbprintAlgorithm;
 4137            this.CertificateFormat = certificateFormat;
 4138            this.Password = password;
 4139            InheritUtil.InheritClientBehaviorsAndSetPublicProperty(this, baseBehaviors);
 4140        }
 141
 0142        internal Certificate(
 0143            BatchClient parentBatchClient,
 0144            Models.Certificate protocolObject,
 0145            IEnumerable<BatchClientBehavior> baseBehaviors)
 146        {
 0147            this.parentBatchClient = parentBatchClient;
 0148            InheritUtil.InheritClientBehaviorsAndSetPublicProperty(this, baseBehaviors);
 0149            this.propertyContainer = new PropertyContainer(protocolObject);
 0150        }
 151
 152        #endregion Constructors
 153
 154        #region IInheritedBehaviors
 155
 156        /// <summary>
 157        /// Gets or sets a list of behaviors that modify or customize requests to the Batch service
 158        /// made via this <see cref="Certificate"/>.
 159        /// </summary>
 160        /// <remarks>
 161        /// <para>These behaviors are inherited by child objects.</para>
 162        /// <para>Modifications are applied in the order of the collection. The last write wins.</para>
 163        /// </remarks>
 0164        public IList<BatchClientBehavior> CustomBehaviors { get; set; }
 165
 166        #endregion IInheritedBehaviors
 167
 168        #region Certificate
 169
 170        /// <summary>
 171        /// Gets the format of the certificate data.
 172        /// </summary>
 173        public Common.CertificateFormat? CertificateFormat
 174        {
 0175            get { return this.propertyContainer.CertificateFormatProperty.Value; }
 8176            private set { this.propertyContainer.CertificateFormatProperty.Value = value; }
 177        }
 178
 179        /// <summary>
 180        /// Gets the base64-encoded raw certificate data (contents of the .pfx or .cer file or data from which the <see 
 181        /// was created).
 182        /// </summary>
 183        /// <remarks>
 184        /// <para>This property is set when creating a new <see cref="Certificate"/>. It is not defined for certificates
 185        /// retrieved from the Batch service.</para> <para>The maximum size is 10 KB.</para>
 186        /// </remarks>
 187        public string Data
 188        {
 0189            get { return this.propertyContainer.DataProperty.Value; }
 8190            private set { this.propertyContainer.DataProperty.Value = value; }
 191        }
 192
 193        /// <summary>
 194        /// Gets the error that occurred on the last attempt to delete this certificate.
 195        /// </summary>
 196        /// <remarks>
 197        /// This property is null unless the certificate is in the <see cref="Common.CertificateState.DeleteFailed"/> st
 198        /// </remarks>
 199        public DeleteCertificateError DeleteCertificateError
 200        {
 0201            get { return this.propertyContainer.DeleteCertificateErrorProperty.Value; }
 202        }
 203
 204        /// <summary>
 205        /// Gets the password to access the certificate private key.
 206        /// </summary>
 207        /// <remarks>
 208        /// This property is set when creating a new <see cref="Certificate"/> from .pfx format data (see <see cref="Cer
 209        /// string)"/> and <see cref="CertificateOperations.CreateCertificateFromPfx(string, string)"/>). It is not defi
 210        /// certificates retrieved from the Batch service.
 211        /// </remarks>
 212        public string Password
 213        {
 0214            get { return this.propertyContainer.PasswordProperty.Value; }
 8215            private set { this.propertyContainer.PasswordProperty.Value = value; }
 216        }
 217
 218        /// <summary>
 219        /// Gets the previous state of the certificate.
 220        /// </summary>
 221        /// <remarks>
 222        /// If the certificate is in its initial <see cref="Common.CertificateState.Active"/> state, the PreviousState p
 223        /// is not defined.
 224        /// </remarks>
 225        public Common.CertificateState? PreviousState
 226        {
 0227            get { return this.propertyContainer.PreviousStateProperty.Value; }
 228        }
 229
 230        /// <summary>
 231        /// Gets the time at which the certificate entered its previous state.
 232        /// </summary>
 233        /// <remarks>
 234        /// If the certificate is in its initial <see cref="Common.CertificateState.Active"/> state, the PreviousStateTr
 235        /// property is not defined.
 236        /// </remarks>
 237        public DateTime? PreviousStateTransitionTime
 238        {
 0239            get { return this.propertyContainer.PreviousStateTransitionTimeProperty.Value; }
 240        }
 241
 242        /// <summary>
 243        /// Gets the public part of the certificate as a string containing base-64 encoded .cer format data.
 244        /// </summary>
 245        public string PublicData
 246        {
 0247            get { return this.propertyContainer.PublicDataProperty.Value; }
 248        }
 249
 250        /// <summary>
 251        /// Gets the current state of the certificate.
 252        /// </summary>
 253        public Common.CertificateState? State
 254        {
 0255            get { return this.propertyContainer.StateProperty.Value; }
 256        }
 257
 258        /// <summary>
 259        /// Gets the time at which the certificate entered its current state.
 260        /// </summary>
 261        public DateTime? StateTransitionTime
 262        {
 0263            get { return this.propertyContainer.StateTransitionTimeProperty.Value; }
 264        }
 265
 266        /// <summary>
 267        /// Gets the thumbprint of the certificate. This is a sequence of up to 40 hex digits.
 268        /// </summary>
 269        public string Thumbprint
 270        {
 4271            get { return this.propertyContainer.ThumbprintProperty.Value; }
 8272            private set { this.propertyContainer.ThumbprintProperty.Value = value; }
 273        }
 274
 275        /// <summary>
 276        /// Gets the algorithm used to derive the thumbprint.
 277        /// </summary>
 278        public string ThumbprintAlgorithm
 279        {
 4280            get { return this.propertyContainer.ThumbprintAlgorithmProperty.Value; }
 8281            private set { this.propertyContainer.ThumbprintAlgorithmProperty.Value = value; }
 282        }
 283
 284        /// <summary>
 285        /// Gets the URL of the certificate.
 286        /// </summary>
 287        public string Url
 288        {
 0289            get { return this.propertyContainer.UrlProperty.Value; }
 290        }
 291
 292        #endregion // Certificate
 293
 294        #region IPropertyMetadata
 295
 296        bool IModifiable.HasBeenModified
 297        {
 0298            get { return this.propertyContainer.HasBeenModified; }
 299        }
 300
 301        bool IReadOnly.IsReadOnly
 302        {
 0303            get { return this.propertyContainer.IsReadOnly; }
 0304            set { this.propertyContainer.IsReadOnly = value; }
 305        }
 306
 307        #endregion //IPropertyMetadata
 308
 309        #region Internal/private methods
 310        /// <summary>
 311        /// Return a protocol object of the requested type.
 312        /// </summary>
 313        /// <returns>The protocol object of the requested type.</returns>
 314        Models.CertificateAddParameter ITransportObjectProvider<Models.CertificateAddParameter>.GetTransportObject()
 315        {
 0316            Models.CertificateAddParameter result = new Models.CertificateAddParameter()
 0317            {
 0318                CertificateFormat = UtilitiesInternal.MapNullableEnum<Common.CertificateFormat, Models.CertificateFormat
 0319                Data = this.Data,
 0320                Password = this.Password,
 0321                Thumbprint = this.Thumbprint,
 0322                ThumbprintAlgorithm = this.ThumbprintAlgorithm,
 0323            };
 324
 0325            return result;
 326        }
 327
 328
 329        #endregion // Internal/private methods
 330    }
 331}