public async Task GmailAPI()
        {
            UserCredential credential = ApproveCredentialFromFile();

            GmailService gmailService = CreateGmailService(credential);

            var emailListRequest = gmailService.Users.Messages.List("*****@*****.**");

            emailListRequest.LabelIds         = "INBOX";
            emailListRequest.IncludeSpamTrash = false;

            var emailListResponse = emailListRequest.ExecuteAsync().Result;

            if (emailListResponse != null && emailListResponse.Messages != null)
            {
                foreach (var email in emailListResponse.Messages)
                {
                    var emailRequest = gmailService.Users.Messages.Get("*****@*****.**", email.Id);

                    Message emailFullResponse = emailRequest.ExecuteAsync().Result;

                    if (emailFullResponse != null)
                    {
                        string originalMailId = emailFullResponse.Id;

                        bool checkIfEmailIsInDB = await emailService.CheckIfEmailExists(originalMailId);

                        if (!checkIfEmailIsInDB && !emailFullResponse.LabelIds.Contains("CATEGORY_PROMOTIONS"))
                        {
                            GetEmailInformationByParts(emailFullResponse, out DateTime dateReceived, out string senderName, out string senderEmail, out string subject, out string body, out List <string> attachmentNames, out List <double> attachmentSizes);

                            var createdEmail = await emailService.CreateAsync(originalMailId, senderName, senderEmail, dateReceived, subject, body);

                            await this.attachmentsService.CreateAsync(createdEmail.Id, attachmentNames, attachmentSizes);
                        }
                    }
                }
            }

            gmailService.Dispose();
        }