Exemple #1
0
 public Region(BinderEcosystem ecosystem, string regionId, BinderSession session)
 {
     _ecosystem = ecosystem;
     _regionModel = new GetRegionOperation(ecosystem, regionId).ResponseMessage.Content<RegionModel>();
     _session = session;
     var currentRegionUrl = _regionModel.Endpoint.AppendPathSegment("CurrentRegion").SetQueryParam("api_key",session.SessionToken);
     _currentRegionModel = new GetOperation(currentRegionUrl).ResponseMessage.Content<CurrentRegionModel>();
 }
 public CreateFolderOperation(Site site, string folderPath, BinderSession session, string newFolderName)
     : base(GetUrlFor(site, folderPath, session))
 {
     WithRequest(new CreateFolderRequest()
     {
         FolderName = newFolderName
     });
 }
Exemple #3
0
        public Region(BinderEcosystem ecosystem, string regionId, BinderSession session)
        {
            _ecosystem   = ecosystem;
            _regionModel = new GetRegionOperation(ecosystem, regionId).ResponseMessage.Content <RegionModel>();
            _session     = session;
            var currentRegionUrl = _regionModel.Endpoint.AppendPathSegment("CurrentRegion").SetQueryParam("api_key", session.SessionToken);

            _currentRegionModel = new GetOperation(currentRegionUrl).ResponseMessage.Content <CurrentRegionModel>();
        }
        private Site GetAuthorisedSite()
        {
            var authenticationEndpoint = _binderEcosystem.AuthenticationEndpoint;
            AuthorisedSession = authenticationEndpoint.CreateSession(this.username, this.password);
            if (AuthorisedSession == null)
            {
                throw new ApplicationException("Unable to login");
            }

            var region = new Region(_binderEcosystem, "au", AuthorisedSession);
            return region.GetSite(this.Subdomain);
        }
        private static string GetUrlFor(Site site, string folderPath, BinderSession session)
        {
            var url =
                site.Region.EndpointUrl.AppendPathSegment("SiteNavigator")
                .AppendPathSegment(site.Subdomain)
                .AppendPathSegment("Folder")
                .SetQueryParam("path", folderPath)
                .SetQueryParam("api_key", session.SessionToken);



            return(url);
        }
        private static string GetUrlFor(Site site, string folderPath, BinderSession session)
        {

            var url =
                site.Region.EndpointUrl.AppendPathSegment("SiteNavigator")
                    .AppendPathSegment(site.Subdomain)
                    .AppendPathSegment("Folder")
                    .SetQueryParam("path", folderPath)
                    .SetQueryParam("api_key", session.SessionToken);



            return url;

        }
Exemple #7
0
 public IOperation WithSession(BinderSession session)
 {
     session = _session;
     return this;
 }
Exemple #8
0
 public Site(Region region, string subdomain, BinderSession session)
 {
     _region    = region;
     _subdomain = subdomain;
     _session   = session;
 }
Exemple #9
0
 public Site(Region region, string subdomain, BinderSession session)
 {
     _region = region;
     _subdomain = subdomain;
     _session = session;
 }
 public GetFolderOperation(Site site, string folderPath, BinderSession session) : base(GetUrlFor(site, folderPath, session))
 {
 }
Exemple #11
0
 public IOperation WithSession(BinderSession session)
 {
     session = _session;
     return(this);
 }
 public GetFolderOperation(Site site, string folderPath, BinderSession session) : base(GetUrlFor(site,folderPath, session))
 {
 }