/// <summary> /// Gets an OpenID token, using a known Cognito ID. This known Cognito ID is returned /// from GetId. You can optionally add additional logins for the identity. Supplying multiple /// logins creates an implicit link. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetOpenIdToken service method.</param> /// /// <returns>The response from the GetOpenIdToken service method, as returned by CognitoIdentity.</returns> /// <exception cref="InternalErrorException"> /// Thrown when the service encounters an error during processing the request. /// </exception> /// <exception cref="InvalidParameterException"> /// Thrown for missing or bad input parameter(s). /// </exception> /// <exception cref="NotAuthorizedException"> /// Thrown when a user is not authorized to access the requested resource. /// </exception> /// <exception cref="ResourceConflictException"> /// Thrown when a user tries to use a login which is already linked to another account. /// </exception> /// <exception cref="ResourceNotFoundException"> /// Thrown when the requested resource (for example, a dataset or record) does not exist. /// </exception> /// <exception cref="TooManyRequestsException"> /// Thrown when a request is throttled. /// </exception> public GetOpenIdTokenResponse GetOpenIdToken(GetOpenIdTokenRequest request) { var marshaller = new GetOpenIdTokenRequestMarshaller(); var unmarshaller = GetOpenIdTokenResponseUnmarshaller.Instance; return(Invoke <GetOpenIdTokenRequest, GetOpenIdTokenResponse>(request, marshaller, unmarshaller)); }
internal GetOpenIdTokenResponse GetOpenIdToken(GetOpenIdTokenRequest request) { GetOpenIdTokenRequestMarshaller marshaller = new GetOpenIdTokenRequestMarshaller(); GetOpenIdTokenResponseUnmarshaller instance = GetOpenIdTokenResponseUnmarshaller.Instance; return(Invoke <GetOpenIdTokenRequest, GetOpenIdTokenResponse>(request, marshaller, instance)); }
public void GetOpenIdTokenMarshallTest() { var request = InstantiateClassGenerator.Execute <GetOpenIdTokenRequest>(); var marshaller = new GetOpenIdTokenRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson <GetOpenIdTokenRequest>(request, jsonRequest); var webResponse = new WebResponseData { Headers = { { "x-amzn-RequestId", Guid.NewGuid().ToString() }, { "x-amz-crc32", "0" } } }; var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation("GetOpenIdToken").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = GetOpenIdTokenResponseUnmarshaller.Instance.Unmarshall(context) as GetOpenIdTokenResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); }
/// <summary> /// Initiates the asynchronous execution of the GetOpenIdToken operation. /// <seealso cref="Amazon.CognitoIdentity.IAmazonCognitoIdentity.GetOpenIdToken"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the GetOpenIdToken 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> public Task <GetOpenIdTokenResponse> GetOpenIdTokenAsync(GetOpenIdTokenRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new GetOpenIdTokenRequestMarshaller(); var unmarshaller = GetOpenIdTokenResponseUnmarshaller.GetInstance(); return(Invoke <IRequest, GetOpenIdTokenRequest, GetOpenIdTokenResponse>(request, marshaller, unmarshaller, signer, cancellationToken)); }
IAsyncResult invokeGetOpenIdToken(GetOpenIdTokenRequest request, AsyncCallback callback, object state, bool synchronized) { var marshaller = new GetOpenIdTokenRequestMarshaller(); var unmarshaller = GetOpenIdTokenResponseUnmarshaller.Instance; return(Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer)); }
/// <summary> /// Initiates the asynchronous execution of the GetOpenIdToken operation. /// <seealso cref="Amazon.CognitoIdentity.IAmazonCognitoIdentity"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the GetOpenIdToken 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> public Task <GetOpenIdTokenResponse> GetOpenIdTokenAsync(GetOpenIdTokenRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new GetOpenIdTokenRequestMarshaller(); var unmarshaller = GetOpenIdTokenResponseUnmarshaller.Instance; return(InvokeAsync <GetOpenIdTokenRequest, GetOpenIdTokenResponse>(request, marshaller, unmarshaller, cancellationToken)); }
/// <summary> /// Initiates the asynchronous execution of the GetOpenIdToken operation. /// <seealso cref="Amazon.CognitoIdentity.IAmazonCognitoIdentity"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the GetOpenIdToken operation on AmazonCognitoIdentityClient.</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 EndGetOpenIdToken /// operation.</returns> public IAsyncResult BeginGetOpenIdToken(GetOpenIdTokenRequest request, AsyncCallback callback, object state) { var marshaller = new GetOpenIdTokenRequestMarshaller(); var unmarshaller = GetOpenIdTokenResponseUnmarshaller.Instance; return(BeginInvoke <GetOpenIdTokenRequest>(request, marshaller, unmarshaller, callback, state)); }
/// <summary> /// Initiates the asynchronous execution of the GetOpenIdToken operation. /// <seealso cref="Amazon.CognitoIdentity.IAmazonCognitoIdentity"/> /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetOpenIdToken operation.</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>void</returns> public void GetOpenIdTokenAsync(GetOpenIdTokenRequest request, AmazonServiceCallback callback, object state) { if (!AmazonInitializer.IsInitialized) { throw new Exception("AWSPrefab is not added to the scene"); } ThreadPool.QueueUserWorkItem(new WaitCallback(delegate { var marshaller = new GetOpenIdTokenRequestMarshaller(); var unmarshaller = GetOpenIdTokenResponseUnmarshaller.Instance; Invoke(request, callback, state, marshaller, unmarshaller, signer); })); return; }
public void GetOpenIdTokenAsync(GetOpenIdTokenRequest request, AmazonServiceCallback <GetOpenIdTokenRequest, GetOpenIdTokenResponse> callback, AsyncOptions options = null) { options = ((options == null) ? new AsyncOptions() : options); GetOpenIdTokenRequestMarshaller marshaller = new GetOpenIdTokenRequestMarshaller(); GetOpenIdTokenResponseUnmarshaller instance = GetOpenIdTokenResponseUnmarshaller.Instance; Action <AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null; if (callback != null) { callbackHelper = delegate(AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) { AmazonServiceResult <GetOpenIdTokenRequest, GetOpenIdTokenResponse> responseObject = new AmazonServiceResult <GetOpenIdTokenRequest, GetOpenIdTokenResponse>((GetOpenIdTokenRequest)req, (GetOpenIdTokenResponse)res, ex, ao.State); callback(responseObject); }; } BeginInvoke(request, marshaller, instance, options, callbackHelper); }
/// <summary> /// Gets an OpenID token, using a known Cognito ID. This known Cognito ID is returned /// by <a>GetId</a>. You can optionally add additional logins for the identity. Supplying /// multiple logins creates an implicit link. /// /// /// <para> /// The OpenId token is valid for 15 minutes. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetOpenIdToken service method.</param> /// /// <returns>The response from the GetOpenIdToken service method, as returned by CognitoIdentity.</returns> /// <exception cref="Amazon.CognitoIdentity.Model.InternalErrorException"> /// Thrown when the service encounters an error during processing the request. /// </exception> /// <exception cref="Amazon.CognitoIdentity.Model.InvalidParameterException"> /// Thrown for missing or bad input parameter(s). /// </exception> /// <exception cref="Amazon.CognitoIdentity.Model.NotAuthorizedException"> /// Thrown when a user is not authorized to access the requested resource. /// </exception> /// <exception cref="Amazon.CognitoIdentity.Model.ResourceConflictException"> /// Thrown when a user tries to use a login which is already linked to another account. /// </exception> /// <exception cref="Amazon.CognitoIdentity.Model.ResourceNotFoundException"> /// Thrown when the requested resource (for example, a dataset or record) does not exist. /// </exception> /// <exception cref="Amazon.CognitoIdentity.Model.TooManyRequestsException"> /// Thrown when a request is throttled. /// </exception> internal GetOpenIdTokenResponse GetOpenIdToken(GetOpenIdTokenRequest request) { var marshaller = new GetOpenIdTokenRequestMarshaller(); var unmarshaller = GetOpenIdTokenResponseUnmarshaller.Instance; return Invoke<GetOpenIdTokenRequest,GetOpenIdTokenResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the GetOpenIdToken operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the GetOpenIdToken operation on AmazonCognitoIdentityClient.</param> /// <param name="callback">An Action delegate that is invoked when the operation completes.</param> /// <param name="options">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> public void GetOpenIdTokenAsync(GetOpenIdTokenRequest request, AmazonServiceCallback<GetOpenIdTokenRequest, GetOpenIdTokenResponse> callback, AsyncOptions options = null) { options = options == null?new AsyncOptions():options; var marshaller = new GetOpenIdTokenRequestMarshaller(); var unmarshaller = GetOpenIdTokenResponseUnmarshaller.Instance; Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null; if(callback !=null ) callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => { AmazonServiceResult<GetOpenIdTokenRequest,GetOpenIdTokenResponse> responseObject = new AmazonServiceResult<GetOpenIdTokenRequest,GetOpenIdTokenResponse>((GetOpenIdTokenRequest)req, (GetOpenIdTokenResponse)res, ex , ao.State); callback(responseObject); }; BeginInvoke<GetOpenIdTokenRequest>(request, marshaller, unmarshaller, options, callbackHelper); }
/// <summary> /// Initiates the asynchronous execution of the GetOpenIdToken operation. /// <seealso cref="Amazon.CognitoIdentity.IAmazonCognitoIdentity.GetOpenIdToken"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the GetOpenIdToken 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> public Task<GetOpenIdTokenResponse> GetOpenIdTokenAsync(GetOpenIdTokenRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new GetOpenIdTokenRequestMarshaller(); var unmarshaller = GetOpenIdTokenResponseUnmarshaller.GetInstance(); return Invoke<IRequest, GetOpenIdTokenRequest, GetOpenIdTokenResponse>(request, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// Initiates the asynchronous execution of the GetOpenIdToken operation. /// <seealso cref="Amazon.CognitoIdentity.IAmazonCognitoIdentity"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the GetOpenIdToken operation on AmazonCognitoIdentityClient.</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 EndGetOpenIdToken /// operation.</returns> public IAsyncResult BeginGetOpenIdToken(GetOpenIdTokenRequest request, AsyncCallback callback, object state) { var marshaller = new GetOpenIdTokenRequestMarshaller(); var unmarshaller = GetOpenIdTokenResponseUnmarshaller.Instance; return BeginInvoke<GetOpenIdTokenRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// Initiates the asynchronous execution of the GetOpenIdToken operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the GetOpenIdToken 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> public Task<GetOpenIdTokenResponse> GetOpenIdTokenAsync(GetOpenIdTokenRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new GetOpenIdTokenRequestMarshaller(); var unmarshaller = GetOpenIdTokenResponseUnmarshaller.Instance; return InvokeAsync<GetOpenIdTokenRequest,GetOpenIdTokenResponse>(request, marshaller, unmarshaller, cancellationToken); }
public void GetOpenIdTokenMarshallTest() { var request = InstantiateClassGenerator.Execute<GetOpenIdTokenRequest>(); var marshaller = new GetOpenIdTokenRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson<GetOpenIdTokenRequest>(request,jsonRequest); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation("GetOpenIdToken").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = GetOpenIdTokenResponseUnmarshaller.Instance.Unmarshall(context) as GetOpenIdTokenResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); }
IAsyncResult invokeGetOpenIdToken(GetOpenIdTokenRequest request, AsyncCallback callback, object state, bool synchronized) { var marshaller = new GetOpenIdTokenRequestMarshaller(); var unmarshaller = GetOpenIdTokenResponseUnmarshaller.Instance; return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer); }