public async Task <SamlMetadataResponse> SamlMetadataAsync(string id, string idpUrl, string idpEntityId, string idpCertificateSHA256, string spEntityId, SSLKeystore?sslKeystore = null, string?contactProfileId = null, Func <Partial <SamlMetadataResponse>, Partial <SamlMetadataResponse> >?partial = null, CancellationToken cancellationToken = default)
        {
            var queryParameters = new NameValueCollection();

            queryParameters.Append("$fields", (partial != null ? partial(new Partial <SamlMetadataResponse>()) : Partial <SamlMetadataResponse> .Default()).ToString());

            return(await _connection.RequestResourceAsync <AuthModulesForIdSamlMetadataPostRequest, SamlMetadataResponse>("POST", $"api/http/auth-modules/{id}/saml-metadata{queryParameters.ToQueryString()}",
                                                                                                                          new AuthModulesForIdSamlMetadataPostRequest
            {
                IdpUrl = idpUrl,
                IdpEntityId = idpEntityId,
                IdpCertificateSHA256 = idpCertificateSHA256,
                SpEntityId = spEntityId,
                SslKeystore = sslKeystore,
                ContactProfileId = contactProfileId,
            }, cancellationToken));
        }
 public IAsyncEnumerable <UAUserAgreementStatus> GetAllUserAgreementStatusesAsyncEnumerable(string query = "", bool activeProfilesOnly = true, string?skip = null, int?top = 100, bool?accepted = null, Func <Partial <UAUserAgreementStatus>, Partial <UAUserAgreementStatus> >?partial = null, CancellationToken cancellationToken = default)
 => BatchEnumerator.AllItems((batchSkip, batchCancellationToken) => GetAllUserAgreementStatusesAsync(query: query, activeProfilesOnly: activeProfilesOnly, top: top, accepted: accepted, cancellationToken: cancellationToken, skip: batchSkip, partial: builder => Partial <Batch <UAUserAgreementStatus> > .Default().WithNext().WithTotalCount().WithData(partial != null ? partial : _ => Partial <UAUserAgreementStatus> .Default())), skip, cancellationToken);
            public async Task <UAUserAgreement> GetUserAgreementAsync(Func <Partial <UAUserAgreement>, Partial <UAUserAgreement> >?partial = null, CancellationToken cancellationToken = default)
            {
                var queryParameters = new NameValueCollection();

                queryParameters.Append("$fields", (partial != null ? partial(new Partial <UAUserAgreement>()) : Partial <UAUserAgreement> .Default()).ToString());

                return(await _connection.RequestResourceAsync <UAUserAgreement>("GET", $"api/http/administration/user-agreement{queryParameters.ToQueryString()}", cancellationToken));
            }
        public async Task <AccessRecord> GetLastClientCredentialsAccessInfoAsync(string id, Func <Partial <AccessRecord>, Partial <AccessRecord> >?partial = null, CancellationToken cancellationToken = default)
        {
            var queryParameters = new NameValueCollection();

            queryParameters.Append("$fields", (partial != null ? partial(new Partial <AccessRecord>()) : Partial <AccessRecord> .Default()).ToString());

            return(await _connection.RequestResourceAsync <AccessRecord>("GET", $"api/http/applications/{id}/last-client-credentials-access{queryParameters.ToQueryString()}", cancellationToken));
        }
        public async Task <ESApp> CreateApplicationAsync(string name, string?clientId = null, string?clientSecret = null, bool?clientCredentialsFlowEnabled = null, bool?codeFlowEnabled = null, string?codeFlowRedirectURIs = null, bool?implicitFlowEnabled = null, string?implicitFlowRedirectURIs = null, string?endpointUri = null, Func <Partial <ESApp>, Partial <ESApp> >?partial = null, CancellationToken cancellationToken = default)
        {
            var queryParameters = new NameValueCollection();

            queryParameters.Append("$fields", (partial != null ? partial(new Partial <ESApp>()) : Partial <ESApp> .Default()).ToString());

            return(await _connection.RequestResourceAsync <ApplicationsPostRequest, ESApp>("POST", $"api/http/applications{queryParameters.ToQueryString()}",
                                                                                           new ApplicationsPostRequest
            {
                Name = name,
                ClientId = clientId,
                ClientSecret = clientSecret,
                IsClientCredentialsFlowEnabled = clientCredentialsFlowEnabled,
                IsCodeFlowEnabled = codeFlowEnabled,
                CodeFlowRedirectURIs = codeFlowRedirectURIs,
                IsImplicitFlowEnabled = implicitFlowEnabled,
                ImplicitFlowRedirectURIs = implicitFlowRedirectURIs,
                EndpointUri = endpointUri,
            }, cancellationToken));
        }
