Exemplo n.º 1
0
 public static Dat.V1.Dto.Bom.Response<AuthenticationInfo> Authenticate(string email_address, string password, string api_url, bool secured, Dat.V1.Utils.Enumerations.DataExchangeFormats format)
 {
     Dat.V1.Dto.Bom.RequestOptions options = new Dat.V1.Dto.Bom.RequestOptions()
     {
         AuthenticationToken = "",
         ApiUrl = api_url,
         Data = new Dat.V1.Dto.Membership.Authentication.Request()
         {
             Manifest = new Manifest()
             {
                 AuthenticationInfo = new AuthenticationInfo()
                 {
                     EmailAddress = email_address,
                     Password = password
                 }
             }
         },
         Asset = Constants.Asset,
         Service = Constants.Service,
         EndPoint = Constants.EndPoint,
         Method = Dat.V1.Utils.Enumerations.HttpVerbs.PUT,
         Secured = secured,
         RequestType = format,
         ResponseType = format
     };
     switch (format)
     {
         case Dat.V1.Utils.Enumerations.DataExchangeFormats.JSON:
             return Dat.V1.Utils.Serialization.JSON.Serializer.Deserialize<Dat.V1.Dto.Bom.Response<AuthenticationInfo>>(Dat.V1.Dto.Bom.Request.Send(options));
         default:
             throw new Dto.Bom.Exceptions.SerializationNotImplementedException("Format not supported.");
     };
 }
Exemplo n.º 2
0
 public static Dat.V1.Dto.Bom.Response<User> Create(User user, string authToken, string api_url, bool secured, Dat.V1.Utils.Enumerations.DataExchangeFormats format)
 {
     Dat.V1.Dto.Bom.RequestOptions options = new Dat.V1.Dto.Bom.RequestOptions()
     {
         AuthenticationToken = authToken,
         ApiUrl = api_url,
         Data = new Dat.V1.Dto.Membership.User.Request()
         {
             Manifest = new Manifest()
             {
                 User = user
             }
         },
         Secured = secured,
         Asset = Dat.V1.Dto.Membership.Constants.Asset,
         Service = Membership.Constants.Service,
         EndPoint = Constants.EndPoint,
         Method = Dat.V1.Utils.Enumerations.HttpVerbs.PUT,
         RequestType = format,
         ResponseType = format
     };
     switch (format)
     {
         case Dat.V1.Utils.Enumerations.DataExchangeFormats.JSON:
             return Dat.V1.Utils.Serialization.JSON.Serializer.Deserialize<Dat.V1.Dto.Bom.Response<User>>(Dat.V1.Dto.Bom.Request.Send(options));
         default:
             throw new Dto.Bom.Exceptions.SerializationNotImplementedException("Format not supported.");
     };
 }
Exemplo n.º 3
0
 public static Dat.V1.Dto.Bom.Response<User> Select_ByEmailAddress(string emailAddress, string authToken, bool secured, string api_url, Dat.V1.Utils.Enumerations.DataExchangeFormats format)
 {
     Dat.V1.Dto.Bom.RequestOptions options = new Dat.V1.Dto.Bom.RequestOptions()
     {
         AuthenticationToken = authToken,
         ApiUrl = api_url,
         Parameters = emailAddress,
         Asset = Dat.V1.Dto.Membership.Constants.Asset,
         Service = Membership.Constants.Service,
         EndPoint = Constants.EndPoint,
         Secured = secured,
         Method = Dat.V1.Utils.Enumerations.HttpVerbs.GET,
         RequestType = format,
         ResponseType = format
     };
     switch (format)
     {
         case Dat.V1.Utils.Enumerations.DataExchangeFormats.JSON:
             return Dat.V1.Utils.Serialization.JSON.Serializer.Deserialize<Dat.V1.Dto.Bom.Response<User>>(Dat.V1.Dto.Bom.Request.Send(options));
         default:
             throw new Dto.Bom.Exceptions.SerializationNotImplementedException("Format not supported.");
     };
 }