Example #1
0
        /// <summary>
        /// Used to temporarily suspend one or more Tokens. This API is used to temporarily suspend one or more Tokens (for example, suspending all Tokens on a device in response to the device being lost).  The API is limited to 10 Tokens per request. MDES will coordinate the suspension of the Tokens and notify any relevant parties that the Tokens have been suspended. A suspended Token can be unsuspended using the Unsuspend resource.
        /// </summary>
        /// <exception cref="Mastercard.Developer.DigitalEnablement.Client.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="suspendRequestSchema">Contains the details of the request message.  (optional)</param>
        /// <returns>Task of ApiResponse (SuspendResponseSchema)</returns>
        public async System.Threading.Tasks.Task <ApiResponse <SuspendResponseSchema> > CreateSuspendAsyncWithHttpInfo(SuspendRequestSchema suspendRequestSchema = default(SuspendRequestSchema))
        {
            var    localVarPath         = "./digitization/static/1/0/suspend";
            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 (suspendRequestSchema != null && suspendRequestSchema.GetType() != typeof(byte[]))
            {
                localVarPostBody = this.Configuration.ApiClient.Serialize(suspendRequestSchema); // http body (model) parameter
            }
            else
            {
                localVarPostBody = suspendRequestSchema; // 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("CreateSuspend", localVarResponse);
                if (exception != null)
                {
                    throw exception;
                }
            }

            return(new ApiResponse <SuspendResponseSchema>(localVarStatusCode,
                                                           localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)),
                                                           (SuspendResponseSchema)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(SuspendResponseSchema))));
        }
Example #2
0
        /// <summary>
        /// Used to temporarily suspend one or more Tokens. This API is used to temporarily suspend one or more Tokens (for example, suspending all Tokens on a device in response to the device being lost).  The API is limited to 10 Tokens per request. MDES will coordinate the suspension of the Tokens and notify any relevant parties that the Tokens have been suspended. A suspended Token can be unsuspended using the Unsuspend resource.
        /// </summary>
        /// <exception cref="Mastercard.Developer.DigitalEnablement.Client.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="suspendRequestSchema">Contains the details of the request message.  (optional)</param>
        /// <returns>Task of SuspendResponseSchema</returns>
        public async System.Threading.Tasks.Task <SuspendResponseSchema> CreateSuspendAsync(SuspendRequestSchema suspendRequestSchema = default(SuspendRequestSchema))
        {
            ApiResponse <SuspendResponseSchema> localVarResponse = await CreateSuspendAsyncWithHttpInfo(suspendRequestSchema);

            return(localVarResponse.Data);
        }
Example #3
0
        /// <summary>
        /// Used to temporarily suspend one or more Tokens. This API is used to temporarily suspend one or more Tokens (for example, suspending all Tokens on a device in response to the device being lost).  The API is limited to 10 Tokens per request. MDES will coordinate the suspension of the Tokens and notify any relevant parties that the Tokens have been suspended. A suspended Token can be unsuspended using the Unsuspend resource.
        /// </summary>
        /// <exception cref="Mastercard.Developer.DigitalEnablement.Client.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="suspendRequestSchema">Contains the details of the request message.  (optional)</param>
        /// <returns>SuspendResponseSchema</returns>
        public SuspendResponseSchema CreateSuspend(SuspendRequestSchema suspendRequestSchema = default(SuspendRequestSchema))
        {
            ApiResponse <SuspendResponseSchema> localVarResponse = CreateSuspendWithHttpInfo(suspendRequestSchema);

            return(localVarResponse.Data);
        }