/// <summary>
 ///     Create an Attachment
 /// </summary>
 /// <param name='operations'>
 ///     Reference to the DocumentDBRestAPIClient.IDocumentDbConnector.
 /// </param>
 /// <param name='ridDB'>
 ///     Required. The Database Id
 /// </param>
 /// <param name='ridColl'>
 ///     Required. The Collection Id
 /// </param>
 /// <param name='ridDoc'>
 ///     Required. The Document Id
 /// </param>
 /// <param name='request'>
 ///     Required.
 /// </param>
 /// <param name='authorization'>
 ///     Required. The authentication type and signature token. Both master
 ///     key and resource tokens are allowed for  operation.
 ///     <c>type={typeoftoken}%26ver={tokenversion}%26sig={hashsignature}</c>
 /// </param>
 /// <param name='userAgent'>
 ///     Required. Optional. The string of client user agent performing the
 ///     request. The recommended format is
 ///     <c>
 ///         {user agent
 ///         name}/{version}
 ///     </c>
 /// </param>
 /// <param name='xMSDate'>
 ///     Required. The date of the request The date is expressed in
 ///     Coordinated Universal Time format.
 ///     <example>Fri, 08 Apr 2015 03:52:31 GMT</example>
 /// </param>
 /// <param name='xMSVersion'>
 ///     Required. The version of DocumentDB REST service. The latest
 ///     version is used when the header is not provided use 2015-08-06
 /// </param>
 public static AttachmentResponse CreateAttachement(IDocumentDbConnector operations, string ridDB,
                                                    string ridColl, string ridDoc, AttachmentRaw request, string authorization, string userAgent, string xMSDate,
                                                    string xMSVersion)
 {
     return(Task.Factory.StartNew(
                s =>
                ((IDocumentDbConnector)s).CreateAttachementAsync(ridDB, ridColl, ridDoc, request, authorization,
                                                                 userAgent, xMSDate, xMSVersion), operations, CancellationToken.None,
                TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Exemplo n.º 2
0
 /// <param name='operations'>
 ///     Reference to the DocumentDBRestAPIClient.IDocumentDbConnector.
 /// </param>
 /// <param name='authorization'>
 ///     Required. The authentication type and signature token. Both master
 ///     key and resource tokens are allowed for  operation.
 ///     <c>type={typeoftoken}%26ver={tokenversion}%26sig={hashsignature}</c>
 /// </param>
 /// <param name='contentType'>
 ///     Required. For creating a database, the Content-Type header must be
 ///     `<c>application/json</c>`.
 /// </param>
 /// <param name='xMSDate'>
 ///     Required. The date of the request The date is expressed in
 ///     Coordinated Universal Time format.
 ///     <example>
 ///         Fri, 08 Apr 2015
 ///         03:52:31 GMT
 ///     </example>
 /// </param>
 /// <param name='id'>
 ///     Required.  is a user settable property. It is the unique name
 ///     that identifies the collection
 /// </param>
 public static Database CreateDatabase(IDocumentDbConnector operations, string authorization,
                                       string contentType, string xMSDate, CustomBodyCollection id)
 {
     return
         (Task.Factory.StartNew(
              s => ((IDocumentDbConnector)s).CreateDatabaseAsync(authorization, contentType, xMSDate, id),
              operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default)
          .Unwrap()
          .GetAwaiter()
          .GetResult());
 }
        ///// <summary>
        /////     Get a Collection
        ///// </summary>
        ///// <param name='operations'>
        /////     Reference to the DocumentDBRestAPIClient.IDocumentDbConnector.
        ///// </param>
        ///// <param name='ridDB'>
        /////     Required. The Database Id
        ///// </param>
        ///// <param name='ridColl'>
        /////     Required. The Collection Id
        ///// </param>
        ///// <param name='authorization'>
        /////     Required. The authentication type and signature token. Both master
        /////     key and resource tokens are allowed for  operation.
        /////     <c>type={typeoftoken}%26ver={tokenversion}%26sig={hashsignature}</c>
        ///// </param>
        ///// <param name='userAgent'>
        /////     Required. Optional. The string of client user agent performing the
        /////     request. The recommended format is
        /////     <c>
        /////         {user agent
        /////         name}/{version}
        /////     </c>
        /////     .
        ///// </param>
        ///// <param name='xMSDate'>
        /////     Required. The date of the request The date is expressed in
        /////     Coordinated Universal Time format.
        /////     <example>
        /////         Fri, 08 Apr
        /////         2015 03:52:31 GMT
        /////     </example>
        ///// </param>
        ///// <param name='xMSVersion'>
        /////     Required. The version of DocumentDB REST service. The latest
        /////     version is used when the header is not provided use
        /////     <c>2015-08-06</c>
        ///// </param>
        ///// <param name='cancellationToken'>
        /////     Cancellation token.
        ///// </param>
        //public static async Task<Collection> GetCollectionByIdAsync(IDocumentDbConnector operations, string ridDB,
        //    string ridColl, string authorization, string userAgent, string xMSDate, string xMSVersion,
        //    CancellationToken cancellationToken = default(CancellationToken))
        //{
        //    var result =
        //        await
        //            operations.GetCollectionByIdWithOperationResponseAsync(ridDB, ridColl, authorization, userAgent,
        //                xMSDate, xMSVersion, cancellationToken).ConfigureAwait(false);
        //    return result.Body;
        //}

        /// <summary>
        ///     List Collections
        /// </summary>
        /// <param name='operations'>
        ///     Reference to the DocumentDBRestAPIClient.IDocumentDbConnector.
        /// </param>
        /// <param name='ridDB'>
        ///     Required. The Database Id
        /// </param>
        /// <param name='authorization'>
        ///     Required. The authentication type and signature token. Both master
        ///     key and resource tokens are allowed for  operation.
        ///     <c>type={typeoftoken}%26ver={tokenversion}%26sig={hashsignature}</c>
        /// </param>
        /// <param name='userAgent'>
        ///     Required. Optional. The string of client user agent performing the
        ///     request. The recommended format is
        ///     <c>
        ///         {user agent
        ///         name}/{version}
        ///     </c>
        ///     .
        /// </param>
        /// <param name='xMSDate'>
        ///     Required. The date of the request The date is expressed in
        ///     Coordinated Universal Time format.
        ///     <example>
        ///         Fri, 08 Apr
        ///         2015 03:52:31 GMT
        ///     </example>
        /// </param>
        /// <param name='xMSVersion'>
        ///     Required. The version of DocumentDB REST service. The latest
        ///     version is used when the header is not provided use
        ///     <c>2015-08-06</c>
        /// </param>
        public static IList <Collection> ListCollections(IDocumentDbConnector operations, string ridDB,
                                                         string authorization, string userAgent, string xMSDate, string xMSVersion)
        {
            return
                (Task.Factory.StartNew(
                     s => ((IDocumentDbConnector)s).ListCollectionsAsync(ridDB, authorization, userAgent, xMSDate,
                                                                         xMSVersion), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default)
                 .Unwrap()
                 .GetAwaiter()
                 .GetResult());
        }
Exemplo n.º 4
0
        ///// <summary>
        /////     Delete a Database
        ///// </summary>
        ///// <param name='operations'>
        /////     Reference to the DocumentDBRestAPIClient.IDocumentDbConnector.
        ///// </param>
        ///// <param name='ridDB'>
        /////     Required. The Database Id
        ///// </param>
        ///// <param name='authorization'>
        /////     Required. The authentication type and signature token. Both master
        /////     key and resource tokens are allowed for  operation.
        /////     <c>type={typeoftoken}%26ver={tokenversion}%26sig={hashsignature}</c>
        ///// </param>
        ///// <param name='contentType'>
        /////     Required. Optional. For creating a database, the Content-Type
        /////     header must be application/json.
        ///// </param>
        ///// <param name='userAgent'>
        /////     Required. Optional. The string of client user agent performing the
        /////     request. The recommended format is
        /////     <c>{ user agentname}/{ version}</c>
        ///// </param>
        ///// <param name='xMSDate'>
        /////     Required. The date of the request The date is expressed in
        /////     Coordinated Universal Time format.
        /////     <example>
        /////         Fri, 08 Apr 2015 03:52:31 GMT
        /////     </example>
        ///// </param>
        ///// <param name='xMSVersion'>
        /////     Required. The version of DocumentDB REST service. The latest
        /////     version is used when the header is not provided use
        /////     <c>2015-08-06</c>
        ///// </param>
        ///// <param name='cancellationToken'>
        /////     Cancellation token.
        ///// </param>
        //public static async Task<object> DeleteDatabaseAsync(IDocumentDbConnector operations, string ridDB,
        //    string authorization, string contentType, string userAgent, string xMSDate, string xMSVersion,
        //    CancellationToken cancellationToken = default(CancellationToken))
        //{
        //    var result =
        //        await
        //            operations.DeleteDatabaseWithOperationResponseAsync(ridDB, authorization, contentType, userAgent,
        //                xMSDate, xMSVersion, cancellationToken).ConfigureAwait(false);
        //    return result.Body;
        //}

        /// <summary>
        ///     Retrieve a database resource by Id
        /// </summary>
        /// <param name='operations'>
        ///     Reference to the DocumentDBRestAPIClient.IDocumentDbConnector.
        /// </param>
        /// <param name='ridDB'>
        ///     Required. The Database Id
        /// </param>
        /// <param name='authorization'>
        ///     Required. The authentication type and signature token. Both master
        ///     key and resource tokens are allowed for  operation.
        ///     <c>type={typeoftoken}%26ver={tokenversion}%26sig={hashsignature}</c>
        /// </param>
        /// <param name='contentType'>
        ///     Required. Optional. For creating a database, the Content-Type
        ///     header must be `application/json`.
        /// </param>
        /// <param name='userAgent'>
        ///     Required. Optional. The string of client user agent performing the
        ///     request. The recommended format is
        ///     <c>
        ///         {user agent
        ///         name}/{version}
        ///     </c>
        ///     .
        /// </param>
        /// <param name='xMSDate'>
        ///     Required. The date of the request The date is expressed in
        ///     Coordinated Universal Time format.
        ///     <example>
        ///         Fri, 08 Apr 2015
        ///         03:52:31 GMT
        ///     </example>
        /// </param>
        /// <param name='xMSVersion'>
        ///     Required. The version of DocumentDB REST service. The latest
        ///     version is used when the header is not provided use
        ///     <c>2015-08-06</c>
        /// </param>
        /// <param name='xMSGatewayversion'>
        ///     Required.
        /// </param>
        public static Database GetDatabaseById(IDocumentDbConnector operations, string ridDB, string authorization,
                                               string contentType, string userAgent, string xMSDate, string xMSVersion, string xMSGatewayversion)
        {
            return
                (Task.Factory.StartNew(
                     s => ((IDocumentDbConnector)s).GetDatabaseByIdAsync(ridDB, authorization, contentType,
                                                                         userAgent, xMSDate, xMSVersion, xMSGatewayversion), operations, CancellationToken.None,
                     TaskCreationOptions.None, TaskScheduler.Default)
                 .Unwrap()
                 .GetAwaiter()
                 .GetResult());
        }
Exemplo n.º 5
0
        ///// <summary>
        /////     Get a User
        ///// </summary>
        ///// <param name='operations'>
        /////     Reference to the DocumentDBRestAPIClient.IDocumentDbConnector.
        ///// </param>
        ///// <param name='ridDB'>
        /////     Required. The Database Id
        ///// </param>
        ///// <param name='ridUser'>
        /////     Required. The User Id
        ///// </param>
        ///// <param name='authorization'>
        /////     Required. The authentication type and signature token. Both master
        /////     key and resource tokens are allowed for  operation.
        /////     <c>type={typeoftoken}%26ver={tokenversion}%26sig={hashsignature}</c>
        ///// </param>
        ///// <param name='contentType'>
        /////     Required. Optional. For creating a database, the Content-Type
        /////     header must be application/json.
        ///// </param>
        ///// <param name='userAgent'>
        /////     Required. Optional. The string of client user agent performing the
        /////     request. The recommended format is
        /////     <c>{ user agentname}/{ version}</c>
        ///// </param>
        ///// <param name='xMSDate'>
        /////     Required. The date of the request The date is expressed in
        /////     Coordinated Universal Time format.
        /////     <example>Fri, 08 Apr 2015 03:52:31 GMT</example>
        ///// </param>
        ///// <param name='xMSVersion'>
        /////     Required. The version of DocumentDB REST service. The latest
        /////     version is used when the header is not provided use 2015-08-06
        ///// </param>
        ///// <param name='cancellationToken'>
        /////     Cancellation token.
        ///// </param>
        //public static async Task<User> GetUserByIdAsync(IDocumentDbConnector operations, string ridDB,
        //    string ridUser,
        //    string authorization, string contentType, string userAgent, string xMSDate, string xMSVersion,
        //    CancellationToken cancellationToken = default(CancellationToken))
        //{
        //    var result =
        //        await
        //            operations.GetUserByIdWithOperationResponseAsync(ridDB, ridUser, authorization, contentType,
        //                userAgent, xMSDate, xMSVersion, cancellationToken).ConfigureAwait(false);
        //    return result.Body;
        //}

        /// <summary>
        ///     Replace a User
        /// </summary>
        /// <param name='operations'>
        ///     Reference to the DocumentDBRestAPIClient.IDocumentDbConnector.
        /// </param>
        /// <param name='ridDB'>
        ///     Required. The Database Id
        /// </param>
        /// <param name='ridUser'>
        ///     Required. The User Id
        /// </param>
        /// <param name='request'>
        ///     Required.
        /// </param>
        /// <param name='authorization'>
        ///     Required. The authentication type and signature token. Both master
        ///     key and resource tokens are allowed for  operation.
        ///     <c>type={typeoftoken}%26ver={tokenversion}%26sig={hashsignature}</c>
        /// </param>
        /// <param name='contentType'>
        ///     Required. Optional. For creating a database, the Content-Type
        ///     header must be application/json.
        /// </param>
        /// <param name='userAgent'>
        ///     Required. Optional. The string of client user agent performing the
        ///     request. The recommended format is
        ///     <c>{ user agentname}/{ version}</c>
        /// </param>
        /// <param name='xMSDate'>
        ///     Required. The date of the request The date is expressed in
        ///     Coordinated Universal Time format.
        ///     <example>Fri, 08 Apr 2015 03:52:31 GMT</example>
        /// </param>
        /// <param name='xMSVersion'>
        ///     Required. The version of DocumentDB REST service. The latest
        ///     version is used when the header is not provided use 2015-08-06
        /// </param>
        public static User ReplaceUser(IDocumentDbConnector operations, string ridDB, string ridUser, User request,
                                       string authorization, string contentType, string userAgent, string xMSDate, string xMSVersion)
        {
            return
                (Task.Factory.StartNew(
                     s => ((IDocumentDbConnector)s).ReplaceUserAsync(ridDB, ridUser, request, authorization,
                                                                     contentType, userAgent, xMSDate, xMSVersion), operations, CancellationToken.None,
                     TaskCreationOptions.None, TaskScheduler.Default)
                 .Unwrap()
                 .GetAwaiter()
                 .GetResult());
        }
 /// <summary>
 ///     Create a new Collection
 /// </summary>
 /// <param name='operations'>
 ///     Reference to the DocumentDBRestAPIClient.IDocumentDbConnector.
 /// </param>
 /// <param name='ridDB'>
 ///     Required. The Database Id
 /// </param>
 /// <param name='authorization'>
 ///     Required. The authentication type and signature token. Both master
 ///     key and resource tokens are allowed for  operation.
 ///     <c>type={typeoftoken}%26ver={tokenversion}%26sig={hashsignature}</c>
 /// </param>
 /// <param name='xMSDate'>
 ///     Required. The date of the request The date is expressed in
 ///     Coordinated Universal Time format.
 ///     <example>
 ///         Fri, 08 Apr
 ///         2015 03:52:31 GMT
 ///     </example>
 /// </param>
 /// <param name='xMSVersion'>
 ///     Required. The version of DocumentDB REST service. The latest
 ///     version is used when the header is not provided use
 ///     <c>2015-08-06</c>
 /// </param>
 /// <param name='id'>
 ///     Required.  is a user settable property. It is the unique name
 ///     that identifies the collection
 /// </param>
 public static Collection CreateCollection(IDocumentDbConnector operations, string ridDB,
                                           string authorization,
                                           string xMSDate, string xMSVersion, CustomBodyCollection id)
 {
     return
         (Task.Factory.StartNew(
              s => ((IDocumentDbConnector)s).CreateCollectionAsync(ridDB, authorization, xMSDate, xMSVersion,
                                                                   id), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default)
          .Unwrap()
          .GetAwaiter()
          .GetResult());
 }
Exemplo n.º 7
0
 /// <param name='operations'>
 ///     Reference to the DocumentDBRestAPIClient.IDocumentDbConnector.
 /// </param>
 /// <param name='databaseaccount'>
 ///     Required. The Database Account Name
 /// </param>
 /// <param name='authorization'>
 ///     Required. The authentication type and signature token. Both master
 ///     key and resource tokens are allowed for  operation. example:
 ///     <c>type={typeoftoken}%26ver={tokenversion}%26sig={hashsignature}</c>
 /// </param>
 /// <param name='contentType'>
 ///     Required. Optional. For creating a database, the Content-Type
 ///     header must be application/json.
 /// </param>
 /// <param name='userAgent'>
 ///     Required. Optional. The string of client user agent performing the
 ///     request.
 /// </param>
 /// <param name='xMSDate'>
 ///     Required. The date of the request The date is expressed in
 ///     Coordinated Universal Time format.
 ///     <example>
 ///         Fri, 08 Apr 2015
 ///         03:52:31 GMT
 ///     </example>
 /// </param>
 /// <param name='xMSVersion'>
 ///     Required. The version of DocumentDB REST service. The latest
 ///     version is used when the header is not provided use 2015-08-06
 /// </param>
 public static IList <Offer> GetListOfOffers(IDocumentDbConnector operations, string databaseaccount,
                                             string authorization, string contentType, string userAgent, string xMSDate, string xMSVersion)
 {
     return
         (Task.Factory.StartNew(
              s => ((IDocumentDbConnector)s).GetListOfOffersAsync(databaseaccount, authorization, contentType,
                                                                  userAgent, xMSDate, xMSVersion), operations, CancellationToken.None, TaskCreationOptions.None,
              TaskScheduler.Default)
          .Unwrap()
          .GetAwaiter()
          .GetResult());
 }
Exemplo n.º 8
0
 /// <summary>
 ///     Query a UDF
 /// </summary>
 /// <param name='operations'>
 ///     Reference to the DocumentDBRestAPIClient.IDocumentDbConnector.
 /// </param>
 /// <param name='ridDB'>
 ///     Required. The Database Id
 /// </param>
 /// <param name='ridColl'>
 ///     Required. The Collection Id
 /// </param>
 /// <param name='request'>
 ///     Required.
 /// </param>
 /// <param name='authorization'>
 ///     Required. The authentication type and signature token. Both master
 ///     key and resource tokens are allowed for  operation.
 ///     <c>type={typeoftoken}%26ver={tokenversion}%26sig={hashsignature}</c>
 /// </param>
 /// <param name='contentType'>
 ///     Required. Required. The Content-Type header must be
 ///     application/json.
 /// </param>
 /// <param name='xMSDocumentdbQueryEnableScan'>
 ///     Required.
 /// </param>
 /// <param name='xMSDocumentdbIsquery'>
 ///     Required.
 /// </param>
 /// <param name='userAgent'>
 ///     Required. Optional. The string of client user agent performing the
 ///     request. The recommended format is
 ///     <c>{ user agentname}/{ version}</c>
 /// </param>
 /// <param name='xMSDate'>
 ///     Required. The date of the request The date is expressed in
 ///     Coordinated Universal Time format. example:
 ///     <example>
 ///         Fri, 08 Apr
 ///         2015 03:52:31 GMT
 ///     </example>
 /// </param>
 /// <param name='xMSVersion'>
 ///     Required. The version of DocumentDB REST service. The latest
 ///     version is used when the header is not provided use 2015-08-06
 /// </param>
 public static QueryResponseBody QueryUdf(IDocumentDbConnector operations, string ridDB, string ridColl,
                                          QueryRequest request, string authorization, string contentType, bool xMSDocumentdbQueryEnableScan,
                                          bool xMSDocumentdbIsquery, string userAgent, string xMSDate, string xMSVersion)
 {
     return
         (Task.Factory.StartNew(
              s => ((IDocumentDbConnector)s).QueryUdfAsync(ridDB, ridColl, request, authorization,
                                                           contentType, xMSDocumentdbQueryEnableScan, xMSDocumentdbIsquery, userAgent, xMSDate,
                                                           xMSVersion), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default)
          .Unwrap()
          .GetAwaiter()
          .GetResult());
 }
Exemplo n.º 9
0
        ///// <summary>
        /////     Execute a Stored Procedure
        ///// </summary>
        ///// <param name='operations'>
        /////     Reference to the DocumentDBRestAPIClient.IDocumentDbConnector.
        ///// </param>
        ///// <param name='ridDB'>
        /////     Required. The Database Id
        ///// </param>
        ///// <param name='ridColl'>
        /////     Required. The Collection Id
        ///// </param>
        ///// <param name='ridProc'>
        /////     Required. The Procedure Id
        ///// </param>
        ///// <param name='request'>
        /////     Required.
        ///// </param>
        ///// <param name='authorization'>
        /////     Required. The authentication type and signature token. Both master
        /////     key and resource tokens are allowed for  operation.
        /////     <c>type={typeoftoken}%26ver={tokenversion}%26sig={hashsignature}</c>
        ///// </param>
        ///// <param name='contentType'>
        /////     Required. Required. The Content-Type header must be
        /////     application/json.
        ///// </param>
        ///// <param name='xMSDocumentdbQueryEnableScan'>
        /////     Required.
        ///// </param>
        ///// <param name='xMSDocumentdbIsquery'>
        /////     Required.
        ///// </param>
        ///// <param name='userAgent'>
        /////     Required. Optional. The string of client user agent performing the
        /////     request. The recommended format is
        /////     <c>
        /////         {user agent
        /////         name}/{version}
        /////     </c>
        /////     .
        ///// </param>
        ///// <param name='xMSDate'>
        /////     Required. The date of the request The date is expressed in
        /////     Coordinated Universal Time format.           :
        /////     <example>Fri, 08 Apr 2015 03:52:31 GMT</example>
        ///// </param>
        ///// <param name='xMSVersion'>
        /////     Required. The version of DocumentDB REST service. The latest
        /////     version is used when the header is not provided use 2015-08-06
        ///// </param>
        ///// <param name='cancellationToken'>
        /////     Cancellation token.
        ///// </param>
        //public static async Task<QueryResponseBody> ExecuteStoredProcedureAsync(IDocumentDbConnector operations,
        //    string ridDB, string ridColl, string ridProc, QueryRequest request, string authorization, string contentType,
        //    bool xMSDocumentdbQueryEnableScan, bool xMSDocumentdbIsquery, string userAgent, string xMSDate,
        //    string xMSVersion, CancellationToken cancellationToken = default(CancellationToken))
        //{
        //    var result =
        //        await
        //            operations.ExecuteStoredProcedureWithOperationResponseAsync(ridDB, ridColl, ridProc, request,
        //                authorization, contentType, xMSDocumentdbQueryEnableScan, xMSDocumentdbIsquery, userAgent,
        //                xMSDate, xMSVersion, cancellationToken).ConfigureAwait(false);
        //    return result.Body;
        //}

        /// <summary>
        ///     Register a Stored Procedure
        /// </summary>
        /// <param name='operations'>
        ///     Reference to the DocumentDBRestAPIClient.IDocumentDbConnector.
        /// </param>
        /// <param name='ridDB'>
        ///     Required. The Database Id
        /// </param>
        /// <param name='ridColl'>
        ///     Required. The Collection Id
        /// </param>
        /// <param name='request'>
        ///     Required.
        /// </param>
        /// <param name='authorization'>
        ///     Required. The authentication type and signature token. Both master
        ///     key and resource tokens are allowed for  operation.
        ///     <c>type={typeoftoken}%26ver={tokenversion}%26sig={hashsignature}</c>
        /// </param>
        /// <param name='userAgent'>
        ///     Required. Optional. The string of client user agent performing the
        ///     request. The recommended format is
        ///     <c>
        ///         {user agent
        ///         name}/{version}
        ///     </c>
        ///     .
        /// </param>
        /// <param name='xMSDate'>
        ///     Required. The date of the request The date is expressed in
        ///     Coordinated Universal Time format.
        ///     <example>Fri, 08 Apr 2015 03:52:31 GMT</example>
        /// </param>
        /// <param name='xMSVersion'>
        ///     Required. The version of DocumentDB REST service. The latest
        ///     version is used when the header is not provided use 2015-08-06
        /// </param>
        public static StoredProcedure RegisterStoredProcedure(IDocumentDbConnector operations, string ridDB,
                                                              string ridColl, QueryRequest request, string authorization, string userAgent, string xMSDate,
                                                              string xMSVersion)
        {
            return
                (Task.Factory.StartNew(
                     s => ((IDocumentDbConnector)s).RegisterStoredProcedureAsync(ridDB, ridColl, request,
                                                                                 authorization, userAgent, xMSDate, xMSVersion), operations, CancellationToken.None,
                     TaskCreationOptions.None, TaskScheduler.Default)
                 .Unwrap()
                 .GetAwaiter()
                 .GetResult());
        }