Exemplo n.º 1
0
        public void Should_Not_Retrieve_Cards_When_PageToken_Is_Not_Exist()
        {
            RetrieveCardManagementPageCardRequest retrieveCardRequest = CardManagementRetrieveCardBuilder.Create()
                                                                        .PageToken("pagetoken")
                                                                        .Build();

            CardManagementPageCard cardManagementPageCard = CardManagementPageCard.Retrieve(retrieveCardRequest, _options);

            PrintResponse(cardManagementPageCard);

            Assert.AreEqual(Status.FAILURE.ToString(), cardManagementPageCard.Status);
            Assert.AreEqual("4002", cardManagementPageCard.ErrorCode);
            Assert.AreEqual("Geçersiz token", cardManagementPageCard.ErrorMessage);
        }
Exemplo n.º 2
0
        public void Should_Retrieve_Cards()
        {
            CreateCardManagementPageInitializeRequest initializeRequest = CardManagementPageRequestBuilder.Create().Build();
            CardManagementPageInitialize cardManagementPageInitialize   = CardManagementPageInitialize.Create(initializeRequest, _options);

            RetrieveCardManagementPageCardRequest retrieveCardRequest = CardManagementRetrieveCardBuilder.Create()
                                                                        .PageToken(cardManagementPageInitialize.Token)
                                                                        .Build();

            CardManagementPageCard cardManagementPageCard = CardManagementPageCard.Retrieve(retrieveCardRequest, _options);

            PrintResponse(cardManagementPageCard);

            Assert.AreEqual(Status.SUCCESS.ToString(), cardManagementPageCard.Status);
            Assert.AreEqual(Locale.TR.ToString(), cardManagementPageCard.Locale);
            Assert.Null(cardManagementPageCard.ErrorCode);
            Assert.Null(cardManagementPageCard.ErrorMessage);
            Assert.Null(cardManagementPageCard.ErrorGroup);
            Assert.NotNull(cardManagementPageCard);
        }
Exemplo n.º 3
0
        public void Should_Retrieve_Card_Management_Page_Cards()
        {
            RetrieveCardManagementPageCardRequest retrieveCardRequest = new RetrieveCardManagementPageCardRequest();

            retrieveCardRequest.PageToken      = "set page token";
            retrieveCardRequest.Locale         = Locale.TR.ToString();
            retrieveCardRequest.ConversationId = "123456";

            CardManagementPageCard cardManagementPageCard = CardManagementPageCard.Retrieve(retrieveCardRequest, options);

            PrintResponse(cardManagementPageCard);

            Assert.AreEqual(Status.SUCCESS.ToString(), cardManagementPageCard.Status);
            Assert.AreEqual(Locale.TR.ToString(), cardManagementPageCard.Locale);
            Assert.NotNull(cardManagementPageCard.SystemTime);
            Assert.Null(cardManagementPageCard.ErrorCode);
            Assert.Null(cardManagementPageCard.ErrorMessage);
            Assert.Null(cardManagementPageCard.ErrorGroup);
            Assert.NotNull(cardManagementPageCard);
        }
Exemplo n.º 4
0
 private static string PrepareRetrieveCardManagementPageCardRequest(RetrieveCardManagementPageCardRequest request, Options options)
 {
     return($"{options.BaseUrl}/v1/card-management/pages/{request.PageToken}/cards?locale={request.Locale}&conversationId={request.ConversationId}");
 }
Exemplo n.º 5
0
 public static CardManagementPageCard Retrieve(RetrieveCardManagementPageCardRequest request, Options options)
 {
     return(RestHttpClient.Create().Get <CardManagementPageCard>(PrepareRetrieveCardManagementPageCardRequest(request, options), GetHttpHeaders(request, options)));
 }
 // Async
 public static async Task <CardManagementPageCard> RetrieveAsync(RetrieveCardManagementPageCardRequest request, Options options)
 {
     return(await RestHttpClient.Create().GetAsync <CardManagementPageCard>(PrepareRetrieveCardManagementPageCardRequest(request, options), GetHttpHeaders(request, options)));
 }