static void Main(string[] args) { var token = GroupShareClient.GetRequestToken( "", "", new Uri("http://gs2017dev.sdl.com"), GroupShareClient.AllScopes).Result; var groupShareClient = GroupShareClient.AuthenticateClient( token, "", "", new Uri("http://gs2017dev.sdl.com"), GroupShareClient.AllScopes).Result; for (var i = 0; i < 200; i++) { var organization = new Organization { UniqueId = Guid.NewGuid(), Name = $"NewCreatedOrg{i}", IsLibrary = true, Description = null, Path = null, ParentOrganizationId = new Guid("5bdb10b8-e3a9-41ae-9e66-c154347b8d17"), ChildOrganizations = null, Tags = new List <string> { "tagTest" } }; var organizationId = groupShareClient.Organization.Create(organization).Result; groupShareClient.Organization.DeleteOrganization(organizationId); } }
public async Task <GroupShareClient> Login(string userName, string password, string uri) { var client = await GroupShareClient.AuthenticateClient(userName, password, new Uri(uri), GroupShareClient.AllScopes); return(client); }
public static async Task <ServerBasedTranslationMemoryGSKit> CreateAsync(string userName, string password, string uri) { var sbTMGSKit = new ServerBasedTranslationMemoryGSKit(); var token = await GroupShareClient.GetRequestToken(userName, password, new Uri(uri), GroupShareClient.AllScopes); var groupShareClient = await GroupShareClient.AuthenticateClient(token, userName, password, new Uri(uri), GroupShareClient.AllScopes); var tmClient = await groupShareClient.TranslationMemories.GetTms(); sbTMGSKit.GroupShareClient = groupShareClient; sbTMGSKit.ServerBasedTMDetails = new BindingList <TranslationMemoryDetails>(tmClient.Items); return(sbTMGSKit); }
static void Main(string[] args) { var token = GroupShareClient.GetRequestToken( "username", "pass", new Uri("url"), GroupShareClient.AllScopes).Result; var gsClient = GroupShareClient.AuthenticateClient( token, "username", "pass", new Uri("url"), GroupShareClient.AllScopes).Result; var termbases = gsClient.Terminology.GetTermbaseById("GermanCharacters").Result; }
public static async Task <IGroupShareClient> GetGroupShareClient() { var groupShareUser = Helper.GetVariable("GROUPSHAREKIT_USERNAME"); var groupSharePassword = Helper.GetVariable("GROUPSHAREKIT_PASSWORD"); var token = await GroupShareClient.GetRequestToken(groupShareUser, groupSharePassword, BaseUri, GroupShareClient.AllScopes); var gsClient = await GroupShareClient.AuthenticateClient(token, groupShareUser, groupSharePassword, BaseUri, GroupShareClient.AllScopes); return(gsClient); }
static void Main(string[] args) { var token = GroupShareClient.GetRequestToken( "", "", new Uri("http://gs2017dev.sdl.com"), GroupShareClient.AllScopes).Result; var gsClient = GroupShareClient.AuthenticateClient( token, "", "", new Uri("http://gs2017dev.sdl.com"), GroupShareClient.AllScopes).Result; var contepts = gsClient.Terminology.GetConcept(new ConceptResponse("GermanCharacters", "1")).Result; //var projectRequest = new ProjectsRequest("/Test API",true, 1) { Filter = { ProjectName = "a" } }; //var result = gsClient.Project.GetProject(projectRequest).Result; }
static Helper() { var token = GroupShareClient.GetRequestToken( GsUser, GsPassword, BaseUri, GroupShareClient.AllScopes).Result; GsClient = GroupShareClient.AuthenticateClient( token, GsUser, GsPassword, "", BaseUri, GroupShareClient.AllScopes).Result; GsUserId = GsClient.User.Get(new UserRequest(GsUser)).Result.UniqueId; var sanitizedOrganizationName = Organization.Trim('/'); var organization = GsClient .Organization .GetAll(new OrganizationRequest(true)).Result .FirstOrDefault(o => o.Name == sanitizedOrganizationName); if (organization != null) { OrganizationId = organization.UniqueId.ToString(); OrganizationTag = organization.Tags.FirstOrDefault(); } var role = GsClient .Role .GetAllRoles().Result .FirstOrDefault(r => r.Name == "Power User"); if (role != null) { PowerUserRoleId = role.UniqueId.ToString(); } }