コード例 #1
0
ファイル: EslClient.cs プロジェクト: vtcharlie/esl.sdk.net
        /// <summary>
        /// EslClient constructor.
        /// Initiates service classes that can be used by the client.
        /// </summary>
        /// <param name="apiKey">The client's api key.</param>
        /// <param name="baseUrl">The staging or production url.</param>
        public EslClient(string apiKey, string baseUrl)
        {
            Asserts.NotEmptyOrNull(apiKey, "apiKey");
            Asserts.NotEmptyOrNull(baseUrl, "baseUrl");
            this.baseUrl = AppendServicePath(baseUrl);

            configureJsonSerializationSettings();

            RestClient restClient = new RestClient(apiKey);

            packageService      = new PackageService(restClient, this.baseUrl, jsonSerializerSettings);
            sessionService      = new SessionService(apiKey, this.baseUrl);
            fieldSummaryService = new FieldSummaryService(new FieldSummaryApiClient(apiKey, this.baseUrl));
            auditService        = new AuditService(apiKey, this.baseUrl);

            eventNotificationService     = new EventNotificationService(new EventNotificationApiClient(restClient, this.baseUrl, jsonSerializerSettings));
            customFieldService           = new CustomFieldService(new CustomFieldApiClient(restClient, this.baseUrl, jsonSerializerSettings));
            groupService                 = new GroupService(new GroupApiClient(restClient, this.baseUrl, jsonSerializerSettings));
            accountService               = new AccountService(new AccountApiClient(restClient, this.baseUrl, jsonSerializerSettings));
            approvalService              = new ApprovalService(new ApprovalApiClient(restClient, this.baseUrl, jsonSerializerSettings));
            reminderService              = new ReminderService(new ReminderApiClient(restClient, this.baseUrl, jsonSerializerSettings));
            templateService              = new TemplateService(new TemplateApiClient(restClient, this.baseUrl, jsonSerializerSettings), packageService);
            authenticationTokenService   = new AuthenticationTokenService(restClient, this.baseUrl);
            attachmentRequirementService = new AttachmentRequirementService(new AttachmentRequirementApiClient(restClient, this.baseUrl, jsonSerializerSettings));
            layoutService                = new LayoutService(new LayoutApiClient(restClient, this.baseUrl, jsonSerializerSettings));
            qrCodeService                = new QRCodeService(new QRCodeApiClient(restClient, this.baseUrl, jsonSerializerSettings));
        }
コード例 #2
0
 private void init(RestClient restClient, String apiKey)
 {
     packageService            = new PackageService(restClient, this.baseUrl, jsonSerializerSettings);
     reportService             = new ReportService(restClient, this.baseUrl, jsonSerializerSettings);
     systemService             = new SystemService(restClient, this.baseUrl, jsonSerializerSettings);
     signingService            = new SigningService(restClient, this.baseUrl, jsonSerializerSettings);
     signingStyleService       = new SigningStyleService(restClient, this.baseUrl, jsonSerializerSettings);
     signerVerificationService = new SignerVerificationService(restClient, this.baseUrl, jsonSerializerSettings);
     signatureImageService     = new SignatureImageService(restClient, this.baseUrl, jsonSerializerSettings);
     sessionService            = new SessionService(apiKey, this.baseUrl);
     fieldSummaryService       = new FieldSummaryService(new FieldSummaryApiClient(apiKey, this.baseUrl));
     auditService                 = new AuditService(apiKey, this.baseUrl);
     eventNotificationService     = new EventNotificationService(new EventNotificationApiClient(restClient, this.baseUrl, jsonSerializerSettings));
     customFieldService           = new CustomFieldService(new CustomFieldApiClient(restClient, this.baseUrl, jsonSerializerSettings));
     groupService                 = new GroupService(new GroupApiClient(restClient, this.baseUrl, jsonSerializerSettings));
     accountService               = new AccountService(new AccountApiClient(restClient, this.baseUrl, jsonSerializerSettings));
     approvalService              = new ApprovalService(new ApprovalApiClient(restClient, this.baseUrl, jsonSerializerSettings));
     reminderService              = new ReminderService(new ReminderApiClient(restClient, this.baseUrl, jsonSerializerSettings));
     templateService              = new TemplateService(new TemplateApiClient(restClient, this.baseUrl, jsonSerializerSettings), packageService);
     authenticationTokenService   = new AuthenticationTokenService(restClient, this.baseUrl);
     attachmentRequirementService = new AttachmentRequirementService(restClient, this.baseUrl, jsonSerializerSettings);
     layoutService                = new LayoutService(new LayoutApiClient(restClient, this.baseUrl, jsonSerializerSettings));
     qrCodeService                = new QRCodeService(new QRCodeApiClient(restClient, this.baseUrl, jsonSerializerSettings));
     authenticationService        = new AuthenticationService(this.webpageUrl);
     dataRetentionSettingsService = new DataRetentionSettingsService(restClient, this.baseUrl);
 }
