Ejemplo n.º 1
0
        public async Task<AuthorizeResult> AuthorizeAsync(bool trySilent = false, object extraParameters = null)
        {
            InvokeResult wviResult;
            AuthorizeResult result = new AuthorizeResult
            {
                IsError = true,
            };

            // todo: replace with CryptoRandom
            result.Nonce = Guid.NewGuid().ToString("N");
            result.RedirectUri = _options.RedirectUri;
            string codeChallenge = CreateCodeChallenge(result);
            var url = await CreateUrlAsync(result, codeChallenge, extraParameters);
            var webViewOptions = new InvokeOptions(url, _options.RedirectUri);
            if (trySilent)
            {
                webViewOptions.InitialDisplayMode = DisplayMode.Hidden;
            }
            if (_options.UseFormPost)
            {
                webViewOptions.ResponseMode = ResponseMode.FormPost;
            }

            // try silent mode if requested
            wviResult = await _options.WebView.InvokeAsync(webViewOptions);

            if (wviResult.ResultType == InvokeResultType.Success)
            {
                return await ParseResponse(wviResult.Response, result);
            }

            result.Error = wviResult.ResultType.ToString();
            return result;
        }
Ejemplo n.º 2
0
        internal virtual CreateOriginEndpointResponse CreateOriginEndpoint(CreateOriginEndpointRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = CreateOriginEndpointRequestMarshaller.Instance;
            options.ResponseUnmarshaller = CreateOriginEndpointResponseUnmarshaller.Instance;

            return(Invoke <CreateOriginEndpointResponse>(request, options));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Lists the attribute name and value of the user that you specified in the search. We
        /// only support <code>UserName</code> as a valid filter attribute path currently, and
        /// filter is required. This API returns minimum attributes, including <code>UserId</code>
        /// and <code>UserName</code> in the response.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the ListUsers service method.</param>
        ///
        /// <returns>The response from the ListUsers service method, as returned by IdentityStore.</returns>
        /// <exception cref="Amazon.IdentityStore.Model.AccessDeniedException">
        /// You do not have sufficient access to perform this action.
        /// </exception>
        /// <exception cref="Amazon.IdentityStore.Model.InternalServerException">
        /// The request processing has failed because of an unknown error, exception or failure
        /// with an internal server.
        /// </exception>
        /// <exception cref="Amazon.IdentityStore.Model.ResourceNotFoundException">
        /// Indicates that a requested resource is not found.
        /// </exception>
        /// <exception cref="Amazon.IdentityStore.Model.ThrottlingException">
        /// Indicates that the principal has crossed the throttling limits of the API operations.
        /// </exception>
        /// <exception cref="Amazon.IdentityStore.Model.ValidationException">
        /// The request failed because it contains a syntax error.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/identitystore-2020-06-15/ListUsers">REST API Reference for ListUsers Operation</seealso>
        public virtual ListUsersResponse ListUsers(ListUsersRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = ListUsersRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ListUsersResponseUnmarshaller.Instance;

            return(Invoke <ListUsersResponse>(request, options));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Initiates the asynchronous execution of the GetShippingLabel operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the GetShippingLabel operation on AmazonImportExportClient.</param>
        /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
        /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
        ///          procedure using the AsyncState property.</param>
        ///
        /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetShippingLabel
        ///         operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/importexport-2010-06-01/GetShippingLabel">REST API Reference for GetShippingLabel Operation</seealso>
        public virtual IAsyncResult BeginGetShippingLabel(GetShippingLabelRequest request, AsyncCallback callback, object state)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = GetShippingLabelRequestMarshaller.Instance;
            options.ResponseUnmarshaller = GetShippingLabelResponseUnmarshaller.Instance;

            return(BeginInvoke(request, options, callback, state));
        }
Ejemplo n.º 5
0
        /// <summary>
        /// You use this operation to change the parameters specified in the original manifest
        /// file by supplying a new manifest file. The manifest file attached to this request
        /// replaces the original manifest file. You can only use the operation after a CreateJob
        /// request but before the data transfer starts and you can only use it on jobs you own.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the UpdateJob service method.</param>
        ///
        /// <returns>The response from the UpdateJob service method, as returned by ImportExport.</returns>
        /// <exception cref="Amazon.ImportExport.Model.BucketPermissionException">
        /// The account specified does not have the appropriate bucket permissions.
        /// </exception>
        /// <exception cref="Amazon.ImportExport.Model.CanceledJobIdException">
        /// The specified job ID has been canceled and is no longer valid.
        /// </exception>
        /// <exception cref="Amazon.ImportExport.Model.ExpiredJobIdException">
        /// Indicates that the specified job has expired out of the system.
        /// </exception>
        /// <exception cref="Amazon.ImportExport.Model.InvalidAccessKeyIdException">
        /// The AWS Access Key ID specified in the request did not match the manifest's accessKeyId
        /// value. The manifest and the request authentication must use the same AWS Access Key
        /// ID.
        /// </exception>
        /// <exception cref="Amazon.ImportExport.Model.InvalidAddressException">
        /// The address specified in the manifest is invalid.
        /// </exception>
        /// <exception cref="Amazon.ImportExport.Model.InvalidCustomsException">
        /// One or more customs parameters was invalid. Please correct and resubmit.
        /// </exception>
        /// <exception cref="Amazon.ImportExport.Model.InvalidFileSystemException">
        /// File system specified in export manifest is invalid.
        /// </exception>
        /// <exception cref="Amazon.ImportExport.Model.InvalidJobIdException">
        /// The JOBID was missing, not found, or not associated with the AWS account.
        /// </exception>
        /// <exception cref="Amazon.ImportExport.Model.InvalidManifestFieldException">
        /// One or more manifest fields was invalid. Please correct and resubmit.
        /// </exception>
        /// <exception cref="Amazon.ImportExport.Model.InvalidParameterException">
        /// One or more parameters had an invalid value.
        /// </exception>
        /// <exception cref="Amazon.ImportExport.Model.InvalidVersionException">
        /// The client tool version is invalid.
        /// </exception>
        /// <exception cref="Amazon.ImportExport.Model.MalformedManifestException">
        /// Your manifest is not well-formed.
        /// </exception>
        /// <exception cref="Amazon.ImportExport.Model.MissingCustomsException">
        /// One or more required customs parameters was missing from the manifest.
        /// </exception>
        /// <exception cref="Amazon.ImportExport.Model.MissingManifestFieldException">
        /// One or more required fields were missing from the manifest file. Please correct and
        /// resubmit.
        /// </exception>
        /// <exception cref="Amazon.ImportExport.Model.MissingParameterException">
        /// One or more required parameters was missing from the request.
        /// </exception>
        /// <exception cref="Amazon.ImportExport.Model.MultipleRegionsException">
        /// Your manifest file contained buckets from multiple regions. A job is restricted to
        /// buckets from one region. Please correct and resubmit.
        /// </exception>
        /// <exception cref="Amazon.ImportExport.Model.NoSuchBucketException">
        /// The specified bucket does not exist. Create the specified bucket or change the manifest's
        /// bucket, exportBucket, or logBucket field to a bucket that the account, as specified
        /// by the manifest's Access Key ID, has write permissions to.
        /// </exception>
        /// <exception cref="Amazon.ImportExport.Model.UnableToUpdateJobIdException">
        /// AWS Import/Export cannot update the job
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/importexport-2010-06-01/UpdateJob">REST API Reference for UpdateJob Operation</seealso>
        public virtual UpdateJobResponse UpdateJob(UpdateJobRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = UpdateJobRequestMarshaller.Instance;
            options.ResponseUnmarshaller = UpdateJobResponseUnmarshaller.Instance;

            return(Invoke <UpdateJobResponse>(request, options));
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Initiates the asynchronous execution of the UntagDeliveryStream operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the UntagDeliveryStream operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/UntagDeliveryStream">REST API Reference for UntagDeliveryStream Operation</seealso>
        public virtual Task <UntagDeliveryStreamResponse> UntagDeliveryStreamAsync(UntagDeliveryStreamRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = UntagDeliveryStreamRequestMarshaller.Instance;
            options.ResponseUnmarshaller = UntagDeliveryStreamResponseUnmarshaller.Instance;

            return(InvokeAsync <UntagDeliveryStreamResponse>(request, options, cancellationToken));
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Initiates the asynchronous execution of the UpdateDestination operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the UpdateDestination operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/UpdateDestination">REST API Reference for UpdateDestination Operation</seealso>
        public virtual Task <UpdateDestinationResponse> UpdateDestinationAsync(UpdateDestinationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = UpdateDestinationRequestMarshaller.Instance;
            options.ResponseUnmarshaller = UpdateDestinationResponseUnmarshaller.Instance;

            return(InvokeAsync <UpdateDestinationResponse>(request, options, cancellationToken));
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Initiates the asynchronous execution of the RotateIngestEndpointCredentials operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the RotateIngestEndpointCredentials operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/mediapackage-2017-10-12/RotateIngestEndpointCredentials">REST API Reference for RotateIngestEndpointCredentials Operation</seealso>
        public virtual Task <RotateIngestEndpointCredentialsResponse> RotateIngestEndpointCredentialsAsync(RotateIngestEndpointCredentialsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = RotateIngestEndpointCredentialsRequestMarshaller.Instance;
            options.ResponseUnmarshaller = RotateIngestEndpointCredentialsResponseUnmarshaller.Instance;

            return(InvokeAsync <RotateIngestEndpointCredentialsResponse>(request, options, cancellationToken));
        }
Ejemplo n.º 9
0
        internal virtual TagResourceResponse TagResource(TagResourceRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = TagResourceRequestMarshaller.Instance;
            options.ResponseUnmarshaller = TagResourceResponseUnmarshaller.Instance;

            return(Invoke <TagResourceResponse>(request, options));
        }
Ejemplo n.º 10
0
        internal virtual ListOriginEndpointsResponse ListOriginEndpoints(ListOriginEndpointsRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = ListOriginEndpointsRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ListOriginEndpointsResponseUnmarshaller.Instance;

            return(Invoke <ListOriginEndpointsResponse>(request, options));
        }
Ejemplo n.º 11
0
        internal virtual RotateIngestEndpointCredentialsResponse RotateIngestEndpointCredentials(RotateIngestEndpointCredentialsRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = RotateIngestEndpointCredentialsRequestMarshaller.Instance;
            options.ResponseUnmarshaller = RotateIngestEndpointCredentialsResponseUnmarshaller.Instance;

            return(Invoke <RotateIngestEndpointCredentialsResponse>(request, options));
        }
Ejemplo n.º 12
0
        internal virtual DescribeOriginEndpointResponse DescribeOriginEndpoint(DescribeOriginEndpointRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = DescribeOriginEndpointRequestMarshaller.Instance;
            options.ResponseUnmarshaller = DescribeOriginEndpointResponseUnmarshaller.Instance;

            return(Invoke <DescribeOriginEndpointResponse>(request, options));
        }
Ejemplo n.º 13
0
        internal virtual DeleteChannelResponse DeleteChannel(DeleteChannelRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = DeleteChannelRequestMarshaller.Instance;
            options.ResponseUnmarshaller = DeleteChannelResponseUnmarshaller.Instance;

            return(Invoke <DeleteChannelResponse>(request, options));
        }
Ejemplo n.º 14
0
        /// <summary>
        /// Initiates the asynchronous execution of the CreateOriginEndpoint operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the CreateOriginEndpoint operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/mediapackage-2017-10-12/CreateOriginEndpoint">REST API Reference for CreateOriginEndpoint Operation</seealso>
        public virtual Task <CreateOriginEndpointResponse> CreateOriginEndpointAsync(CreateOriginEndpointRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = CreateOriginEndpointRequestMarshaller.Instance;
            options.ResponseUnmarshaller = CreateOriginEndpointResponseUnmarshaller.Instance;

            return(InvokeAsync <CreateOriginEndpointResponse>(request, options, cancellationToken));
        }
Ejemplo n.º 15
0
        internal virtual StopDeliveryStreamEncryptionResponse StopDeliveryStreamEncryption(StopDeliveryStreamEncryptionRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = StopDeliveryStreamEncryptionRequestMarshaller.Instance;
            options.ResponseUnmarshaller = StopDeliveryStreamEncryptionResponseUnmarshaller.Instance;

            return(Invoke <StopDeliveryStreamEncryptionResponse>(request, options));
        }
Ejemplo n.º 16
0
        internal virtual GetReservationPurchaseRecommendationResponse GetReservationPurchaseRecommendation(GetReservationPurchaseRecommendationRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = GetReservationPurchaseRecommendationRequestMarshaller.Instance;
            options.ResponseUnmarshaller = GetReservationPurchaseRecommendationResponseUnmarshaller.Instance;

            return(Invoke <GetReservationPurchaseRecommendationResponse>(request, options));
        }
Ejemplo n.º 17
0
        internal virtual UntagDeliveryStreamResponse UntagDeliveryStream(UntagDeliveryStreamRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = UntagDeliveryStreamRequestMarshaller.Instance;
            options.ResponseUnmarshaller = UntagDeliveryStreamResponseUnmarshaller.Instance;

            return(Invoke <UntagDeliveryStreamResponse>(request, options));
        }
Ejemplo n.º 18
0
        /// <summary>
        /// Retrieves the reservation utilization for your account. Master accounts in an organization
        /// have access to member accounts. You can filter data by dimensions in a time period.
        /// You can use <code>GetDimensionValues</code> to determine the possible dimension values.
        /// Currently, you can group only by <code>SUBSCRIPTION_ID</code>.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the GetReservationUtilization service method.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        ///
        /// <returns>The response from the GetReservationUtilization service method, as returned by CostExplorer.</returns>
        /// <exception cref="Amazon.CostExplorer.Model.DataUnavailableException">
        /// The requested data is unavailable.
        /// </exception>
        /// <exception cref="Amazon.CostExplorer.Model.InvalidNextTokenException">
        /// The pagination token is invalid. Try again without a pagination token.
        /// </exception>
        /// <exception cref="Amazon.CostExplorer.Model.LimitExceededException">
        /// You made too many calls in a short period of time. Try again later.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/GetReservationUtilization">REST API Reference for GetReservationUtilization Operation</seealso>
        public virtual Task <GetReservationUtilizationResponse> GetReservationUtilizationAsync(GetReservationUtilizationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = GetReservationUtilizationRequestMarshaller.Instance;
            options.ResponseUnmarshaller = GetReservationUtilizationResponseUnmarshaller.Instance;

            return(InvokeAsync <GetReservationUtilizationResponse>(request, options, cancellationToken));
        }
Ejemplo n.º 19
0
        internal virtual UpdateDestinationResponse UpdateDestination(UpdateDestinationRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = UpdateDestinationRequestMarshaller.Instance;
            options.ResponseUnmarshaller = UpdateDestinationResponseUnmarshaller.Instance;

            return(Invoke <UpdateDestinationResponse>(request, options));
        }
Ejemplo n.º 20
0
        internal virtual GetTagsResponse GetTags(GetTagsRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = GetTagsRequestMarshaller.Instance;
            options.ResponseUnmarshaller = GetTagsResponseUnmarshaller.Instance;

            return(Invoke <GetTagsResponse>(request, options));
        }
Ejemplo n.º 21
0
        /// <summary>
        /// This operation cancels a specified job. Only the job owner can cancel it. The operation
        /// fails if the job has already started or is complete.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the CancelJob service method.</param>
        ///
        /// <returns>The response from the CancelJob service method, as returned by ImportExport.</returns>
        /// <exception cref="Amazon.ImportExport.Model.CanceledJobIdException">
        /// The specified job ID has been canceled and is no longer valid.
        /// </exception>
        /// <exception cref="Amazon.ImportExport.Model.ExpiredJobIdException">
        /// Indicates that the specified job has expired out of the system.
        /// </exception>
        /// <exception cref="Amazon.ImportExport.Model.InvalidAccessKeyIdException">
        /// The AWS Access Key ID specified in the request did not match the manifest's accessKeyId
        /// value. The manifest and the request authentication must use the same AWS Access Key
        /// ID.
        /// </exception>
        /// <exception cref="Amazon.ImportExport.Model.InvalidJobIdException">
        /// The JOBID was missing, not found, or not associated with the AWS account.
        /// </exception>
        /// <exception cref="Amazon.ImportExport.Model.InvalidVersionException">
        /// The client tool version is invalid.
        /// </exception>
        /// <exception cref="Amazon.ImportExport.Model.UnableToCancelJobIdException">
        /// AWS Import/Export cannot cancel the job
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/importexport-2010-06-01/CancelJob">REST API Reference for CancelJob Operation</seealso>
        public virtual CancelJobResponse CancelJob(CancelJobRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = CancelJobRequestMarshaller.Instance;
            options.ResponseUnmarshaller = CancelJobResponseUnmarshaller.Instance;

            return(Invoke <CancelJobResponse>(request, options));
        }
Ejemplo n.º 22
0
        internal virtual ListTagsForDeliveryStreamResponse ListTagsForDeliveryStream(ListTagsForDeliveryStreamRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = ListTagsForDeliveryStreamRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ListTagsForDeliveryStreamResponseUnmarshaller.Instance;

            return(Invoke <ListTagsForDeliveryStreamResponse>(request, options));
        }
Ejemplo n.º 23
0
        /// <summary>
        /// This operation returns information about a job, including where the job is in the
        /// processing pipeline, the status of the results, and the signature value associated
        /// with the job. You can only return information about jobs you own.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the GetStatus service method.</param>
        ///
        /// <returns>The response from the GetStatus service method, as returned by ImportExport.</returns>
        /// <exception cref="Amazon.ImportExport.Model.CanceledJobIdException">
        /// The specified job ID has been canceled and is no longer valid.
        /// </exception>
        /// <exception cref="Amazon.ImportExport.Model.ExpiredJobIdException">
        /// Indicates that the specified job has expired out of the system.
        /// </exception>
        /// <exception cref="Amazon.ImportExport.Model.InvalidAccessKeyIdException">
        /// The AWS Access Key ID specified in the request did not match the manifest's accessKeyId
        /// value. The manifest and the request authentication must use the same AWS Access Key
        /// ID.
        /// </exception>
        /// <exception cref="Amazon.ImportExport.Model.InvalidJobIdException">
        /// The JOBID was missing, not found, or not associated with the AWS account.
        /// </exception>
        /// <exception cref="Amazon.ImportExport.Model.InvalidVersionException">
        /// The client tool version is invalid.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/importexport-2010-06-01/GetStatus">REST API Reference for GetStatus Operation</seealso>
        public virtual GetStatusResponse GetStatus(GetStatusRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = GetStatusRequestMarshaller.Instance;
            options.ResponseUnmarshaller = GetStatusResponseUnmarshaller.Instance;

            return(Invoke <GetStatusResponse>(request, options));
        }
Ejemplo n.º 24
0
        internal virtual PutRecordBatchResponse PutRecordBatch(PutRecordBatchRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = PutRecordBatchRequestMarshaller.Instance;
            options.ResponseUnmarshaller = PutRecordBatchResponseUnmarshaller.Instance;

            return(Invoke <PutRecordBatchResponse>(request, options));
        }
Ejemplo n.º 25
0
        /// <summary>
        /// Initiates the asynchronous execution of the UpdateJob operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the UpdateJob operation on AmazonImportExportClient.</param>
        /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
        /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
        ///          procedure using the AsyncState property.</param>
        ///
        /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUpdateJob
        ///         operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/importexport-2010-06-01/UpdateJob">REST API Reference for UpdateJob Operation</seealso>
        public virtual IAsyncResult BeginUpdateJob(UpdateJobRequest request, AsyncCallback callback, object state)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = UpdateJobRequestMarshaller.Instance;
            options.ResponseUnmarshaller = UpdateJobResponseUnmarshaller.Instance;

            return(BeginInvoke(request, options, callback, state));
        }
Ejemplo n.º 26
0
        /// <summary>
        /// Initiates the asynchronous execution of the PutRecordBatch operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the PutRecordBatch operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/PutRecordBatch">REST API Reference for PutRecordBatch Operation</seealso>
        public virtual Task <PutRecordBatchResponse> PutRecordBatchAsync(PutRecordBatchRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = PutRecordBatchRequestMarshaller.Instance;
            options.ResponseUnmarshaller = PutRecordBatchResponseUnmarshaller.Instance;

            return(InvokeAsync <PutRecordBatchResponse>(request, options, cancellationToken));
        }
Ejemplo n.º 27
0
        /// <summary>
        /// Retrieves the user metadata and attributes from <code>UserId</code> in an identity
        /// store.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the DescribeUser service method.</param>
        ///
        /// <returns>The response from the DescribeUser service method, as returned by IdentityStore.</returns>
        /// <exception cref="Amazon.IdentityStore.Model.AccessDeniedException">
        /// You do not have sufficient access to perform this action.
        /// </exception>
        /// <exception cref="Amazon.IdentityStore.Model.InternalServerException">
        /// The request processing has failed because of an unknown error, exception or failure
        /// with an internal server.
        /// </exception>
        /// <exception cref="Amazon.IdentityStore.Model.ResourceNotFoundException">
        /// Indicates that a requested resource is not found.
        /// </exception>
        /// <exception cref="Amazon.IdentityStore.Model.ThrottlingException">
        /// Indicates that the principal has crossed the throttling limits of the API operations.
        /// </exception>
        /// <exception cref="Amazon.IdentityStore.Model.ValidationException">
        /// The request failed because it contains a syntax error.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/identitystore-2020-06-15/DescribeUser">REST API Reference for DescribeUser Operation</seealso>
        public virtual DescribeUserResponse DescribeUser(DescribeUserRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = DescribeUserRequestMarshaller.Instance;
            options.ResponseUnmarshaller = DescribeUserResponseUnmarshaller.Instance;

            return(Invoke <DescribeUserResponse>(request, options));
        }
Ejemplo n.º 28
0
        /// <summary>
        /// Initiates the asynchronous execution of the StartDeliveryStreamEncryption operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the StartDeliveryStreamEncryption operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/StartDeliveryStreamEncryption">REST API Reference for StartDeliveryStreamEncryption Operation</seealso>
        public virtual Task <StartDeliveryStreamEncryptionResponse> StartDeliveryStreamEncryptionAsync(StartDeliveryStreamEncryptionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = StartDeliveryStreamEncryptionRequestMarshaller.Instance;
            options.ResponseUnmarshaller = StartDeliveryStreamEncryptionResponseUnmarshaller.Instance;

            return(InvokeAsync <StartDeliveryStreamEncryptionResponse>(request, options, cancellationToken));
        }
Ejemplo n.º 29
0
        /// <summary>
        /// Lists the attribute name and value of the user that you specified in the search. We
        /// only support <code>UserName</code> as a valid filter attribute path currently, and
        /// filter is required. This API returns minimum attributes, including <code>UserId</code>
        /// and <code>UserName</code> in the response.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the ListUsers service method.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        ///
        /// <returns>The response from the ListUsers service method, as returned by IdentityStore.</returns>
        /// <exception cref="Amazon.IdentityStore.Model.AccessDeniedException">
        /// You do not have sufficient access to perform this action.
        /// </exception>
        /// <exception cref="Amazon.IdentityStore.Model.InternalServerException">
        /// The request processing has failed because of an unknown error, exception or failure
        /// with an internal server.
        /// </exception>
        /// <exception cref="Amazon.IdentityStore.Model.ResourceNotFoundException">
        /// Indicates that a requested resource is not found.
        /// </exception>
        /// <exception cref="Amazon.IdentityStore.Model.ThrottlingException">
        /// Indicates that the principal has crossed the throttling limits of the API operations.
        /// </exception>
        /// <exception cref="Amazon.IdentityStore.Model.ValidationException">
        /// The request failed because it contains a syntax error.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/identitystore-2020-06-15/ListUsers">REST API Reference for ListUsers Operation</seealso>
        public virtual Task <ListUsersResponse> ListUsersAsync(ListUsersRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = ListUsersRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ListUsersResponseUnmarshaller.Instance;

            return(InvokeAsync <ListUsersResponse>(request, options, cancellationToken));
        }
Ejemplo n.º 30
0
        /// <summary>
        /// Retrieves the group metadata and attributes from <code>GroupId</code> in an identity
        /// store.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the DescribeGroup service method.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        ///
        /// <returns>The response from the DescribeGroup service method, as returned by IdentityStore.</returns>
        /// <exception cref="Amazon.IdentityStore.Model.AccessDeniedException">
        /// You do not have sufficient access to perform this action.
        /// </exception>
        /// <exception cref="Amazon.IdentityStore.Model.InternalServerException">
        /// The request processing has failed because of an unknown error, exception or failure
        /// with an internal server.
        /// </exception>
        /// <exception cref="Amazon.IdentityStore.Model.ResourceNotFoundException">
        /// Indicates that a requested resource is not found.
        /// </exception>
        /// <exception cref="Amazon.IdentityStore.Model.ThrottlingException">
        /// Indicates that the principal has crossed the throttling limits of the API operations.
        /// </exception>
        /// <exception cref="Amazon.IdentityStore.Model.ValidationException">
        /// The request failed because it contains a syntax error.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/identitystore-2020-06-15/DescribeGroup">REST API Reference for DescribeGroup Operation</seealso>
        public virtual Task <DescribeGroupResponse> DescribeGroupAsync(DescribeGroupRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = DescribeGroupRequestMarshaller.Instance;
            options.ResponseUnmarshaller = DescribeGroupResponseUnmarshaller.Instance;

            return(InvokeAsync <DescribeGroupResponse>(request, options, cancellationToken));
        }
        /// <summary>
        /// Removes tags from an AWS resource.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the UntagResource service method.</param>
        ///
        /// <returns>The response from the UntagResource service method, as returned by CodeStarconnections.</returns>
        /// <exception cref="Amazon.CodeStarconnections.Model.ResourceNotFoundException">
        /// Resource not found. Verify the connection resource ARN and try again.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codestar-connections-2019-12-01/UntagResource">REST API Reference for UntagResource Operation</seealso>
        public virtual UntagResourceResponse UntagResource(UntagResourceRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = UntagResourceRequestMarshaller.Instance;
            options.ResponseUnmarshaller = UntagResourceResponseUnmarshaller.Instance;

            return(Invoke <UntagResourceResponse>(request, options));
        }
Ejemplo n.º 32
0
        public IStrongValueHandle<IValue> InvokeMethod(IThreadReference thread, IMethod method, InvokeOptions options, params IValue[] arguments)
        {
            Contract.Requires<ArgumentNullException>(method != null, "method");
            Contract.Requires<VirtualMachineMismatchException>(thread == null || this.GetVirtualMachine().Equals(thread.GetVirtualMachine()));
            Contract.Requires<VirtualMachineMismatchException>(method.GetVirtualMachine().Equals(this.GetVirtualMachine()));
#if CONTRACTS_FORALL
            Contract.Requires<VirtualMachineMismatchException>(arguments == null || Contract.ForAll(arguments, argument => argument == null || this.GetVirtualMachine().Equals(argument.GetVirtualMachine())));
#endif
            Contract.Ensures(Contract.Result<IStrongValueHandle<IValue>>() == null || this.GetVirtualMachine().Equals(Contract.Result<IStrongValueHandle<IValue>>().GetVirtualMachine()));

            throw new NotImplementedException();
        }
Ejemplo n.º 33
0
        private void InvokeMethodInternal(InvokeParams invokeParams)
        {
            var invokeOptions = new InvokeOptions()
            {
                ClassName = invokeParams.TypeName,
                MethodName = invokeParams.MethodName,
                Async = true
            };

            var compilerOptions = new CompilerOptions()
            {
                FilePath = invokeParams.FilePath,
                ReferencedAssemblyPaths = BuildManager.GetReferencedAssemblies().OfType<Assembly>().Select(x => x.Location).ToArray(),
                SignKeyPath = invokeParams.KeyPath,
                OutputAssemblyName = invokeParams.AsmName
            };

            MethodInvoker.Execute(invokeOptions, compilerOptions);
        }
Ejemplo n.º 34
0
        public async Task EndSessionAsync(string identityToken = null, bool trySilent = true)
        {
            string url = (await _options.GetEndpointsAsync()).EndSession;

            if (!string.IsNullOrWhiteSpace(identityToken))
            {
                url += $"?{OidcConstants.EndSessionRequest.IdTokenHint}={identityToken}" +
                       $"&{OidcConstants.EndSessionRequest.PostLogoutRedirectUri}={_options.RedirectUri}";
            }

            var webViewOptions = new InvokeOptions(url, _options.RedirectUri)
            {
                ResponseMode = ResponseMode.Redirect
            };

            if (trySilent)
            {
                webViewOptions.InitialDisplayMode = DisplayMode.Hidden;
            }

            var result = await _options.WebView.InvokeAsync(webViewOptions);
        }
Ejemplo n.º 35
0
		public Value InvokeMethod (ThreadMirror thread, MethodMirror method, IList<Value> arguments, InvokeOptions options) {
			return InvokeMethod (vm, thread, method, this, arguments, options);
		}
Ejemplo n.º 36
0
		public Value NewInstance (ThreadMirror thread, MethodMirror method, IList<Value> arguments, InvokeOptions options) {
			if (method == null)
				throw new ArgumentNullException ("method");

			if (!method.IsConstructor)
				throw new ArgumentException ("The method must be a constructor.", "method");

			return ObjectMirror.InvokeMethod (vm, thread, method, null, arguments, options);
		}
Ejemplo n.º 37
0
		public IAsyncResult BeginInvokeMethod (ThreadMirror thread, MethodMirror method, IList<Value> arguments, InvokeOptions options, AsyncCallback callback, object state) {
			return ObjectMirror.BeginInvokeMethod (vm, thread, method, null, arguments, options, callback, state);
		}
        public async Task<InvokeResult> InvokeAsync(InvokeOptions options)
        {
            using (var form = _formFactory.Invoke())
            using (var browser = new ExtendedWebBrowser()
            {
                Dock = DockStyle.Fill
            })
            {
                var signal = new SemaphoreSlim(0, 1);

                var result = new InvokeResult
                {
                    ResultType = InvokeResultType.UserCancel
                };

                form.FormClosed += (o, e) =>
                {
                    signal.Release();
                };

                browser.NavigateError += (o, e) =>
                {
                    e.Cancel = true;
                    result.ResultType = InvokeResultType.HttpError;
                    result.Error = e.StatusCode.ToString();
                    signal.Release();
                };

                browser.BeforeNavigate2 += (o, e) =>
                {
                    if (e.Url.StartsWith(options.EndUrl))
                    {
                        e.Cancel = true;
                        result.ResultType = InvokeResultType.Success;
                        if (options.ResponseMode == ResponseMode.FormPost)
                        {
                            result.Response = Encoding.UTF8.GetString(e.PostData ?? new byte[] { });
                        }
                        else
                        {
                            result.Response = e.Url;
                        }
                        signal.Release();
                    }
                };

                form.Controls.Add(browser);
                browser.Show();

                System.Threading.Timer timer = null;
                if (options.InitialDisplayMode != DisplayMode.Visible)
                {
                    result.ResultType = InvokeResultType.Timeout;
                    timer = new System.Threading.Timer((o) =>
                    {
                        var args = new HiddenModeFailedEventArgs(result);
                        HiddenModeFailed?.Invoke(this, args);
                        if (args.Cancel)
                        {
                            browser.Stop();
                            form.Invoke(new Action(() => form.Close()));
                        }
                        else
                        {
                            form.Invoke(new Action(() => form.Show()));
                        }
                    }, null, (int)options.InvisibleModeTimeout.TotalSeconds * 1000, Timeout.Infinite);
                }
                else
                {
                    form.Show();
                }

                browser.Navigate(options.StartUrl);

                await signal.WaitAsync();
                if (timer != null) timer.Change(Timeout.Infinite, Timeout.Infinite);

                form.Hide();
                browser.Hide();

                return result;
            }
        }
Ejemplo n.º 39
0
        public async Task<InvokeResult> InvokeAsync(InvokeOptions options)
        {
            if (string.IsNullOrWhiteSpace(options.StartUrl)) throw new ArgumentException("Missing StartUrl", nameof(options));
            if (string.IsNullOrWhiteSpace(options.EndUrl)) throw new ArgumentException("Missing EndUrl", nameof(options));

            switch (options.InitialDisplayMode)
            {
                case DisplayMode.Visible:
                    return await InvokeAsyncCore(options, false);

                case DisplayMode.Hidden:
                    var result = await InvokeAsyncCore(options, true);
                    if (result.ResultType != InvokeResultType.Success)
                    {
                        var args = new HiddenModeFailedEventArgs(result);
                        HiddenModeFailed?.Invoke(this, args);
                        if (!args.Cancel)
                        {
                            result = await InvokeAsyncCore(options, false);
                        }
                    }
                    return result;
            }

            throw new ArgumentException("Invalid DisplayMode", nameof(options));
        }
Ejemplo n.º 40
0
		internal static Value InvokeMethod (VirtualMachine vm, ThreadMirror thread, MethodMirror method, Value this_obj, IList<Value> arguments, InvokeOptions options) {
			return EndInvokeMethodInternal (BeginInvokeMethod (vm, thread, method, this_obj, arguments, options, null, null));
		}
Ejemplo n.º 41
0
		//
		// Invoke the members of METHODS one-by-one, calling CALLBACK after each invoke was finished. The IAsyncResult will be marked as completed after all invokes have
		// finished. The callback will be called with a different IAsyncResult that represents one method invocation.
		// From protocol version 2.22.
		//
		public IAsyncResult BeginInvokeMultiple (ThreadMirror thread, MethodMirror[] methods, IList<IList<Value>> arguments, InvokeOptions options, AsyncCallback callback, object state) {
			return BeginInvokeMultiple (vm, thread, methods, this, arguments, options, callback, state);
		}
Ejemplo n.º 42
0
        public Error InvokeObjectMethod(out Value returnValue, out TaggedObjectId thrownException, ObjectId @object, ThreadId thread, ClassId @class, MethodId method, InvokeOptions options, Value[] arguments)
        {
            if (thread == default(ThreadId))
                throw new ArgumentException();

            byte[] packet = new byte[HeaderSize + ObjectIdSize + ThreadIdSize + ClassIdSize + MethodIdSize + sizeof(int)];
            WriteObjectId(packet, HeaderSize, @object);
            WriteObjectId(packet, HeaderSize + ObjectIdSize, thread);
            WriteReferenceTypeId(packet, HeaderSize + ObjectIdSize + ThreadIdSize, @class);
            WriteMethodId(packet, HeaderSize + ObjectIdSize + ThreadIdSize + ClassIdSize, method);
            WriteInt32(packet, HeaderSize + ObjectIdSize + ThreadIdSize + ClassIdSize + MethodIdSize, arguments.Length);

            List<byte> packetData = new List<byte>(packet);
            foreach (Value argument in arguments)
            {
                switch (argument.Tag)
                {
                case Tag.Byte:
                    throw new NotImplementedException();

                case Tag.Char:
                    throw new NotImplementedException();

                case Tag.Float:
                    throw new NotImplementedException();

                case Tag.Double:
                    throw new NotImplementedException();

                case Tag.Int:
                    throw new NotImplementedException();

                case Tag.Long:
                    throw new NotImplementedException();

                case Tag.Short:
                    throw new NotImplementedException();

                case Tag.Boolean:
                    throw new NotImplementedException();

                case Tag.Array:
                case Tag.Object:
                case Tag.String:
                case Tag.Thread:
                case Tag.ThreadGroup:
                case Tag.ClassLoader:
                case Tag.ClassObject:
                    throw new NotImplementedException();

                case Tag.Void:
                    throw new NotImplementedException();

                case Tag.Invalid:
                default:
                    throw new InvalidOperationException();
                }
            }

            byte[] optionsData = new byte[sizeof(int)];
            WriteInt32(optionsData, 0, (int)options);
            packetData.AddRange(optionsData);

            packet = packetData.ToArray();
            int id = GetMessageId();
            SerializeHeader(packet, id, ObjectReferenceCommand.InvokeMethod);

            byte[] response = SendPacket(id, packet);
            Error errorCode = ReadErrorCode(response);
            if (errorCode != Error.None)
            {
                returnValue = default(Value);
                thrownException = default(TaggedObjectId);
                return errorCode;
            }

            int offset = HeaderSize;
            returnValue = ReadValue(response, ref offset);
            thrownException = ReadTaggedObjectId(response, ref offset);
            return Error.None;
        }
Ejemplo n.º 43
0
 public Error CreateClassInstance(out TaggedObjectId newObject, out TaggedObjectId thrownException, ClassId @class, ThreadId thread, MethodId method, InvokeOptions options, Value[] arguments)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 44
0
 public Error InvokeClassMethod(out Value returnValue, out TaggedObjectId thrownException, ClassId @class, ThreadId thread, MethodId method, InvokeOptions options, Value[] arguments)
 {
     throw new NotImplementedException();
 }
 public Task StartInvokeAsync(InvokeOptions options)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 46
0
        public Error InvokeClassMethod(ClassId @class, ThreadId thread, MethodId method, InvokeOptions options, Value[] arguments, out Value returnValue, out TaggedObjectId thrownException)
        {
            returnValue = default(Value);
            thrownException = default(TaggedObjectId);

            JniEnvironment nativeEnvironment;
            JvmtiEnvironment environment;
            jvmtiError error = GetEnvironment(out environment, out nativeEnvironment);
            if (error != jvmtiError.None)
                return GetStandardError(error);

            string name;
            string signature;
            string genericSignature;
            error = environment.GetMethodName(method, out name, out signature, out genericSignature);
            if (error != jvmtiError.None)
                return GetStandardError(error);

            if (thread != default(ThreadId))
                throw new NotImplementedException();

            List<string> argumentTypeSignatures;
            string returnTypeSignature;
            SignatureHelper.ParseMethodSignature(signature, out argumentTypeSignatures, out returnTypeSignature);

            using (var classHandle = VirtualMachine.GetLocalReferenceForClass(nativeEnvironment, @class))
            {
                if (!classHandle.IsAlive)
                    return Error.InvalidClass;

                // don't do argument conversion if the signature is invalid
                switch (returnTypeSignature[0])
                {
                case 'Z':
                case 'B':
                case 'C':
                case 'D':
                case 'F':
                case 'I':
                case 'J':
                case 'S':
                case '[':
                case 'L':
                    break;

                case 'V':
                default:
                    return Error.InvalidMethodid;
                }

                jvalue[] args = arguments.Select(value => new jvalue(VirtualMachine, environment, nativeEnvironment, value)).ToArray();

                switch (returnTypeSignature[0])
                {
                case 'Z':
                    returnValue = nativeEnvironment.CallStaticBooleanMethodA(classHandle.Value, method, args);
                    break;

                case 'B':
                    returnValue = nativeEnvironment.CallStaticByteMethodA(classHandle.Value, method, args);
                    break;

                case 'C':
                    returnValue = nativeEnvironment.CallStaticCharMethodA(classHandle.Value, method, args);
                    break;

                case 'D':
                    returnValue = nativeEnvironment.CallStaticDoubleMethodA(classHandle.Value, method, args);
                    break;

                case 'F':
                    returnValue = nativeEnvironment.CallStaticFloatMethodA(classHandle.Value, method, args);
                    break;

                case 'I':
                    returnValue = nativeEnvironment.CallStaticIntMethodA(classHandle.Value, method, args);
                    break;

                case 'J':
                    returnValue = nativeEnvironment.CallStaticLongMethodA(classHandle.Value, method, args);
                    break;

                case 'S':
                    returnValue = nativeEnvironment.CallStaticShortMethodA(classHandle.Value, method, args);
                    break;

                case '[':
                case 'L':
                    jobject result = nativeEnvironment.CallStaticObjectMethodA(classHandle.Value, method, args);
                    returnValue = VirtualMachine.TrackLocalObjectReference(result, environment, nativeEnvironment, false);
                    VirtualMachine.AddGlobalReference(environment, nativeEnvironment, result);
                    nativeEnvironment.DeleteLocalReference(result);
                    break;

                case 'V':
                default:
                    Contract.Assert(false, "not reachable");
                    break;
                }

                if (nativeEnvironment.ExceptionOccurred() != jthrowable.Null)
                {
                    throw new NotImplementedException();
                }

                for (int i = 0; i < arguments.Length; i++)
                {
                    switch (arguments[i].Tag)
                    {
                    case Tag.Array:
                    case Tag.Object:
                    case Tag.String:
                    case Tag.Thread:
                    case Tag.ThreadGroup:
                    case Tag.ClassLoader:
                    case Tag.ClassObject:
                        nativeEnvironment.DeleteLocalReference(args[i].ObjectValue);
                        break;

                    default:
                        break;
                    }
                }

                return Error.None;
            }
        }
Ejemplo n.º 47
0
		public IAsyncResult BeginInvokeMethod (VirtualMachine vm, ThreadMirror thread, MethodMirror method, IList<Value> arguments, InvokeOptions options, AsyncCallback callback, object state) {
			return BeginInvokeMethod (vm, thread, method, this, arguments, options, callback, state);
		}
Ejemplo n.º 48
0
		public Task<InvokeResult> InvokeMethodAsyncWithResult (ThreadMirror thread, MethodMirror method, IList<Value> arguments, InvokeOptions options = InvokeOptions.None) {
			var tcs = new TaskCompletionSource<InvokeResult> ();
			BeginInvokeMethod (thread, method, arguments, options, iar =>
					{
						try {
							tcs.SetResult (EndInvokeMethodInternalWithResult (iar));
						} catch (OperationCanceledException) {
							tcs.TrySetCanceled ();
						} catch (Exception ex) {
							tcs.TrySetException (ex);
						}
					}, null);
			return tcs.Task;
		}
 public IStrongValueHandle<IValue> InvokeMethod(IThreadReference thread, IMethod method, InvokeOptions options, params IValue[] arguments)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 50
0
		internal static IInvokeAsyncResult BeginInvokeMethod (VirtualMachine vm, ThreadMirror thread, MethodMirror method, Value this_obj, IList<Value> arguments, InvokeOptions options, AsyncCallback callback, object state) {
			if (thread == null)
				throw new ArgumentNullException ("thread");
			if (method == null)
				throw new ArgumentNullException ("method");
			if (arguments == null)
				arguments = new Value [0];

			InvokeFlags f = InvokeFlags.NONE;

			if ((options & InvokeOptions.DisableBreakpoints) != 0)
				f |= InvokeFlags.DISABLE_BREAKPOINTS;
			if ((options & InvokeOptions.SingleThreaded) != 0)
				f |= InvokeFlags.SINGLE_THREADED;
			if ((options & InvokeOptions.ReturnOutThis) != 0)
				f |= InvokeFlags.OUT_THIS;
			if ((options & InvokeOptions.ReturnOutArgs) != 0)
				f |= InvokeFlags.OUT_ARGS;

			InvokeAsyncResult r = new InvokeAsyncResult { AsyncState = state, AsyncWaitHandle = new ManualResetEvent (false), VM = vm, Thread = thread, Callback = callback };
			thread.InvalidateFrames ();
			r.ID = vm.conn.VM_BeginInvokeMethod (thread.Id, method.Id, this_obj != null ? vm.EncodeValue (this_obj) : vm.EncodeValue (vm.CreateValue (null)), vm.EncodeValues (arguments), f, InvokeCB, r);

			return r;
		}
Ejemplo n.º 51
0
		public Value NewInstance (ThreadMirror thread, MethodMirror method, IList<Value> arguments, InvokeOptions options) {
			return ObjectMirror.InvokeMethod (vm, thread, method, null, arguments, options);
		}
Ejemplo n.º 52
0
		//
		// Implementation of InvokeMultiple
		//

		internal static IInvokeAsyncResult BeginInvokeMultiple (VirtualMachine vm, ThreadMirror thread, MethodMirror[] methods, Value this_obj, IList<IList<Value>> arguments, InvokeOptions options, AsyncCallback callback, object state) {
			if (thread == null)
				throw new ArgumentNullException ("thread");
			if (methods == null)
				throw new ArgumentNullException ("methods");
			foreach (var m in methods)
				if (m == null)
					throw new ArgumentNullException ("method");
			if (arguments == null) {
				arguments = new List<IList<Value>> ();
				for (int i = 0; i < methods.Length; ++i)
					arguments.Add (new Value [0]);
			} else {
				// FIXME: Not needed for property evaluation
				throw new NotImplementedException ();
			}
			if (callback == null)
				throw new ArgumentException ("A callback argument is required for this method.", "callback");

			InvokeFlags f = InvokeFlags.NONE;

			if ((options & InvokeOptions.DisableBreakpoints) != 0)
				f |= InvokeFlags.DISABLE_BREAKPOINTS;
			if ((options & InvokeOptions.SingleThreaded) != 0)
				f |= InvokeFlags.SINGLE_THREADED;

			InvokeAsyncResult r = new InvokeAsyncResult { AsyncState = state, AsyncWaitHandle = new ManualResetEvent (false), VM = vm, Thread = thread, Callback = callback, NumPending = methods.Length, IsMultiple = true };

			var mids = new long [methods.Length];
			for (int i = 0; i < methods.Length; ++i)
				mids [i] = methods [i].Id;
			var args = new List<ValueImpl[]> ();
			for (int i = 0; i < methods.Length; ++i)
				args.Add (vm.EncodeValues (arguments [i]));
			thread.InvalidateFrames ();
			r.ID = vm.conn.VM_BeginInvokeMethods (thread.Id, mids, this_obj != null ? vm.EncodeValue (this_obj) : vm.EncodeValue (vm.CreateValue (null)), args, f, InvokeMultipleCB, r);

			return r;
		}
Ejemplo n.º 53
0
        private async Task<InvokeResult> InvokeAsyncCore(InvokeOptions options, bool silentMode)
        {
            var wabOptions = WebAuthenticationOptions.None;

            if (options.ResponseMode == ResponseMode.FormPost)
            {
                wabOptions |= WebAuthenticationOptions.UseHttpPost;
            }
            if (_enableWindowsAuthentication)
            {
                wabOptions |= WebAuthenticationOptions.UseCorporateNetwork;
            }
            if (silentMode)
            {
                wabOptions |= WebAuthenticationOptions.SilentMode;
            }

            WebAuthenticationResult wabResult;

            try
            {
                if (string.Equals(options.EndUrl, WebAuthenticationBroker.GetCurrentApplicationCallbackUri().AbsoluteUri, StringComparison.Ordinal))
                {
                    wabResult = await WebAuthenticationBroker.AuthenticateAsync(
                        wabOptions, new Uri(options.StartUrl));
                }
                else
                {
                    wabResult = await WebAuthenticationBroker.AuthenticateAsync(
                        wabOptions, new Uri(options.StartUrl), new Uri(options.EndUrl));
                }
            }
            catch (Exception ex)
            {
                return new InvokeResult
                {
                    ResultType = InvokeResultType.UnknownError,
                    Error = ex.ToString()
                };
            }

            if (wabResult.ResponseStatus == WebAuthenticationStatus.Success)
            {
                return new InvokeResult
                {
                    ResultType = InvokeResultType.Success,
                    Response = wabResult.ResponseData
                };
            }
            else if (wabResult.ResponseStatus == WebAuthenticationStatus.ErrorHttp)
            {
                return new InvokeResult
                {
                    ResultType = InvokeResultType.HttpError,
                    Error = string.Concat(wabResult.ResponseErrorDetail.ToString())
                };
            }
            else if (wabResult.ResponseStatus == WebAuthenticationStatus.UserCancel)
            {
                return new InvokeResult
                {
                    ResultType = InvokeResultType.UserCancel
                };
            }
            else
            {
                return new InvokeResult
                {
                    ResultType = InvokeResultType.UnknownError,
                    Error = "Invalid response from WebAuthenticationBroker"
                };
            }
        }