コード例 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AnalyzeHealthcareEntitiesOperation"/> class.
        /// </summary>
        /// <param name="serviceClient">The client for communicating with the Text Analytics Azure Cognitive Service through its REST API.</param>
        /// <param name="diagnostics">The client diagnostics for exception creation in case of failure.</param>
        /// <param name="operationLocation">The address of the long-running operation. It can be obtained from the response headers upon starting the operation.</param>
        /// <param name="idToIndexMap"></param>
        /// <param name="showStats"></param>
        internal AnalyzeHealthcareEntitiesOperation(ServiceClient serviceClient, ClientDiagnostics diagnostics, string operationLocation, IDictionary <string, int> idToIndexMap, bool?showStats = default)
        {
            _serviceClient     = serviceClient;
            _diagnostics       = diagnostics;
            _idToIndexMap      = idToIndexMap;
            _showStats         = showStats;
            _operationInternal = new(_diagnostics, this, rawResponse : null);

            _jobId = operationLocation.Split('/').Last().Split('?')[0];

            Id = OperationContinuationToken.Serialize(_jobId, idToIndexMap, showStats);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="AnalyzeHealthcareEntitiesOperation"/> class.
        /// </summary>
        /// <param name="serviceClient">The client for communicating with the Text Analytics Azure Cognitive Service through its REST API.</param>
        /// <param name="diagnostics">The client diagnostics for exception creation in case of failure.</param>
        /// <param name="operationLocation">The address of the long-running operation. It can be obtained from the response headers upon starting the operation.</param>
        /// <param name="idToIndexMap"></param>
        /// <param name="showStats"></param>
        internal AnalyzeHealthcareEntitiesOperation(TextAnalyticsRestClient serviceClient, ClientDiagnostics diagnostics, string operationLocation, IDictionary <string, int> idToIndexMap, bool?showStats = default)
        {
            _serviceClient     = serviceClient;
            _diagnostics       = diagnostics;
            _idToIndexMap      = idToIndexMap;
            _showStats         = showStats;
            _operationInternal = new(_diagnostics, this, rawResponse : null);

            // TODO: Add validation here
            // https://github.com/Azure/azure-sdk-for-net/issues/11505
            _jobId = operationLocation.Split('/').Last();

            Id = OperationContinuationToken.Serialize(_jobId, idToIndexMap, showStats);
        }