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>();
 }
        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;

        }
Exemple #4
0
 public IOperation WithSession(BinderSession session)
 {
     session = _session;
     return this;
 }
Exemple #5
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))
 {
 }