Example #6
0
            public async Task <AbsenceReasonRecord> CreateAbsenceReasonAsync(string id, string name, string description, bool defaultAvailability, bool approvalRequired, string?icon = null, Func <Partial <AbsenceReasonRecord>, Partial <AbsenceReasonRecord> >?partial = null, CancellationToken cancellationToken = default)
            {
                var queryParameters = new NameValueCollection();

                queryParameters.Append("$fields", (partial != null ? partial(new Partial <AbsenceReasonRecord>()) : Partial <AbsenceReasonRecord> .Default()).ToString());

                return(await _connection.RequestResourceAsync <AbsencesAbsenceReasonsForIdPostRequest, AbsenceReasonRecord>("POST", $"api/http/absences/absence-reasons/{id}{queryParameters.ToQueryString()}",
                                                                                                                            new AbsencesAbsenceReasonsForIdPostRequest
                {
                    Name = name,
                    Description = description,
                    IsDefaultAvailability = defaultAvailability,
                    IsApprovalRequired = approvalRequired,
                    Icon = icon,
                }, cancellationToken));
            }
Example #7
0
        public async Task <AbsenceRecord> CreateAbsenceAsync(string member, string reason, string description, DateTime since, DateTime till, string icon, bool available = false, string?location = null, List <CustomFieldInputValue>?customFieldValues = null, Func <Partial <AbsenceRecord>, Partial <AbsenceRecord> >?partial = null, CancellationToken cancellationToken = default)
        {
            var queryParameters = new NameValueCollection();

            queryParameters.Append("$fields", (partial != null ? partial(new Partial <AbsenceRecord>()) : Partial <AbsenceRecord> .Default()).ToString());

            return(await _connection.RequestResourceAsync <AbsencesPostRequest, AbsenceRecord>("POST", $"api/http/absences{queryParameters.ToQueryString()}",
                                                                                               new AbsencesPostRequest
            {
                Member = member,
                Reason = reason,
                Description = description,
                Location = location,
                Since = since,
                Till = till,
                IsAvailable = available,
                Icon = icon,
                CustomFieldValues = customFieldValues,
            }, cancellationToken));
        }
Example #8
0
            public async Task <List <CustomField> > GetAllFieldsAsync(string typeKey, ExtendedTypeScope scope, bool withArchived = false, Func <Partial <CustomField>, Partial <CustomField> >?partial = null, CancellationToken cancellationToken = default)
            {
                var queryParameters = new NameValueCollection();

                queryParameters.Append("withArchived", withArchived.ToString("l"));
                queryParameters.Append("scope", scope.ToString());
                queryParameters.Append("$fields", (partial != null ? partial(new Partial <CustomField>()) : Partial <CustomField> .Default()).ToString());

                return(await _connection.RequestResourceAsync <List <CustomField> >("GET", $"api/http/custom-fields/{typeKey}/fields{queryParameters.ToQueryString()}", cancellationToken));
            }
