/// <summary>
        /// Constructor method for creating <see cref="ServerCallerParameters"/> with <paramref name="baseServerUrl"/> and <paramref name="canal"/>.
        /// </summary>
        ///
        /// <param name="baseServerUrl">The Base Server URL.</param>
        /// <param name="canal">The <see cref="Canal"/>.</param>
        public ServerCallerParameters(string baseServerUrl, Canal canal)
        {
            if (canal == null)
            {
                LOGGER.ErrorFormat(string.Format(Constants.CANNOT_BE_NULL_ERROR_MESSAGE_FORMAT, ObjectMetadata.GetMemberName(() => canal)));

                throw new ArgumentException(string.Format(Constants.CANNOT_BE_NULL_ERROR_MESSAGE_FORMAT, ObjectMetadata.GetMemberName(() => canal)));
            }

            BaseServerUrl = new BaseServerUrl(baseServerUrl);

            Canal = canal;

            AccessToken = new AccessToken();
        }
Beispiel #2
0
        /// <summary>
        /// Constructor method for creating <see cref="RestCallerParameters"/> with <paramref name="serverCaller"/>, <paramref name="baseServerUrl"/>, <paramref name="accessToken"/> and <paramref name="canal"/>.
        /// </summary>
        ///
        /// <param name="serverCaller">The <see cref="ServerCaller"/>.</param>
        /// <param name="baseServerUrl">The <see cref="BaseServerUrl"/>.</param>
        /// <param name="accessToken">The <see cref="AccessToken"/>.</param>
        /// <param name="canal">The <see cref="Canal"/>.</param>
        public RestCallerParameters(ServerCaller serverCaller, BaseServerUrl baseServerUrl, AccessToken accessToken, Canal canal)
        {
            if (serverCaller == null)
            {
                LOGGER.ErrorFormat(string.Format(Constants.CANNOT_BE_NULL_ERROR_MESSAGE_FORMAT, ObjectMetadata.GetMemberName(() => serverCaller)));

                throw new ArgumentException(string.Format(Constants.CANNOT_BE_NULL_ERROR_MESSAGE_FORMAT, ObjectMetadata.GetMemberName(() => serverCaller)));
            }

            if (baseServerUrl == null)
            {
                LOGGER.ErrorFormat(string.Format(Constants.CANNOT_BE_NULL_ERROR_MESSAGE_FORMAT, ObjectMetadata.GetMemberName(() => baseServerUrl)));

                throw new ArgumentException(string.Format(Constants.CANNOT_BE_NULL_ERROR_MESSAGE_FORMAT, ObjectMetadata.GetMemberName(() => baseServerUrl)));
            }

            if (accessToken == null)
            {
                LOGGER.ErrorFormat(string.Format(Constants.CANNOT_BE_NULL_ERROR_MESSAGE_FORMAT, ObjectMetadata.GetMemberName(() => accessToken)));

                throw new ArgumentException(string.Format(Constants.CANNOT_BE_NULL_ERROR_MESSAGE_FORMAT, ObjectMetadata.GetMemberName(() => accessToken)));
            }

            if (canal == null)
            {
                LOGGER.ErrorFormat(string.Format(Constants.CANNOT_BE_NULL_ERROR_MESSAGE_FORMAT, ObjectMetadata.GetMemberName(() => canal)));

                throw new ArgumentException(string.Format(Constants.CANNOT_BE_NULL_ERROR_MESSAGE_FORMAT, ObjectMetadata.GetMemberName(() => canal)));
            }

            ServerCaller = serverCaller;

            BaseServerUrl = baseServerUrl;

            AccessToken = accessToken;

            Canal = canal;
        }