Ejemplo n.º 1
0
        /// <summary>
        ///  Provision the supplied user.
        /// </summary>
        /// <exception cref="ASW.APIServices.VMS.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="id">ID of the user to provision</param>
        /// <param name="userProvision">Structure of the User</param>
        /// <returns>ApiResponse of Object(void)</returns>
        public ASW.APIServices.VMS.Client.ApiResponse <Object> ProvisionUserWithHttpInfo(string id, UserProvision userProvision)
        {
            // verify the required parameter 'id' is set
            if (id == null)
            {
                throw new ASW.APIServices.VMS.Client.ApiException(400, "Missing required parameter 'id' when calling ProvisioningApi->ProvisionUser");
            }

            // verify the required parameter 'userProvision' is set
            if (userProvision == null)
            {
                throw new ASW.APIServices.VMS.Client.ApiException(400, "Missing required parameter 'userProvision' when calling ProvisioningApi->ProvisionUser");
            }

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

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

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

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

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

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

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

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


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

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

            return(localVarResponse);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///  Provision the supplied structure.
        /// </summary>
        /// <exception cref="ASW.APIServices.VMS.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="id">ID of the customer to provision</param>
        /// <param name="structureProvision">Structure of the Customer (trust). This call should be considered a &#39;set&#39; - elements omitted that were present in previous provisionings should be removed.</param>
        /// <returns>Task of ApiResponse</returns>
        public async System.Threading.Tasks.Task <ASW.APIServices.VMS.Client.ApiResponse <Object> > ProvisionStructureAsyncWithHttpInfo(string id, StructureProvision structureProvision)
        {
            // verify the required parameter 'id' is set
            if (id == null)
            {
                throw new ASW.APIServices.VMS.Client.ApiException(400, "Missing required parameter 'id' when calling ProvisioningApi->ProvisionStructure");
            }

            // verify the required parameter 'structureProvision' is set
            if (structureProvision == null)
            {
                throw new ASW.APIServices.VMS.Client.ApiException(400, "Missing required parameter 'structureProvision' when calling ProvisioningApi->ProvisionStructure");
            }


            ASW.APIServices.VMS.Client.RequestOptions localVarRequestOptions = new ASW.APIServices.VMS.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 (id != null)
            {
                localVarRequestOptions.PathParameters.Add("id", ASW.APIServices.VMS.Client.ClientUtils.ParameterToString(id)); // path parameter
            }
            localVarRequestOptions.Data = structureProvision;


            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.PutAsync <Object>("/provision/customer/{id}", localVarRequestOptions, this.Configuration);

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

            return(localVarResponse);
        }
Ejemplo n.º 3
0
        /// <summary>
        ///  Query a duty booking by id
        /// </summary>
        /// <exception cref="ASW.APIServices.VMS.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="bookingId">ID of the duty booking</param>
        /// <returns>ApiResponse of DutyRequest</returns>
        public ASW.APIServices.VMS.Client.ApiResponse <DutyRequest> GetBookingWithHttpInfo(string bookingId)
        {
            // verify the required parameter 'bookingId' is set
            if (bookingId == null)
            {
                throw new ASW.APIServices.VMS.Client.ApiException(400, "Missing required parameter 'bookingId' when calling BookingsApi->GetBooking");
            }

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

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

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

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

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

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

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

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

            // make the HTTP request
            var localVarResponse = this.Client.Get <DutyRequest>("/bookings/{bookingId}", localVarRequestOptions, this.Configuration);

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

            return(localVarResponse);
        }
Ejemplo n.º 4
0
        /// <summary>
        ///  Forward a request for a duty to be filled by agency. Dependent upon the rules specified within the VMS, this will cascade to the appropriate agencies.
        /// </summary>
        /// <exception cref="ASW.APIServices.VMS.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="dutyRequest">Duty to be sent to agency</param>
        /// <returns>ApiResponse of string</returns>
        public ASW.APIServices.VMS.Client.ApiResponse <string> SendDutyToAgenciesWithHttpInfo(DutyRequest dutyRequest)
        {
            // verify the required parameter 'dutyRequest' is set
            if (dutyRequest == null)
            {
                throw new ASW.APIServices.VMS.Client.ApiException(400, "Missing required parameter 'dutyRequest' when calling AgenciesApi->SendDutyToAgencies");
            }

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

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

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

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

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

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

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

            localVarRequestOptions.Data = dutyRequest;

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

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

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

            return(localVarResponse);
        }
Ejemplo n.º 5
0
        /// <summary>
        ///  Get the details of a person (worker) from the VMS
        /// </summary>
        /// <exception cref="ASW.APIServices.VMS.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="id">ID of the worker within the VMS.</param>
        /// <returns>Task of ApiResponse (Person)</returns>
        public async System.Threading.Tasks.Task <ASW.APIServices.VMS.Client.ApiResponse <Person> > GetWorkerAsyncWithHttpInfo(string id)
        {
            // verify the required parameter 'id' is set
            if (id == null)
            {
                throw new ASW.APIServices.VMS.Client.ApiException(400, "Missing required parameter 'id' when calling WorkersApi->GetWorker");
            }


            ASW.APIServices.VMS.Client.RequestOptions localVarRequestOptions = new ASW.APIServices.VMS.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.VMS.Client.ClientUtils.ParameterToString(id)); // path parameter
            }
            // authentication (bearerAuth) required
            // http basic authentication required
            if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password))
            {
                localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + ASW.APIServices.VMS.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password));
            }

            // make the HTTP request

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

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

            return(localVarResponse);
        }