Example #9
0
                public async Task <Batch <CFValue> > GetAllFilterValuesAsync(string typeKey, string id, ExtendedTypeScope scope, bool calculateTotal = false, string?skip = null, int?top = 100, Func <Partial <Batch <CFValue> >, Partial <Batch <CFValue> > >?partial = null, CancellationToken cancellationToken = default)
                {
                    var queryParameters = new NameValueCollection();

                    if (skip != null)
                    {
                        queryParameters.Append("$skip", skip);
                    }
                    if (top != null)
                    {
                        queryParameters.Append("$top", top?.ToString());
                    }
                    queryParameters.Append("scope", scope.ToString());
                    queryParameters.Append("calculateTotal", calculateTotal.ToString("l"));
                    queryParameters.Append("$fields", (partial != null ? partial(new Partial <Batch <CFValue> >()) : Partial <Batch <CFValue> > .Default()).ToString());

                    return(await _connection.RequestResourceAsync <Batch <CFValue> >("GET", $"api/http/custom-fields/{typeKey}/fields/{id}/filter-values{queryParameters.ToQueryString()}", cancellationToken));
                }
Example #10
0
 public IAsyncEnumerable <EnumValueData> GetAllEnumValuesAsyncEnumerable(string typeKey, string customFieldId, ExtendedTypeScope scope, EnumValueOrdering ordering = EnumValueOrdering.NAMEASC, string?skip = null, int?top = 100, string?query = null, bool?countRecords = null, string?addedByProfileId = null, Func <Partial <EnumValueData>, Partial <EnumValueData> >?partial = null, CancellationToken cancellationToken = default)
 => BatchEnumerator.AllItems((batchSkip, batchCancellationToken) => GetAllEnumValuesAsync(typeKey: typeKey, customFieldId: customFieldId, ordering: ordering, scope: scope, top: top, query: query, countRecords: countRecords, addedByProfileId: addedByProfileId, cancellationToken: cancellationToken, skip: batchSkip, partial: builder => Partial <Batch <EnumValueData> > .Default().WithNext().WithTotalCount().WithData(partial != null ? partial : _ => Partial <EnumValueData> .Default())), skip, cancellationToken);
Example #11
0
            public async Task <CustomField> CreateFieldAsync(string typeKey, string name, CFType type, bool required, bool @private, CFInputValue defaultValue, ExtendedTypeScope scope, string?description = null, CFConstraint?constraint = null, AccessType?access = null, CFEnumValuesModification?openEnumValuesModification = null, Func <Partial <CustomField>, Partial <CustomField> >?partial = null, CancellationToken cancellationToken = default)
            {
                var queryParameters = new NameValueCollection();

                queryParameters.Append("$fields", (partial != null ? partial(new Partial <CustomField>()) : Partial <CustomField> .Default()).ToString());

                return(await _connection.RequestResourceAsync <CustomFieldsForTypeKeyFieldsPostRequest, CustomField>("POST", $"api/http/custom-fields/{typeKey}/fields{queryParameters.ToQueryString()}",
                                                                                                                     new CustomFieldsForTypeKeyFieldsPostRequest
                {
                    Name = name,
                    Description = description,
                    Type = type,
                    Constraint = constraint,
                    IsRequired = required,
                    IsPrivate = @private,
                    Access = access,
                    DefaultValue = defaultValue,
                    OpenEnumValuesModification = openEnumValuesModification,
                    Scope = scope,
                }, cancellationToken));
            }
Example #12
0
            public async Task <Batch <EnumValueData> > GetAllEnumValuesAsync(string typeKey, string customFieldId, ExtendedTypeScope scope, EnumValueOrdering ordering = EnumValueOrdering.NAMEASC, string?skip = null, int?top = 100, string?query = null, bool?countRecords = null, string?addedByProfileId = null, Func <Partial <Batch <EnumValueData> >, Partial <Batch <EnumValueData> > >?partial = null, CancellationToken cancellationToken = default)
            {
                var queryParameters = new NameValueCollection();

                if (skip != null)
                {
                    queryParameters.Append("$skip", skip);
                }
                if (top != null)
                {
                    queryParameters.Append("$top", top?.ToString());
                }
                if (query != null)
                {
                    queryParameters.Append("query", query);
                }
                queryParameters.Append("ordering", ordering.ToEnumString());
                if (countRecords != null)
                {
                    queryParameters.Append("countRecords", countRecords?.ToString("l"));
                }
                if (addedByProfileId != null)
                {
                    queryParameters.Append("addedByProfileId", addedByProfileId);
                }
                queryParameters.Append("scope", scope.ToString());
                queryParameters.Append("$fields", (partial != null ? partial(new Partial <Batch <EnumValueData> >()) : Partial <Batch <EnumValueData> > .Default()).ToString());

                return(await _connection.RequestResourceAsync <Batch <EnumValueData> >("GET", $"api/http/custom-fields/{typeKey}/enum-values/{customFieldId}{queryParameters.ToQueryString()}", cancellationToken));
            }
