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 }); }
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; }
public IOperation WithSession(BinderSession session) { session = _session; return this; }
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)) { }
public IOperation WithSession(BinderSession session) { session = _session; return(this); }
public GetFolderOperation(Site site, string folderPath, BinderSession session) : base(GetUrlFor(site,folderPath, session)) { }