/// <summary> /// Edits a robot based on its key. /// </summary> /// <remarks> /// Client Credentials Flow required permissions: Robots or Robots.Write. /// /// Required permissions: Robots.Edit. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='key'> /// </param> /// <param name='body'> /// </param> /// <param name='xUIPATHOrganizationUnitId'> /// Folder/OrganizationUnit Id /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <RobotDto> PutByIdAsync(this IRobots operations, long key, RobotDto body = default(RobotDto), long?xUIPATHOrganizationUnitId = default(long?), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.PutByIdWithHttpMessagesAsync(key, body, xUIPATHOrganizationUnitId, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Gets robots. /// </summary> /// <remarks> /// Required permissions: Robots.View. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='expand'> /// Expands related entities inline. /// </param> /// <param name='filter'> /// Filters the results, based on a Boolean condition. /// </param> /// <param name='select'> /// Selects which properties to include in the response. /// </param> /// <param name='orderby'> /// Sorts the results. /// </param> /// <param name='top'> /// Returns only the first n results. /// </param> /// <param name='skip'> /// Skips the first n results. /// </param> /// <param name='count'> /// Includes a count of the matching results in the response. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <ODataResponseListRobotDto> GetRobotsAsync(this IRobots operations, string expand = default(string), string filter = default(string), string select = default(string), string orderby = default(string), int?top = default(int?), int?skip = default(int?), bool?count = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.GetRobotsWithHttpMessagesAsync(expand, filter, select, orderby, top, skip, count, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Gets a single robot based on its key. /// </summary> /// <remarks> /// Required permissions: Robots.View. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='id'> /// key: Id /// </param> /// <param name='expand'> /// Expands related entities inline. /// </param> /// <param name='select'> /// Selects which properties to include in the response. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <RobotDto> GetByIdAsync(this IRobots operations, long id, string expand = default(string), string select = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.GetByIdWithHttpMessagesAsync(id, expand, select, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Creates a new robot. /// </summary> /// <remarks> /// Required permissions: (Robots.Create - Floating Robot) and (Robots.Create /// and Machines.View - Standard Robot). /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='robotDto'> /// </param> /// <param name='xUIPATHOrganizationUnitId'> /// Folder/OrganizationUnit Id /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <RobotDto> PostAsync(this IRobots operations, RobotDto robotDto, long?xUIPATHOrganizationUnitId = default(long?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.PostWithHttpMessagesAsync(robotDto, xUIPATHOrganizationUnitId, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Edits a robot based on its key. /// </summary> /// <remarks> /// Required permissions: Robots.Edit. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='id'> /// key: Id /// </param> /// <param name='robotDto'> /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <RobotDto> PutByIdAsync(this IRobots operations, long id, RobotDto robotDto, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.PutByIdWithHttpMessagesAsync(id, robotDto, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Gets robots. /// </summary> /// <remarks> /// Client Credentials Flow required permissions: Robots or Robots.Read. /// /// Required permissions: Robots.View. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='expand'> /// Expands related entities inline. /// </param> /// <param name='filter'> /// Filters the results, based on a Boolean condition. /// </param> /// <param name='select'> /// Selects which properties to include in the response. /// </param> /// <param name='orderby'> /// Sorts the results. /// </param> /// <param name='top'> /// Returns only the first n results. /// </param> /// <param name='skip'> /// Skips the first n results. /// </param> /// <param name='count'> /// Includes a count of the matching results in the response. /// </param> /// <param name='xUIPATHOrganizationUnitId'> /// Folder/OrganizationUnit Id /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <ODataValueIEnumerableRobotDto> GetAsync(this IRobots operations, string expand = default(string), string filter = default(string), string select = default(string), string orderby = default(string), int?top = default(int?), int?skip = default(int?), bool?count = default(bool?), long?xUIPATHOrganizationUnitId = default(long?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(expand, filter, select, orderby, top, skip, count, xUIPATHOrganizationUnitId, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Gets a single robot based on its key. /// </summary> /// <remarks> /// Client Credentials Flow required permissions: Robots or Robots.Read. /// /// Required permissions: Robots.View. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='key'> /// </param> /// <param name='expand'> /// Indicates the related entities to be represented inline. The maximum depth /// is 2. /// </param> /// <param name='select'> /// Limits the properties returned in the result. /// </param> /// <param name='xUIPATHOrganizationUnitId'> /// Folder/OrganizationUnit Id /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <RobotDto> GetByIdAsync(this IRobots operations, long key, string expand = default(string), string select = default(string), long?xUIPATHOrganizationUnitId = default(long?), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetByIdWithHttpMessagesAsync(key, expand, select, xUIPATHOrganizationUnitId, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Fire robots txt parsed completed async /// </summary> /// <param name="robots"></param> protected virtual void FireRobotsDotTextParseCompletedAsync(IRobots robots) { var threadSafeEvent = RobotsDotTextParseCompletedAsync; if (threadSafeEvent == null) { return; } //Fire each subscribers delegate async foreach (var @delegate in threadSafeEvent.GetInvocationList()) { var del = (EventHandler <RobotsDotTextParseCompletedArgs>)@delegate; del.BeginInvoke(this, new RobotsDotTextParseCompletedArgs(_crawlContext, robots), null, null); } }
/// <summary> /// Fire robots txt parsed completed /// </summary> /// <param name="robots"></param> protected virtual void FireRobotsDotTextParseCompleted(IRobots robots) { try { if (RobotsDotTextParseCompleted == null) { return; } RobotsDotTextParseCompleted.Invoke(this, new RobotsDotTextParseCompletedArgs(_crawlContext, robots)); } catch (Exception e) { _logger.LogError("An unhandled exception was thrown by a subscriber of the PageLinksCrawlDisallowed event for robots.txt", e); } }
/// <summary> /// Partially updates a robot. /// </summary> /// <remarks> /// Required permissions: Robots.Edit. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='id'> /// key: Id /// </param> /// <param name='robotDto'> /// The entity to patch /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task PatchByIdAsync(this IRobots operations, long id, RobotDto robotDto, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { (await operations.PatchByIdWithHttpMessagesAsync(id, robotDto, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Partially updates a robot. /// </summary> /// <remarks> /// Required permissions: Robots.Edit. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='id'> /// key: Id /// </param> /// <param name='robotDto'> /// The entity to patch /// </param> public static void PatchById(this IRobots operations, long id, RobotDto robotDto) { operations.PatchByIdAsync(id, robotDto).GetAwaiter().GetResult(); }
/// <summary> /// Deletes a robot based on its key. /// </summary> /// <remarks> /// Required permissions: Robots.Delete. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='id'> /// key: Id /// </param> /// <param name='ifMatch'> /// If-Match header /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task DeleteByIdAsync(this IRobots operations, long id, string ifMatch = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { (await operations.DeleteByIdWithHttpMessagesAsync(id, ifMatch, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Deletes a robot based on its key. /// </summary> /// <remarks> /// Required permissions: Robots.Delete. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='id'> /// key: Id /// </param> /// <param name='ifMatch'> /// If-Match header /// </param> public static void DeleteById(this IRobots operations, long id, string ifMatch = default(string)) { operations.DeleteByIdAsync(id, ifMatch).GetAwaiter().GetResult(); }
/// <summary> /// Returns a collection of all robots that can execute the process with the /// provided Id. /// </summary> /// <remarks> /// Required permissions: Robots.View and Environments.View and Processes.View. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='processId'> /// The Id of the process for which the robots are fetched. /// </param> /// <param name='xUIPATHOrganizationUnitId'> /// Folder/OrganizationUnit Id /// </param> /// <param name='expand'> /// Expands related entities inline. /// </param> /// <param name='filter'> /// Filters the results, based on a Boolean condition. /// </param> /// <param name='select'> /// Selects which properties to include in the response. /// </param> /// <param name='orderby'> /// Sorts the results. /// </param> /// <param name='top'> /// Returns only the first n results. /// </param> /// <param name='skip'> /// Skips the first n results. /// </param> /// <param name='count'> /// Includes a count of the matching results in the odata-count header. /// </param> public static ODataResponseListRobotDto GetRobotsForProcessByProcessid(this IRobots operations, string processId, long?xUIPATHOrganizationUnitId = default(long?), string expand = default(string), string filter = default(string), string select = default(string), string orderby = default(string), int?top = default(int?), int?skip = default(int?), bool?count = default(bool?)) { return(operations.GetRobotsForProcessByProcessidAsync(processId, xUIPATHOrganizationUnitId, expand, filter, select, orderby, top, skip, count).GetAwaiter().GetResult()); }
/// <summary> /// Deletes multiple robots based on their keys. /// </summary> /// <remarks> /// Required permissions: Robots.Delete. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='robotsDeleteBulk'> /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task DeleteBulkAsync(this IRobots operations, RobotsDeleteBulk robotsDeleteBulk, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { (await operations.DeleteBulkWithHttpMessagesAsync(robotsDeleteBulk, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Gets robots. /// </summary> /// <remarks> /// Required permissions: Robots.View. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='expand'> /// Expands related entities inline. /// </param> /// <param name='filter'> /// Filters the results, based on a Boolean condition. /// </param> /// <param name='select'> /// Selects which properties to include in the response. /// </param> /// <param name='orderby'> /// Sorts the results. /// </param> /// <param name='top'> /// Returns only the first n results. /// </param> /// <param name='skip'> /// Skips the first n results. /// </param> /// <param name='count'> /// Includes a count of the matching results in the response. /// </param> public static ODataResponseListRobotDto GetRobots(this IRobots operations, string expand = default(string), string filter = default(string), string select = default(string), string orderby = default(string), int?top = default(int?), int?skip = default(int?), bool?count = default(bool?)) { return(operations.GetRobotsAsync(expand, filter, select, orderby, top, skip, count).GetAwaiter().GetResult()); }
/// <summary> /// Convert a Standard Attended Robot to a Floating Robot. /// </summary> /// <remarks> /// Required permissions: Robots.Edit. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='convertToFloatingParams'> /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task ConvertToFloatingAsync(this IRobots operations, ConvertToFloatingParams convertToFloatingParams, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { (await operations.ConvertToFloatingWithHttpMessagesAsync(convertToFloatingParams, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Creates a new robot. /// </summary> /// <remarks> /// Required permissions: (Robots.Create - Floating Robot) and (Robots.Create /// and Machines.View - Standard Robot). /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='robotDto'> /// </param> public static RobotDto Post(this IRobots operations, RobotDto robotDto) { return(operations.PostAsync(robotDto).GetAwaiter().GetResult()); }
/// <summary> /// Contructor to be used to create an object which will path arugments when robots txt is parsed /// </summary> public RobotsDotTextParseCompletedArgs(CrawlContext crawlContext, IRobots robots) : base(crawlContext) { Robots = robots; }
private void Load(Uri rootUri, string content) { _robotsDotTextUtil = new Robots.Robots(); _robotsDotTextUtil.LoadContent(content, rootUri.AbsoluteUri); }
/// <summary> /// Convert a Standard Attended Robot to a Floating Robot. /// </summary> /// <remarks> /// Required permissions: Robots.Edit. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='convertToFloatingParams'> /// </param> /// <param name='xUIPATHOrganizationUnitId'> /// Folder/OrganizationUnit Id /// </param> public static void ConvertToFloating(this IRobots operations, ConvertToFloatingParams convertToFloatingParams, long?xUIPATHOrganizationUnitId = default(long?)) { operations.ConvertToFloatingAsync(convertToFloatingParams, xUIPATHOrganizationUnitId).GetAwaiter().GetResult(); }
/// <summary> /// Deletes multiple robots based on their keys. /// </summary> /// <remarks> /// Required permissions: Robots.Delete. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='robotsDeleteBulk'> /// </param> /// <param name='xUIPATHOrganizationUnitId'> /// Folder/OrganizationUnit Id /// </param> public static void DeleteBulk(this IRobots operations, RobotsDeleteBulk robotsDeleteBulk, long?xUIPATHOrganizationUnitId = default(long?)) { operations.DeleteBulkAsync(robotsDeleteBulk, xUIPATHOrganizationUnitId).GetAwaiter().GetResult(); }
/// <summary> /// Gets machine name to license key mapping. /// </summary> /// <remarks> /// Required permissions: Robots.Create and Machines.View. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> public static ODataResponseListKeyValuePairStringString GetMachineNameToLicenseKeyMappings(this IRobots operations) { return(operations.GetMachineNameToLicenseKeyMappingsAsync().GetAwaiter().GetResult()); }
/// <summary> /// Fire robots txt parsed completed async /// </summary> /// <param name="robots"></param> protected virtual void FireRobotsDotTextParseCompletedAsync(IRobots robots) { var threadSafeEvent = RobotsDotTextParseCompletedAsync; if (threadSafeEvent == null) return; //Fire each subscribers delegate async foreach (var @delegate in threadSafeEvent.GetInvocationList()) { var del = (EventHandler<RobotsDotTextParseCompletedArgs>) @delegate; del.BeginInvoke(this, new RobotsDotTextParseCompletedArgs(_crawlContext, robots), null, null); } }
/// <summary> /// Gets machine name to license key mapping. /// </summary> /// <remarks> /// Required permissions: Robots.Create and Machines.View. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <ODataResponseListKeyValuePairStringString> GetMachineNameToLicenseKeyMappingsAsync(this IRobots operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.GetMachineNameToLicenseKeyMappingsWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Edits a robot based on its key. /// </summary> /// <remarks> /// Required permissions: Robots.Edit. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='id'> /// key: Id /// </param> /// <param name='robotDto'> /// </param> public static RobotDto PutById(this IRobots operations, long id, RobotDto robotDto) { return(operations.PutByIdAsync(id, robotDto).GetAwaiter().GetResult()); }
/// <summary> /// Deletes multiple robots based on their keys. /// </summary> /// <remarks> /// Required permissions: Robots.Delete. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='robotsDeleteBulk'> /// </param> public static void DeleteBulk(this IRobots operations, RobotsDeleteBulk robotsDeleteBulk) { operations.DeleteBulkAsync(robotsDeleteBulk).GetAwaiter().GetResult(); }
/// <summary> /// Gets machine name to license key mapping. /// </summary> /// <remarks> /// Required permissions: Robots.Create and Machines.View. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='xUIPATHOrganizationUnitId'> /// Folder/OrganizationUnit Id /// </param> public static ODataResponseListKeyValuePairStringString GetMachineNameToLicenseKeyMappings(this IRobots operations, long?xUIPATHOrganizationUnitId = default(long?)) { return(operations.GetMachineNameToLicenseKeyMappingsAsync(xUIPATHOrganizationUnitId).GetAwaiter().GetResult()); }
/// <summary> /// Convert a Standard Attended Robot to a Floating Robot. /// </summary> /// <remarks> /// Required permissions: Robots.Edit. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='convertToFloatingParams'> /// </param> public static void ConvertToFloating(this IRobots operations, ConvertToFloatingParams convertToFloatingParams) { operations.ConvertToFloatingAsync(convertToFloatingParams).GetAwaiter().GetResult(); }
/// <summary> /// Gets usernames. /// </summary> /// <remarks> /// Required permissions: Robots.View. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='xUIPATHOrganizationUnitId'> /// Folder/OrganizationUnit Id /// </param> /// <param name='expand'> /// Expands related entities inline. /// </param> /// <param name='filter'> /// Filters the results, based on a Boolean condition. /// </param> /// <param name='select'> /// Selects which properties to include in the response. /// </param> /// <param name='orderby'> /// Sorts the results. /// </param> /// <param name='top'> /// Returns only the first n results. /// </param> /// <param name='skip'> /// Skips the first n results. /// </param> /// <param name='count'> /// Includes a count of the matching results in the odata-count header. /// </param> public static ODataResponseListString GetUsernames(this IRobots operations, long?xUIPATHOrganizationUnitId = default(long?), string expand = default(string), string filter = default(string), string select = default(string), string orderby = default(string), int?top = default(int?), int?skip = default(int?), bool?count = default(bool?)) { return(operations.GetUsernamesAsync(xUIPATHOrganizationUnitId, expand, filter, select, orderby, top, skip, count).GetAwaiter().GetResult()); }
/// <summary> /// Gets a single robot based on its key. /// </summary> /// <remarks> /// Required permissions: Robots.View. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='id'> /// key: Id /// </param> /// <param name='expand'> /// Expands related entities inline. /// </param> /// <param name='select'> /// Selects which properties to include in the response. /// </param> public static RobotDto GetById(this IRobots operations, long id, string expand = default(string), string select = default(string)) { return(operations.GetByIdAsync(id, expand, select).GetAwaiter().GetResult()); }
/// <summary> /// Fire robots txt parsed completed /// </summary> /// <param name="robots"></param> protected virtual void FireRobotsDotTextParseCompleted(IRobots robots) { try { if (RobotsDotTextParseCompleted == null) return; RobotsDotTextParseCompleted.Invoke(this, new RobotsDotTextParseCompletedArgs(_crawlContext, robots)); } catch (Exception e) { _logger.Error( "An unhandled exception was thrown by a subscriber of the PageLinksCrawlDisallowed event for robots.txt"); _logger.Error(e); } }
/// <summary> /// Contructor to be used to create an object which will path arugments when robots txt is parsed /// </summary> /// <param name="crawlContext"></param> /// <param name="robots"></param> public RobotsDotTextParseCompletedArgs(CrawlContext crawlContext, IRobots robots) : base(crawlContext) { Robots = robots; }