Example #13
0
            public async Task <List <EnumValueData> > CreateEnumValueAsync(string typeKey, string customFieldId, List <EnumValueData> valuesToAdd, ExtendedTypeScope scope, Func <Partial <EnumValueData>, Partial <EnumValueData> >?partial = null, CancellationToken cancellationToken = default)
            {
                var queryParameters = new NameValueCollection();

                queryParameters.Append("$fields", (partial != null ? partial(new Partial <EnumValueData>()) : Partial <EnumValueData> .Default()).ToString());

                return(await _connection.RequestResourceAsync <CustomFieldsForTypeKeyEnumValuesForCustomFieldIdPostRequest, List <EnumValueData> >("POST", $"api/http/custom-fields/{typeKey}/enum-values/{customFieldId}{queryParameters.ToQueryString()}",
                                                                                                                                                   new CustomFieldsForTypeKeyEnumValuesForCustomFieldIdPostRequest
                {
                    ValuesToAdd = valuesToAdd,
                    Scope = scope,
                }, cancellationToken));
            }
Example #14
0
 public IAsyncEnumerable <CustomFieldsRecord> GetAllValuesAsyncEnumerable(string typeKey, ExtendedTypeScope scope, string?skip = null, int?top = 100, List <string>?extendedEntityIds = null, Func <Partial <CustomFieldsRecord>, Partial <CustomFieldsRecord> >?partial = null, CancellationToken cancellationToken = default)
 => BatchEnumerator.AllItems((batchSkip, batchCancellationToken) => GetAllValuesAsync(typeKey: typeKey, scope: scope, top: top, extendedEntityIds: extendedEntityIds, cancellationToken: cancellationToken, skip: batchSkip, partial: builder => Partial <Batch <CustomFieldsRecord> > .Default().WithNext().WithTotalCount().WithData(partial != null ? partial : _ => Partial <CustomFieldsRecord> .Default())), skip, cancellationToken);
Example #15
0
        public async Task <Batch <AbsenceRecord> > GetAllAbsencesAsync(AbsenceListMode viewMode = AbsenceListMode.All, string?skip = null, int?top = 100, string?member = null, List <string>?members = null, string?location = null, string?team = null, DateTime?since = null, DateTime?till = null, string?reason = null, Func <Partial <Batch <AbsenceRecord> >, Partial <Batch <AbsenceRecord> > >?partial = null, CancellationToken cancellationToken = default)
        {
            var queryParameters = new NameValueCollection();

            if (skip != null)
            {
                queryParameters.Append("$skip", skip);
            }
            if (top != null)
            {
                queryParameters.Append("$top", top?.ToString());
            }
            if (member != null)
            {
                queryParameters.Append("member", member);
            }
            if (members != null)
            {
                queryParameters.Append("members", members.Select(it => it));
            }
            if (location != null)
            {
                queryParameters.Append("location", location);
            }
            if (team != null)
            {
                queryParameters.Append("team", team);
            }
            if (since != null)
            {
                queryParameters.Append("since", since?.ToString("yyyy-MM-dd"));
            }
            if (till != null)
            {
                queryParameters.Append("till", till?.ToString("yyyy-MM-dd"));
            }
            queryParameters.Append("viewMode", viewMode.ToEnumString());
            if (reason != null)
            {
                queryParameters.Append("reason", reason);
            }
            queryParameters.Append("$fields", (partial != null ? partial(new Partial <Batch <AbsenceRecord> >()) : Partial <Batch <AbsenceRecord> > .Default()).ToString());

            return(await _connection.RequestResourceAsync <Batch <AbsenceRecord> >("GET", $"api/http/absences{queryParameters.ToQueryString()}", cancellationToken));
        }
