/// <summary> /// Method creates the workforceIntegration request object to pass to Graph. /// </summary> /// <param name="displayName">The display name.</param> /// <returns>An object of type <see cref="WorkforceIntegration"/>.</returns> private WorkforceIntegration CreateWorkforceIntegrationRequest(string displayName) { this.telemetryClient.TrackTrace($"{MethodBase.GetCurrentMethod().Name}"); WorkforceIntegration wfIntegration = new WorkforceIntegration() { DisplayName = displayName, ApiVersion = 1, IsActive = true, Url = this.appSettings.IntegrationApiUrl, Supports = Constants.WFISupports, Encryption = this.EstablishEncryption(), }; return(wfIntegration); }
/// <summary> /// Create new navigation property to workforceIntegrations for teamwork /// <param name="body"></param> /// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param> /// </summary> public RequestInformation CreatePostRequestInformation(WorkforceIntegration body, Action <WorkforceIntegrationsRequestBuilderPostRequestConfiguration> requestConfiguration = default) { _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = new RequestInformation { HttpMethod = Method.POST, UrlTemplate = UrlTemplate, PathParameters = PathParameters, }; requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); if (requestConfiguration != null) { var requestConfig = new WorkforceIntegrationsRequestBuilderPostRequestConfiguration(); requestConfiguration.Invoke(requestConfig); requestInfo.AddRequestOptions(requestConfig.Options); requestInfo.AddHeaders(requestConfig.Headers); } return(requestInfo); }