Example #1
0
        /// <summary>
        /// Updates welcome regulation rule.
        /// </summary>
        /// <param name="model">The model what describe a welcome regulation rule.</param>
        /// <returns></returns>
        /// <exception cref="ErrorResponseException">Thrown if an error response received from service.</exception>
        public async Task UpdateWelcomeRegulationRuleAsync(WelcomeRegulationRuleModel model)
        {
            ErrorResponse errorResponse =
                await _service.UpdateWelcomeRegulationRuleAsync(new AutorestClient.Models.WelcomeRegulationRuleModel
            {
                Id           = model.Id,
                Name         = model.Name,
                RegulationId = model.RegulationId,
                Countries    = model.Countries,
                Active       = model.Active,
                Priority     = model.Priority
            });

            if (errorResponse != null)
            {
                throw new ErrorResponseException(errorResponse.ErrorMessage);
            }
        }
Example #2
0
        /// <summary>
        /// Adds the welcome regulation rule.
        /// </summary>
        /// <param name="model">The model what describe a welcome regulation rule.</param>
        /// <returns></returns>
        /// <exception cref="ErrorResponseException">Thrown if an error response received from service.</exception>
        public async Task AddWelcomeRegulationRuleAsync(WelcomeRegulationRuleModel model)
        {
            ErrorResponse errorResponse =
                await _service.AddWelcomeRegulationRuleAsync(
                    new NewWelcomeRegulationRuleModel
            {
                Name         = model.Name,
                RegulationId = model.RegulationId,
                Countries    = model.Countries,
                Active       = model.Active,
                Priority     = model.Priority
            });

            if (errorResponse != null)
            {
                throw new ErrorResponseException(errorResponse.ErrorMessage);
            }
        }