Example #16
0
 public IAsyncEnumerable <CFValue> GetAllFilterValuesAsyncEnumerable(string typeKey, string id, ExtendedTypeScope scope, bool calculateTotal = false, string?skip = null, int?top = 100, Func <Partial <CFValue>, Partial <CFValue> >?partial = null, CancellationToken cancellationToken = default)
 => BatchEnumerator.AllItems((batchSkip, batchCancellationToken) => GetAllFilterValuesAsync(typeKey: typeKey, id: id, scope: scope, calculateTotal: calculateTotal, top: top, cancellationToken: cancellationToken, skip: batchSkip, partial: builder => Partial <Batch <CFValue> > .Default().WithNext().WithTotalCount().WithData(partial != null ? partial : _ => Partial <CFValue> .Default())), skip, cancellationToken);
Example #17
0
 public IAsyncEnumerable <AbsenceRecord> GetAllAbsencesAsyncEnumerable(AbsenceListMode viewMode = AbsenceListMode.All, string?skip = null, int?top = 100, string?member = null, List <string>?members = null, string?location = null, string?team = null, DateTime?since = null, DateTime?till = null, string?reason = null, Func <Partial <AbsenceRecord>, Partial <AbsenceRecord> >?partial = null, CancellationToken cancellationToken = default)
 => BatchEnumerator.AllItems((batchSkip, batchCancellationToken) => GetAllAbsencesAsync(viewMode: viewMode, top: top, member: member, members: members, location: location, team: team, since: since, till: till, reason: reason, cancellationToken: cancellationToken, skip: batchSkip, partial: builder => Partial <Batch <AbsenceRecord> > .Default().WithNext().WithTotalCount().WithData(partial != null ? partial : _ => Partial <AbsenceRecord> .Default())), skip, cancellationToken);
Example #18
0
            public async Task <CustomFieldsRecord> GetValueAsync(string typeKey, string entityId, ExtendedTypeScope scope, Func <Partial <CustomFieldsRecord>, Partial <CustomFieldsRecord> >?partial = null, CancellationToken cancellationToken = default)
            {
                var queryParameters = new NameValueCollection();

                queryParameters.Append("scope", scope.ToString());
                queryParameters.Append("$fields", (partial != null ? partial(new Partial <CustomFieldsRecord>()) : Partial <CustomFieldsRecord> .Default()).ToString());

                return(await _connection.RequestResourceAsync <CustomFieldsRecord>("GET", $"api/http/custom-fields/{typeKey}/{entityId}/values{queryParameters.ToQueryString()}", cancellationToken));
            }
Example #19
0
            public async Task <AbsenceReasonRecord> GetAbsenceReasonAsync(string id, Func <Partial <AbsenceReasonRecord>, Partial <AbsenceReasonRecord> >?partial = null, CancellationToken cancellationToken = default)
            {
                var queryParameters = new NameValueCollection();

                queryParameters.Append("$fields", (partial != null ? partial(new Partial <AbsenceReasonRecord>()) : Partial <AbsenceReasonRecord> .Default()).ToString());

                return(await _connection.RequestResourceAsync <AbsenceReasonRecord>("GET", $"api/http/absences/absence-reasons/{id}{queryParameters.ToQueryString()}", cancellationToken));
            }
