示例#1
0
        public WitModel(string authToken, WitApiVersionType apiVersionType = WitApiVersionType.Latest, string apiVersion = null)
        {
            _apiVersion = apiVersionType == WitApiVersionType.Latest ? WitApiVersion.Latest : WitApiVersion.Custom(apiVersion);

            SetField.NotNull(out _authToken, nameof(authToken), authToken);
            SetField.NotNull(out _uriBase, nameof(_uriBase), BuildUri());
        }
示例#2
0
 /// <summary>
 /// Construct the Wit model information.
 /// </summary>
 /// <param name="authToken">The Wit model authorization token.</param>
 /// <param name="apiVersion">The wit API version.</param>
 public WitModelAttribute(string authToken, WitApiVersion apiVersion = WitApiVersion.Standard)
 {
     SetField.NotNull(out this.authToken, nameof(authToken), authToken);
     this.apiVersion = apiVersion;
     SetField.NotNull(out this.uriBase, nameof(uriBase), WitEndpoints[this.apiVersion]);
 }