コード例 #3
0
        /// <summary>
        /// EslClient constructor.
        /// Initiates service classes that can be used by the client.
        /// </summary>
        /// <param name="apiKey">The client's api key.</param>
        /// <param name="baseUrl">The staging or production url.</param>
        public EslClient(string apiKey, string baseUrl)
        {
            Asserts.NotEmptyOrNull(apiKey, "apiKey");
            Asserts.NotEmptyOrNull(baseUrl, "baseUrl");
            this.baseUrl = AppendServicePath(baseUrl);

            RestClient restClient = new RestClient(apiKey);

            packageService           = new PackageService(restClient, this.baseUrl);
            sessionService           = new SessionService(apiKey, this.baseUrl);
            fieldSummaryService      = new FieldSummaryService(apiKey, this.baseUrl);
            auditService             = new AuditService(apiKey, this.baseUrl);
            eventNotificationService = new EventNotificationService(restClient, this.baseUrl);
            customFieldService       = new CustomFieldService(restClient, this.baseUrl);
            groupService             = new GroupService(restClient, this.baseUrl);
            accountService           = new AccountService(restClient, this.baseUrl);
            reminderService          = new ReminderService(restClient, this.baseUrl);
        }
コード例 #4
0
ファイル: Function1.cs プロジェクト: Zenetex/SampleADPAPI
        public static async Task <IActionResult> Run(
            [HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req,
            ILogger log, ExecutionContext context)
        {
            log.LogInformation("C# HTTP trigger function processed a request.");

            var config = new ConfigurationBuilder()
                         .SetBasePath(context.FunctionAppDirectory)
                         .AddJsonFile("local.settings.json", optional: true, reloadOnChange: true)
                         .AddEnvironmentVariables()
                         .Build();

            log.LogInformation("Starting Test");
            log.LogInformation("Creating Key Vault");
            ADPKeyVault secretVault = new ADPKeyVault(
                new Uri(config["KeyVaultURI"]),
                config["CertificateName"],
                config["ClientIDName"],
                config["ClientSecretName"]
                );

            log.LogInformation("Creating ADP Service");
            WorkforceNowService adpService = new WorkforceNowService(
                secretVault,
                new Uri(config["TokenURI"])
                );

            log.LogInformation("Creating ADP Event Service");
            EventNotificationService eventService = new EventNotificationService(
                adpService,
                new Uri(config["EventNotificationURI"])
                );

            log.LogInformation("Calling Events");
            ADPEventMessage eventMessage = eventService.getEvents();

            foreach (ADPEvent curEvent in eventMessage.Events)
            {
                log.LogInformation(curEvent.EventID + " - " + curEvent.EvenNameCode.CodeValue);
            }
            log.LogInformation("Nothing Crashed");

            return(new OkObjectResult(JsonConvert.SerializeObject(eventMessage)));
        }