Example #20
0
            public async Task <List <ExtendedType> > GetAllExtendedTypesAsync(ExtendedTypeScopeType scope = ExtendedTypeScopeType.Org, Func <Partial <ExtendedType>, Partial <ExtendedType> >?partial = null, CancellationToken cancellationToken = default)
            {
                var queryParameters = new NameValueCollection();

                queryParameters.Append("scope", scope.ToEnumString());
                queryParameters.Append("$fields", (partial != null ? partial(new Partial <ExtendedType>()) : Partial <ExtendedType> .Default()).ToString());

                return(await _connection.RequestResourceAsync <List <ExtendedType> >("GET", $"api/http/custom-fields/extended-types{queryParameters.ToQueryString()}", cancellationToken));
            }
        public async Task <List <ESApp> > GetAllApplicationsAsync(string query, bool withArchived = false, Func <Partial <ESApp>, Partial <ESApp> >?partial = null, CancellationToken cancellationToken = default)
        {
            var queryParameters = new NameValueCollection();

            queryParameters.Append("query", query);
            queryParameters.Append("withArchived", withArchived.ToString("l"));
            queryParameters.Append("$fields", (partial != null ? partial(new Partial <ESApp>()) : Partial <ESApp> .Default()).ToString());

            return(await _connection.RequestResourceAsync <List <ESApp> >("GET", $"api/http/applications{queryParameters.ToQueryString()}", cancellationToken));
        }
