Пример #1
0
        /// <summary>
        ///  Submit an leave (vacation) claim for a worker
        /// </summary>
        /// <exception cref="ASW.APIServices.Core.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="id">ID of the worker</param>
        /// <param name="leaveClaim">Leave claim for a worker</param>
        /// <returns>ApiResponse of AsyncResponse</returns>
        public ASW.APIServices.Core.Client.ApiResponse <AsyncResponse> SubmitAnnualLeaveClaimWithHttpInfo(string id, LeaveClaim leaveClaim)
        {
            // verify the required parameter 'id' is set
            if (id == null)
            {
                throw new ASW.APIServices.Core.Client.ApiException(400, "Missing required parameter 'id' when calling WorkersApi->SubmitAnnualLeaveClaim");
            }

            // verify the required parameter 'leaveClaim' is set
            if (leaveClaim == null)
            {
                throw new ASW.APIServices.Core.Client.ApiException(400, "Missing required parameter 'leaveClaim' when calling WorkersApi->SubmitAnnualLeaveClaim");
            }

            ASW.APIServices.Core.Client.RequestOptions localVarRequestOptions = new ASW.APIServices.Core.Client.RequestOptions();

            String[] _contentTypes = new String[] {
                "application/json"
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };

            var localVarContentType = ASW.APIServices.Core.Client.ClientUtils.SelectHeaderContentType(_contentTypes);

            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = ASW.APIServices.Core.Client.ClientUtils.SelectHeaderAccept(_accepts);

            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            if (id != null)
            {
                localVarRequestOptions.PathParameters.Add("id", ASW.APIServices.Core.Client.ClientUtils.ParameterToString(id)); // path parameter
            }
            localVarRequestOptions.Data = leaveClaim;


            // make the HTTP request
            var localVarResponse = this.Client.Post <AsyncResponse>("/worker/{id}/leave", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("SubmitAnnualLeaveClaim", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        /// <exception cref="ASW.APIServices.Core.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="id">ID of the duty</param>
        /// <param name="dutyCostDetails">Costing Information</param>
        /// <returns>ApiResponse of Object(void)</returns>
        public ASW.APIServices.Core.Client.ApiResponse <Object> SendDutyCostingWithHttpInfo(string id, DutyCostDetails dutyCostDetails)
        {
            // verify the required parameter 'id' is set
            if (id == null)
            {
                throw new ASW.APIServices.Core.Client.ApiException(400, "Missing required parameter 'id' when calling CostingApi->SendDutyCosting");
            }

            // verify the required parameter 'dutyCostDetails' is set
            if (dutyCostDetails == null)
            {
                throw new ASW.APIServices.Core.Client.ApiException(400, "Missing required parameter 'dutyCostDetails' when calling CostingApi->SendDutyCosting");
            }

            ASW.APIServices.Core.Client.RequestOptions localVarRequestOptions = new ASW.APIServices.Core.Client.RequestOptions();

            String[] _contentTypes = new String[] {
                "application/json"
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };

            var localVarContentType = ASW.APIServices.Core.Client.ClientUtils.SelectHeaderContentType(_contentTypes);

            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = ASW.APIServices.Core.Client.ClientUtils.SelectHeaderAccept(_accepts);

            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            if (id != null)
            {
                localVarRequestOptions.PathParameters.Add("id", ASW.APIServices.Core.Client.ClientUtils.ParameterToString(id)); // path parameter
            }
            localVarRequestOptions.Data = dutyCostDetails;


            // make the HTTP request
            var localVarResponse = this.Client.Post <Object>("/duties/{id}/costing", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("SendDutyCosting", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
Пример #3
0
        /// <summary>
        ///  Submit an leave (vacation) claim for a worker
        /// </summary>
        /// <exception cref="ASW.APIServices.Core.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="id">ID of the worker</param>
        /// <param name="leaveClaim">Leave claim for a worker</param>
        /// <returns>Task of ApiResponse (AsyncResponse)</returns>
        public async System.Threading.Tasks.Task <ASW.APIServices.Core.Client.ApiResponse <AsyncResponse> > SubmitAnnualLeaveClaimAsyncWithHttpInfo(string id, LeaveClaim leaveClaim)
        {
            // verify the required parameter 'id' is set
            if (id == null)
            {
                throw new ASW.APIServices.Core.Client.ApiException(400, "Missing required parameter 'id' when calling AnnualLeaveClaimsApi->SubmitAnnualLeaveClaim");
            }

            // verify the required parameter 'leaveClaim' is set
            if (leaveClaim == null)
            {
                throw new ASW.APIServices.Core.Client.ApiException(400, "Missing required parameter 'leaveClaim' when calling AnnualLeaveClaimsApi->SubmitAnnualLeaveClaim");
            }


            ASW.APIServices.Core.Client.RequestOptions localVarRequestOptions = new ASW.APIServices.Core.Client.RequestOptions();

            String[] _contentTypes = new String[] {
                "application/json"
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };

            foreach (var _contentType in _contentTypes)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType);
            }

            foreach (var _accept in _accepts)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
            }

            if (id != null)
            {
                localVarRequestOptions.PathParameters.Add("id", ASW.APIServices.Core.Client.ClientUtils.ParameterToString(id)); // path parameter
            }
            localVarRequestOptions.Data = leaveClaim;


            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.PostAsync <AsyncResponse>("/worker/{id}/leave", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("SubmitAnnualLeaveClaim", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
Пример #4
0
        /// <summary>
        ///
        /// </summary>
        /// <exception cref="ASW.APIServices.Core.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="id">ID of the duty</param>
        /// <param name="dutyCostDetails">Costing Information</param>
        /// <returns>Task of ApiResponse</returns>
        public async System.Threading.Tasks.Task <ASW.APIServices.Core.Client.ApiResponse <Object> > SendDutyCostingAsyncWithHttpInfo(string id, DutyCostDetails dutyCostDetails)
        {
            // verify the required parameter 'id' is set
            if (id == null)
            {
                throw new ASW.APIServices.Core.Client.ApiException(400, "Missing required parameter 'id' when calling DutiesApi->SendDutyCosting");
            }

            // verify the required parameter 'dutyCostDetails' is set
            if (dutyCostDetails == null)
            {
                throw new ASW.APIServices.Core.Client.ApiException(400, "Missing required parameter 'dutyCostDetails' when calling DutiesApi->SendDutyCosting");
            }


            ASW.APIServices.Core.Client.RequestOptions localVarRequestOptions = new ASW.APIServices.Core.Client.RequestOptions();

            String[] _contentTypes = new String[] {
                "application/json"
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };

            foreach (var _contentType in _contentTypes)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType);
            }

            foreach (var _accept in _accepts)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
            }

            if (id != null)
            {
                localVarRequestOptions.PathParameters.Add("id", ASW.APIServices.Core.Client.ClientUtils.ParameterToString(id)); // path parameter
            }
            localVarRequestOptions.Data = dutyCostDetails;


            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.PostAsync <Object>("/duties/{id}/costing", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("SendDutyCosting", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
Пример #5
0
        /// <summary>
        ///  Retrieve worker details from the Allocate ecosystem using the Allocate Worker id. The Allocate Worker id will be issued when registering a worker.
        /// </summary>
        /// <exception cref="ASW.APIServices.Core.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="id">The ID of the worker</param>
        /// <returns>ApiResponse of Person</returns>
        public ASW.APIServices.Core.Client.ApiResponse <Person> GetWorkerWithHttpInfo(string id)
        {
            // verify the required parameter 'id' is set
            if (id == null)
            {
                throw new ASW.APIServices.Core.Client.ApiException(400, "Missing required parameter 'id' when calling DefaultApi->GetWorker");
            }

            ASW.APIServices.Core.Client.RequestOptions localVarRequestOptions = new ASW.APIServices.Core.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };

            var localVarContentType = ASW.APIServices.Core.Client.ClientUtils.SelectHeaderContentType(_contentTypes);

            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = ASW.APIServices.Core.Client.ClientUtils.SelectHeaderAccept(_accepts);

            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            if (id != null)
            {
                localVarRequestOptions.PathParameters.Add("id", ASW.APIServices.Core.Client.ClientUtils.ParameterToString(id)); // path parameter
            }
            // authentication (jwt) required
            // http basic authentication required
            if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password))
            {
                localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + ASW.APIServices.Core.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password));
            }

            // make the HTTP request
            var localVarResponse = this.Client.Get <Person>("/workers/{id}", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("GetWorker", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
Пример #6
0
        /// <summary>
        ///  Create a new vacancy
        /// </summary>
        /// <exception cref="ASW.APIServices.Core.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="vacancy">Details of the vacancy</param>
        /// <returns>ApiResponse of CreateVacancyResponse</returns>
        public ASW.APIServices.Core.Client.ApiResponse <CreateVacancyResponse> CreateVacancyWithHttpInfo(Vacancy vacancy)
        {
            // verify the required parameter 'vacancy' is set
            if (vacancy == null)
            {
                throw new ASW.APIServices.Core.Client.ApiException(400, "Missing required parameter 'vacancy' when calling VacancyApi->CreateVacancy");
            }

            ASW.APIServices.Core.Client.RequestOptions localVarRequestOptions = new ASW.APIServices.Core.Client.RequestOptions();

            String[] _contentTypes = new String[] {
                "application/json"
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };

            var localVarContentType = ASW.APIServices.Core.Client.ClientUtils.SelectHeaderContentType(_contentTypes);

            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = ASW.APIServices.Core.Client.ClientUtils.SelectHeaderAccept(_accepts);

            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            localVarRequestOptions.Data = vacancy;

            // authentication (jwt) required
            // http basic authentication required
            if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password))
            {
                localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + ASW.APIServices.Core.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password));
            }

            // make the HTTP request
            var localVarResponse = this.Client.Post <CreateVacancyResponse>("/vacancies", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("CreateVacancy", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
Пример #7
0
        /// <summary>
        ///
        /// </summary>
        /// <exception cref="ASW.APIServices.Core.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="id">The ID of the proposal</param>
        /// <returns>Task of ApiResponse (ProposalDetails)</returns>
        public async System.Threading.Tasks.Task <ASW.APIServices.Core.Client.ApiResponse <ProposalDetails> > GetProposalAsyncWithHttpInfo(string id)
        {
            // verify the required parameter 'id' is set
            if (id == null)
            {
                throw new ASW.APIServices.Core.Client.ApiException(400, "Missing required parameter 'id' when calling ProposalApi->GetProposal");
            }


            ASW.APIServices.Core.Client.RequestOptions localVarRequestOptions = new ASW.APIServices.Core.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };

            foreach (var _contentType in _contentTypes)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType);
            }

            foreach (var _accept in _accepts)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
            }

            if (id != null)
            {
                localVarRequestOptions.PathParameters.Add("id", ASW.APIServices.Core.Client.ClientUtils.ParameterToString(id)); // path parameter
            }
            // authentication (jwt) required
            // http basic authentication required
            if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password))
            {
                localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + ASW.APIServices.Core.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password));
            }

            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.GetAsync <ProposalDetails>("/proposals/{id}", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("GetProposal", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
Пример #8
0
        /// <summary>
        ///  Provide worker details for inclusion into the Allocate ecosystem.  The platform will accept the worker information, and respond either synchronously or asynchronously with the allocate worker identifier.  This may entail an on-boarding process, so the final response may require human interaction before it can be completed.  Where there is a source system in common, such as HealthSuite and a Bank system both using ESR as a source of worker data, a person record containing an ESR trust-relative Staff Number is likely to be sufficient.
        /// </summary>
        /// <exception cref="ASW.APIServices.Core.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="person">Worker information</param>
        /// <returns>Task of ApiResponse (WorkerRegistrationResponse)</returns>
        public async System.Threading.Tasks.Task <ASW.APIServices.Core.Client.ApiResponse <WorkerRegistrationResponse> > RegisterWorkerAsyncWithHttpInfo(Person person)
        {
            // verify the required parameter 'person' is set
            if (person == null)
            {
                throw new ASW.APIServices.Core.Client.ApiException(400, "Missing required parameter 'person' when calling DefaultApi->RegisterWorker");
            }


            ASW.APIServices.Core.Client.RequestOptions localVarRequestOptions = new ASW.APIServices.Core.Client.RequestOptions();

            String[] _contentTypes = new String[] {
                "application/json"
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };

            foreach (var _contentType in _contentTypes)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType);
            }

            foreach (var _accept in _accepts)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
            }

            localVarRequestOptions.Data = person;

            // authentication (jwt) required
            // http basic authentication required
            if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password))
            {
                localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + ASW.APIServices.Core.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password));
            }

            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.PostAsync <WorkerRegistrationResponse>("/workers", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("RegisterWorker", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
Пример #9
0
        /// <summary>
        ///  Create a new Duty
        /// </summary>
        /// <exception cref="ASW.APIServices.Core.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="dutyDetails">Duty to be sent to agency</param>
        /// <returns>ApiResponse of string</returns>
        public ASW.APIServices.Core.Client.ApiResponse <string> CreateDutyWithHttpInfo(DutyDetails dutyDetails)
        {
            // verify the required parameter 'dutyDetails' is set
            if (dutyDetails == null)
            {
                throw new ASW.APIServices.Core.Client.ApiException(400, "Missing required parameter 'dutyDetails' when calling DutiesApi->CreateDuty");
            }

            ASW.APIServices.Core.Client.RequestOptions localVarRequestOptions = new ASW.APIServices.Core.Client.RequestOptions();

            String[] _contentTypes = new String[] {
                "application/json"
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "text/plain",
                "application/json"
            };

            var localVarContentType = ASW.APIServices.Core.Client.ClientUtils.SelectHeaderContentType(_contentTypes);

            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = ASW.APIServices.Core.Client.ClientUtils.SelectHeaderAccept(_accepts);

            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            localVarRequestOptions.Data = dutyDetails;


            // make the HTTP request
            var localVarResponse = this.Client.Post <string>("/duties", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("CreateDuty", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
Пример #10
0
        /// <summary>
        ///  Provide worker details for inclusion into the Allocate ecosystem. The platform will accept the worker information, and respond either synchronously or asynchronously with the allocate worker identifier. This may entail an on-boarding process, so the final response may require human interaction before it can be completed.
        /// </summary>
        /// <exception cref="ASW.APIServices.Core.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="person">Worker information</param>
        /// <returns>ApiResponse of WorkerRegistrationResponse</returns>
        public ASW.APIServices.Core.Client.ApiResponse <WorkerRegistrationResponse> RegisterWorkerWithHttpInfo(Person person)
        {
            // verify the required parameter 'person' is set
            if (person == null)
            {
                throw new ASW.APIServices.Core.Client.ApiException(400, "Missing required parameter 'person' when calling WorkersApi->RegisterWorker");
            }

            ASW.APIServices.Core.Client.RequestOptions localVarRequestOptions = new ASW.APIServices.Core.Client.RequestOptions();

            String[] _contentTypes = new String[] {
                "application/json"
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };

            var localVarContentType = ASW.APIServices.Core.Client.ClientUtils.SelectHeaderContentType(_contentTypes);

            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = ASW.APIServices.Core.Client.ClientUtils.SelectHeaderAccept(_accepts);

            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            localVarRequestOptions.Data = person;


            // make the HTTP request
            var localVarResponse = this.Client.Post <WorkerRegistrationResponse>("/workers", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("RegisterWorker", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
Пример #11
0
        /// <summary>
        ///  Create a new Duty
        /// </summary>
        /// <exception cref="ASW.APIServices.Core.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="dutyDetails">Duty to be sent to agency</param>
        /// <returns>Task of ApiResponse (string)</returns>
        public async System.Threading.Tasks.Task <ASW.APIServices.Core.Client.ApiResponse <string> > CreateDutyAsyncWithHttpInfo(DutyDetails dutyDetails)
        {
            // verify the required parameter 'dutyDetails' is set
            if (dutyDetails == null)
            {
                throw new ASW.APIServices.Core.Client.ApiException(400, "Missing required parameter 'dutyDetails' when calling DutiesApi->CreateDuty");
            }


            ASW.APIServices.Core.Client.RequestOptions localVarRequestOptions = new ASW.APIServices.Core.Client.RequestOptions();

            String[] _contentTypes = new String[] {
                "application/json"
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "text/plain",
                "application/json"
            };

            foreach (var _contentType in _contentTypes)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType);
            }

            foreach (var _accept in _accepts)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
            }

            localVarRequestOptions.Data = dutyDetails;


            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.PostAsync <string>("/duties", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("CreateDuty", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
Пример #12
0
        /// <summary>
        ///  Provide worker details for inclusion into the Allocate ecosystem. The platform will accept the worker information, and respond either synchronously or asynchronously with the allocate worker identifier. This may entail an on-boarding process, so the final response may require human interaction before it can be completed.
        /// </summary>
        /// <exception cref="ASW.APIServices.Core.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="person">Worker information</param>
        /// <returns>Task of ApiResponse (WorkerRegistrationResponse)</returns>
        public async System.Threading.Tasks.Task <ASW.APIServices.Core.Client.ApiResponse <WorkerRegistrationResponse> > RegisterWorkerAsyncWithHttpInfo(Person person)
        {
            // verify the required parameter 'person' is set
            if (person == null)
            {
                throw new ASW.APIServices.Core.Client.ApiException(400, "Missing required parameter 'person' when calling WorkersApi->RegisterWorker");
            }


            ASW.APIServices.Core.Client.RequestOptions localVarRequestOptions = new ASW.APIServices.Core.Client.RequestOptions();

            String[] _contentTypes = new String[] {
                "application/json"
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };

            foreach (var _contentType in _contentTypes)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType);
            }

            foreach (var _accept in _accepts)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
            }

            localVarRequestOptions.Data = person;


            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.PostAsync <WorkerRegistrationResponse>("/workers", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("RegisterWorker", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
Пример #13
0
        /// <summary>
        ///  Provide hours and assignment details for workers
        /// </summary>
        /// <exception cref="ASW.APIServices.Core.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="customerCode">The code for the customer (trust) for which the activities should be returned</param>
        /// <param name="format">Format for the output. TBD, but may be used to control the scope of information returned. (optional)</param>
        /// <returns>Task of ApiResponse (List&lt;HoursAssignment&gt;)</returns>
        public async System.Threading.Tasks.Task <ASW.APIServices.Core.Client.ApiResponse <List <HoursAssignment> > > GetActivitiesAsyncWithHttpInfo(string customerCode, string format = default(string))
        {
            // verify the required parameter 'customerCode' is set
            if (customerCode == null)
            {
                throw new ASW.APIServices.Core.Client.ApiException(400, "Missing required parameter 'customerCode' when calling DefaultApi->GetActivities");
            }


            ASW.APIServices.Core.Client.RequestOptions localVarRequestOptions = new ASW.APIServices.Core.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };

            foreach (var _contentType in _contentTypes)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType);
            }

            foreach (var _accept in _accepts)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
            }

            if (customerCode != null)
            {
                foreach (var _kvp in ASW.APIServices.Core.Client.ClientUtils.ParameterToMultiMap("", "customerCode", customerCode))
                {
                    foreach (var _kvpValue in _kvp.Value)
                    {
                        localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
                    }
                }
            }
            if (format != null)
            {
                foreach (var _kvp in ASW.APIServices.Core.Client.ClientUtils.ParameterToMultiMap("", "format", format))
                {
                    foreach (var _kvpValue in _kvp.Value)
                    {
                        localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
                    }
                }
            }

            // authentication (jwt) required
            // http basic authentication required
            if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password))
            {
                localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + ASW.APIServices.Core.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password));
            }

            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.GetAsync <List <HoursAssignment> >("/activities", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("GetActivities", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
Пример #14
0
        /// <summary>
        ///  Send timesheet information for a completed activity
        /// </summary>
        /// <exception cref="ASW.APIServices.Core.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="vacancyId">The ID of the vacancy</param>
        /// <param name="inlineObject"></param>
        /// <returns>Task of ApiResponse</returns>
        public async System.Threading.Tasks.Task <ASW.APIServices.Core.Client.ApiResponse <Object> > SubmitTimesheetAsyncWithHttpInfo(string vacancyId, InlineObject inlineObject)
        {
            // verify the required parameter 'vacancyId' is set
            if (vacancyId == null)
            {
                throw new ASW.APIServices.Core.Client.ApiException(400, "Missing required parameter 'vacancyId' when calling VacancyApi->SubmitTimesheet");
            }

            // verify the required parameter 'inlineObject' is set
            if (inlineObject == null)
            {
                throw new ASW.APIServices.Core.Client.ApiException(400, "Missing required parameter 'inlineObject' when calling VacancyApi->SubmitTimesheet");
            }


            ASW.APIServices.Core.Client.RequestOptions localVarRequestOptions = new ASW.APIServices.Core.Client.RequestOptions();

            String[] _contentTypes = new String[] {
                "application/json"
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
            };

            foreach (var _contentType in _contentTypes)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType);
            }

            foreach (var _accept in _accepts)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
            }

            if (vacancyId != null)
            {
                localVarRequestOptions.PathParameters.Add("vacancyId", ASW.APIServices.Core.Client.ClientUtils.ParameterToString(vacancyId)); // path parameter
            }
            localVarRequestOptions.Data = inlineObject;

            // authentication (jwt) required
            // http basic authentication required
            if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password))
            {
                localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + ASW.APIServices.Core.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password));
            }

            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.PostAsync <Object>("/vacancies/{vacancyId}/timesheet", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("SubmitTimesheet", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
Пример #15
0
        /// <summary>
        /// Get all events older than input timestamp Returns an array of events
        /// </summary>
        /// <exception cref="ASW.APIServices.Core.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="version">API version</param>
        /// <param name="trustCode">Trust code from BankStaff</param>
        /// <param name="dateTimeFrom">Timestamp</param>
        /// <param name="page">Result page (optional)</param>
        /// <param name="pageSize">Count of records per page (optional)</param>
        /// <returns>Task of ApiResponse (Duty)</returns>
        public async System.Threading.Tasks.Task <ASW.APIServices.Core.Client.ApiResponse <Duty> > GetEventsAsyncWithHttpInfo(string version, string trustCode, DateTime dateTimeFrom, int?page = default(int?), int?pageSize = default(int?))
        {
            // verify the required parameter 'version' is set
            if (version == null)
            {
                throw new ASW.APIServices.Core.Client.ApiException(400, "Missing required parameter 'version' when calling EventApi->GetEvents");
            }

            // verify the required parameter 'trustCode' is set
            if (trustCode == null)
            {
                throw new ASW.APIServices.Core.Client.ApiException(400, "Missing required parameter 'trustCode' when calling EventApi->GetEvents");
            }

            // verify the required parameter 'dateTimeFrom' is set
            if (dateTimeFrom == null)
            {
                throw new ASW.APIServices.Core.Client.ApiException(400, "Missing required parameter 'dateTimeFrom' when calling EventApi->GetEvents");
            }


            ASW.APIServices.Core.Client.RequestOptions localVarRequestOptions = new ASW.APIServices.Core.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json",
                "text/plain"
            };

            foreach (var _contentType in _contentTypes)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType);
            }

            foreach (var _accept in _accepts)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
            }

            if (version != null)
            {
                localVarRequestOptions.PathParameters.Add("version", ASW.APIServices.Core.Client.ClientUtils.ParameterToString(version)); // path parameter
            }
            if (trustCode != null)
            {
                localVarRequestOptions.PathParameters.Add("trustCode", ASW.APIServices.Core.Client.ClientUtils.ParameterToString(trustCode)); // path parameter
            }
            if (dateTimeFrom != null)
            {
                foreach (var _kvp in ASW.APIServices.Core.Client.ClientUtils.ParameterToMultiMap("", "dateTimeFrom", dateTimeFrom))
                {
                    foreach (var _kvpValue in _kvp.Value)
                    {
                        localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
                    }
                }
            }
            if (page != null)
            {
                foreach (var _kvp in ASW.APIServices.Core.Client.ClientUtils.ParameterToMultiMap("", "page", page))
                {
                    foreach (var _kvpValue in _kvp.Value)
                    {
                        localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
                    }
                }
            }
            if (pageSize != null)
            {
                foreach (var _kvp in ASW.APIServices.Core.Client.ClientUtils.ParameterToMultiMap("", "pageSize", pageSize))
                {
                    foreach (var _kvpValue in _kvp.Value)
                    {
                        localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
                    }
                }
            }


            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.GetAsync <Duty>("/{version}/trustcode/{trustCode}/event", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("GetEvents", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }