public async Task Fetch(IPipeDriveClient client) { if (client == null) { throw new ArgumentNullException(nameof(client)); } _logger.Info("Loading users..."); Entities = await new UserEntityService <DbUser>(client).GetAllAsync(); }
public override async Task Fetch(IPipeDriveClient client) { if (client == null) { throw new ArgumentNullException(nameof(client)); } _logger.Info("Loading person fields..."); Entities = await new PersonFieldEntityService <DbPersonField>(client).GetAllAsync(); }
public async Task Fetch(IPipeDriveClient client) { if (client == null) { throw new ArgumentNullException(nameof(client)); } _logger.Info("Loading deals..."); Entities = await new DynamicEntityService <DbDeal>( client, typeof(DealEntityService <>), _dealType) .GetAllAsync(); _entityTypeBuilder.FillIdsForComplexTypes(Entities, _customFields); }
public DynamicEntityService(IPipeDriveClient client, Type serviceType, Type entityType) { if (client == null) { throw new ArgumentNullException(nameof(client)); } if (serviceType == null) { throw new ArgumentNullException(nameof(serviceType)); } if (entityType == null) { throw new ArgumentNullException(nameof(entityType)); } _client = client; _serviceType = serviceType; _entityType = entityType; }
public async Task <DynamicEntityConfiguration> ConstructType(IPipeDriveClient client) { if (client == null) { throw new ArgumentNullException(nameof(client)); } var service = new DealFieldEntityService <Field>(client); _logger?.Info("Loading deal fields..."); var fields = await service.GetAllAsync(); _logger?.Info("Constructing deals data type..."); _customFields = fields .Where(field => Regex.IsMatch(field.Key ?? "", "^[0-9A-Fa-f]{40}")); // custom field's Key starts with 40 hex chars _dealType = _entityTypeBuilder.Build(typeof(DbDeal), _customFields); return(new DynamicEntityConfiguration(typeof(DealEntityConfiguration <>), _dealType)); }
public async Task Fetch(IPipeDriveClient client) { if (client == null) { throw new ArgumentNullException(nameof(client)); } _logger.Info("Loading organizations relationships..."); var service = new OrganizationRelationshipEntityService <DbOrganizationRelationship>(client); var entities = new List <DbOrganizationRelationship>(); foreach (var organization in _orgService.Entities) { var relationships = await service.GetAllForOrganizationAsync(organization.Id); var unique = relationships.Where(rel => entities.All(ent => ent.Id != rel.Id)); entities.AddRange(unique); } Entities = entities.ToArray(); }
public PersonEntityService(IPipeDriveClient client) : base(client, "persons") { }
public abstract Task Fetch(IPipeDriveClient client);
public PersonsInOrganizationEntityService(IPipeDriveClient client) : base(client, "organizations/{Id}/persons") { }
public OrganizationFoundEntityService(IPipeDriveClient client) : base(client, "organizations/find") { }
public PagingEntityService(IPipeDriveClient client, string resource) : base(client) { _Resource = resource; }
protected EntityService(IPipeDriveClient client, string resource) : base(client) { Resource = resource; }
public DealFieldEntityService(IPipeDriveClient client) : base(client, "dealFields") { }
public ActivityFieldEntityService(IPipeDriveClient client) : base(client, "activityFields") { }
public UserEntityService(IPipeDriveClient client) : base(client, "users") { }
public ActivityEntityService(IPipeDriveClient client) : base(client, "activities") { }
public OrganizationRelationshipEntityService(IPipeDriveClient client) : base(client) { _resource = "organizationRelationships"; }
public NoteEntityService(IPipeDriveClient client) : base(client, "notes") { }
public OrganizationEntityService(IPipeDriveClient client) : base(client, "organizations") { }
public ProductEntityService(IPipeDriveClient client) : base(client, "products") { }
public EntityServiceBase(IPipeDriveClient client) { _client = client; }