Example #22
0
            public async Task <Batch <CustomFieldsRecord> > GetAllValuesAsync(string typeKey, ExtendedTypeScope scope, string?skip = null, int?top = 100, List <string>?extendedEntityIds = null, Func <Partial <Batch <CustomFieldsRecord> >, Partial <Batch <CustomFieldsRecord> > >?partial = null, CancellationToken cancellationToken = default)
            {
                var queryParameters = new NameValueCollection();

                if (skip != null)
                {
                    queryParameters.Append("$skip", skip);
                }
                if (top != null)
                {
                    queryParameters.Append("$top", top?.ToString());
                }
                if (extendedEntityIds != null)
                {
                    queryParameters.Append("extendedEntityIds", extendedEntityIds.Select(it => it));
                }
                queryParameters.Append("scope", scope.ToString());
                queryParameters.Append("$fields", (partial != null ? partial(new Partial <Batch <CustomFieldsRecord> >()) : Partial <Batch <CustomFieldsRecord> > .Default()).ToString());

                return(await _connection.RequestResourceAsync <Batch <CustomFieldsRecord> >("GET", $"api/http/custom-fields/{typeKey}/all-values{queryParameters.ToQueryString()}", cancellationToken));
            }
            public async Task <List <ESSshKey> > GetSshKeyAsync(string id, Func <Partial <ESSshKey>, Partial <ESSshKey> >?partial = null, CancellationToken cancellationToken = default)
            {
                var queryParameters = new NameValueCollection();

                queryParameters.Append("$fields", (partial != null ? partial(new Partial <ESSshKey>()) : Partial <ESSshKey> .Default()).ToString());

                return(await _connection.RequestResourceAsync <List <ESSshKey> >("GET", $"api/http/applications/{id}/ssh-keys{queryParameters.ToQueryString()}", cancellationToken));
            }
        public async Task <TrustedCertificate> CreateTrustedCertificateAsync(string alias, string data, bool archived, Func <Partial <TrustedCertificate>, Partial <TrustedCertificate> >?partial = null, CancellationToken cancellationToken = default)
        {
            var queryParameters = new NameValueCollection();

            queryParameters.Append("$fields", (partial != null ? partial(new Partial <TrustedCertificate>()) : Partial <TrustedCertificate> .Default()).ToString());

            return(await _connection.RequestResourceAsync <TrustedCertificatesPostRequest, TrustedCertificate>("POST", $"api/http/trusted-certificates{queryParameters.ToQueryString()}",
                                                                                                               new TrustedCertificatesPostRequest
            {
                Alias = alias,
                Data = data,
                IsArchived = archived,
            }, cancellationToken));
        }
                public async Task <Batch <UAUserAgreementStatus> > GetAllUserAgreementStatusesAsync(string query = "", bool activeProfilesOnly = true, string?skip = null, int?top = 100, bool?accepted = null, Func <Partial <Batch <UAUserAgreementStatus> >, Partial <Batch <UAUserAgreementStatus> > >?partial = null, CancellationToken cancellationToken = default)
                {
                    var queryParameters = new NameValueCollection();

                    if (skip != null)
                    {
                        queryParameters.Append("$skip", skip);
                    }
                    if (top != null)
                    {
                        queryParameters.Append("$top", top?.ToString());
                    }
                    queryParameters.Append("query", query);
                    if (accepted != null)
                    {
                        queryParameters.Append("accepted", accepted?.ToString("l"));
                    }
                    queryParameters.Append("activeProfilesOnly", activeProfilesOnly.ToString("l"));
                    queryParameters.Append("$fields", (partial != null ? partial(new Partial <Batch <UAUserAgreementStatus> >()) : Partial <Batch <UAUserAgreementStatus> > .Default()).ToString());

                    return(await _connection.RequestResourceAsync <Batch <UAUserAgreementStatus> >("GET", $"api/http/administration/user-agreement/status{queryParameters.ToQueryString()}", cancellationToken));
                }
        public async Task <List <TrustedCertificate> > GetAllTrustedCertificatesAsync(Func <Partial <TrustedCertificate>, Partial <TrustedCertificate> >?partial = null, CancellationToken cancellationToken = default)
        {
            var queryParameters = new NameValueCollection();

            queryParameters.Append("$fields", (partial != null ? partial(new Partial <TrustedCertificate>()) : Partial <TrustedCertificate> .Default()).ToString());

            return(await _connection.RequestResourceAsync <List <TrustedCertificate> >("GET", $"api/http/trusted-certificates{queryParameters.ToQueryString()}", cancellationToken));
        }
            public async Task <SupportProfile> CreateSupportAsync(Func <Partial <SupportProfile>, Partial <SupportProfile> >?partial = null, CancellationToken cancellationToken = default)
            {
                var queryParameters = new NameValueCollection();

                queryParameters.Append("$fields", (partial != null ? partial(new Partial <SupportProfile>()) : Partial <SupportProfile> .Default()).ToString());

                return(await _connection.RequestResourceAsync <SupportProfile>("POST", $"api/http/administration/support{queryParameters.ToQueryString()}", cancellationToken));
            }
        public async Task <CertificateInfo> InfoAsync(string data, Func <Partial <CertificateInfo>, Partial <CertificateInfo> >?partial = null, CancellationToken cancellationToken = default)
        {
            var queryParameters = new NameValueCollection();

            queryParameters.Append("data", data);
            queryParameters.Append("$fields", (partial != null ? partial(new Partial <CertificateInfo>()) : Partial <CertificateInfo> .Default()).ToString());

            return(await _connection.RequestResourceAsync <CertificateInfo>("GET", $"api/http/trusted-certificates/info{queryParameters.ToQueryString()}", cancellationToken));
        }
            public async Task <UAUserAgreement> UploadNewUserAgreementAsync(string newContent, bool invalidate, Func <Partial <UAUserAgreement>, Partial <UAUserAgreement> >?partial = null, CancellationToken cancellationToken = default)
            {
                var queryParameters = new NameValueCollection();

                queryParameters.Append("$fields", (partial != null ? partial(new Partial <UAUserAgreement>()) : Partial <UAUserAgreement> .Default()).ToString());

                return(await _connection.RequestResourceAsync <AdministrationUserAgreementPatchRequest, UAUserAgreement>("PATCH", $"api/http/administration/user-agreement{queryParameters.ToQueryString()}",
                                                                                                                         new AdministrationUserAgreementPatchRequest
                {
                    NewContent = newContent,
                    IsInvalidate = invalidate,
                }, cancellationToken));
            }
        public async Task <ESAuthModule> CreateAuthModuleAsync(string key, string name, bool enabled, ESAuthModuleSettings settings, Func <Partial <ESAuthModule>, Partial <ESAuthModule> >?partial = null, CancellationToken cancellationToken = default)
        {
            var queryParameters = new NameValueCollection();

            queryParameters.Append("$fields", (partial != null ? partial(new Partial <ESAuthModule>()) : Partial <ESAuthModule> .Default()).ToString());

            return(await _connection.RequestResourceAsync <AuthModulesPostRequest, ESAuthModule>("POST", $"api/http/auth-modules{queryParameters.ToQueryString()}",
                                                                                                 new AuthModulesPostRequest
            {
                Key = key,
                Name = name,
                IsEnabled = enabled,
                Settings = settings,
            }, cancellationToken));
        }