Пример #1
0
 public static DomainRequest Create(Domain domain)
 {
     return new DomainRequest()
     {
         Domain = domain
     };
 }
Пример #2
0
        public static AuthRequest Create(string domain, string username, string password, Domain scopeDomain, Project scopeProject)
        {
            Scope scope = null;

            if (scopeDomain != null || scopeProject != null)
            {
                scope = new Scope()
                {
                    Domain = scopeDomain,
                    Project = scopeProject,
                };
            }

            return new AuthRequest()
            {
                Auth = new Auth()
                {
                    Identity = new Identity()
                    {
                        Methods = new[] { "password" },
                        Password = new Password()
                        {
                            User = new User()
                            {
                                Domain = new Domain()
                                {
                                    Name = domain
                                },
                                Name = username,
                                Password = password
                            }
                        },
                    },
                    Scope = scope
                }
            };
        }
Пример #3
0
 public static RestMessage<DomainRequest> CreateMessage(Domain domain)
 {
     return new RestMessage<DomainRequest>(Create(domain));
 }
Пример #4
0
 public static RestMessage<AuthRequest> CreateMessage(string domain, string username, string password, Domain scopeDomain, Project scopeProject)
 {
     return new RestMessage<AuthRequest>(Create(domain, username, password, scopeDomain, scopeProject));
 }