Ejemplo n.º 1
0
        /// <summary>
        /// Used to get basic token information for all tokens on a specified device, or all tokens mapped to the given Account PAN. This API is used to get basic token information for all tokens on a specified device, or all tokens mapped to the given Account PAN. It may be used to check current Token(s) state or, in exception scenarios (such as network time out), to ensure that external systems remain in sync with the Token state as maintained by MDES. Deactivated tokens are not returned.
        /// </summary>
        /// <exception cref="Mastercard.Developer.DigitalEnablement.Client.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="searchTokensRequestSchema">Contains the details of the request message.  (optional)</param>
        /// <returns>Task of ApiResponse (SearchTokensResponseSchema)</returns>
        public async System.Threading.Tasks.Task <ApiResponse <SearchTokensResponseSchema> > SearchTokensAsyncWithHttpInfo(SearchTokensRequestSchema searchTokensRequestSchema = default(SearchTokensRequestSchema))
        {
            var    localVarPath         = "./digitization/static/1/0/searchTokens";
            var    localVarPathParams   = new Dictionary <String, String>();
            var    localVarQueryParams  = new List <KeyValuePair <String, String> >();
            var    localVarHeaderParams = new Dictionary <String, String>(this.Configuration.DefaultHeader);
            var    localVarFormParams   = new Dictionary <String, String>();
            var    localVarFileParams   = new Dictionary <String, FileParameter>();
            Object localVarPostBody     = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
                "application/json"
            };
            String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);

            if (localVarHttpHeaderAccept != null)
            {
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
            }

            if (searchTokensRequestSchema != null && searchTokensRequestSchema.GetType() != typeof(byte[]))
            {
                localVarPostBody = this.Configuration.ApiClient.Serialize(searchTokensRequestSchema); // http body (model) parameter
            }
            else
            {
                localVarPostBody = searchTokensRequestSchema; // byte array
            }


            // make the HTTP request
            IRestResponse localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath,
                                                                                                            Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                                                                                                            localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int)localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("SearchTokens", localVarResponse);
                if (exception != null)
                {
                    throw exception;
                }
            }

            return(new ApiResponse <SearchTokensResponseSchema>(localVarStatusCode,
                                                                localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)),
                                                                (SearchTokensResponseSchema)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(SearchTokensResponseSchema))));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Used to get basic token information for all tokens on a specified device, or all tokens mapped to the given Account PAN. This API is used to get basic token information for all tokens on a specified device, or all tokens mapped to the given Account PAN. It may be used to check current Token(s) state or, in exception scenarios (such as network time out), to ensure that external systems remain in sync with the Token state as maintained by MDES. Deactivated tokens are not returned.
        /// </summary>
        /// <exception cref="Mastercard.Developer.DigitalEnablement.Client.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="searchTokensRequestSchema">Contains the details of the request message.  (optional)</param>
        /// <returns>Task of SearchTokensResponseSchema</returns>
        public async System.Threading.Tasks.Task <SearchTokensResponseSchema> SearchTokensAsync(SearchTokensRequestSchema searchTokensRequestSchema = default(SearchTokensRequestSchema))
        {
            ApiResponse <SearchTokensResponseSchema> localVarResponse = await SearchTokensAsyncWithHttpInfo(searchTokensRequestSchema);

            return(localVarResponse.Data);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Used to get basic token information for all tokens on a specified device, or all tokens mapped to the given Account PAN. This API is used to get basic token information for all tokens on a specified device, or all tokens mapped to the given Account PAN. It may be used to check current Token(s) state or, in exception scenarios (such as network time out), to ensure that external systems remain in sync with the Token state as maintained by MDES. Deactivated tokens are not returned.
        /// </summary>
        /// <exception cref="Mastercard.Developer.DigitalEnablement.Client.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="searchTokensRequestSchema">Contains the details of the request message.  (optional)</param>
        /// <returns>SearchTokensResponseSchema</returns>
        public SearchTokensResponseSchema SearchTokens(SearchTokensRequestSchema searchTokensRequestSchema = default(SearchTokensRequestSchema))
        {
            ApiResponse <SearchTokensResponseSchema> localVarResponse = SearchTokensWithHttpInfo(searchTokensRequestSchema);

            return(localVarResponse.Data);
        }