Ejemplo n.º 6
0
        /// <summary>
        ///  Returns a list of agencies and their costs for the supplied duty.
        /// </summary>
        /// <exception cref="ASW.APIServices.VMS.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="duty">Duty to be costed</param>
        /// <returns>Task of ApiResponse (AgencyCostings)</returns>
        public async System.Threading.Tasks.Task <ASW.APIServices.VMS.Client.ApiResponse <AgencyCostings> > GetCostingsAsyncWithHttpInfo(Duty duty)
        {
            // verify the required parameter 'duty' is set
            if (duty == null)
            {
                throw new ASW.APIServices.VMS.Client.ApiException(400, "Missing required parameter 'duty' when calling AgenciesApi->GetCostings");
            }


            ASW.APIServices.VMS.Client.RequestOptions localVarRequestOptions = new ASW.APIServices.VMS.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 = duty;

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

            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.PostAsync <AgencyCostings>("/agencies/costings", localVarRequestOptions, this.Configuration);

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

            return(localVarResponse);
        }
Ejemplo n.º 7
0
        /// <summary>
        ///  Accept an agency offer for a worker.
        /// </summary>
        /// <exception cref="ASW.APIServices.VMS.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="bookingRequestId">ID of the booking request to accept.</param>
        /// <param name="offerId">ID of the offer to accept. Depending on the VMS, this may be a unique ID, an index to locate an agency, or the agency ID itself.</param>
        /// <returns>Task of ApiResponse (string)</returns>
        public async System.Threading.Tasks.Task <ASW.APIServices.VMS.Client.ApiResponse <string> > AcceptAgencyOfferAsyncWithHttpInfo(string bookingRequestId, string offerId)
        {
            // verify the required parameter 'bookingRequestId' is set
            if (bookingRequestId == null)
            {
                throw new ASW.APIServices.VMS.Client.ApiException(400, "Missing required parameter 'bookingRequestId' when calling BookingsApi->AcceptAgencyOffer");
            }

            // verify the required parameter 'offerId' is set
            if (offerId == null)
            {
                throw new ASW.APIServices.VMS.Client.ApiException(400, "Missing required parameter 'offerId' when calling BookingsApi->AcceptAgencyOffer");
            }


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

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

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

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

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

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

            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.PutAsync <string>("/bookingRequests/{bookingRequestId}/offers/{offerId}/accept", localVarRequestOptions, this.Configuration);

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

            return(localVarResponse);
        }