Exemplo n.º 1
0
        /// <summary>
        /// creates a new <see cref="HubSpot"/>
        /// </summary>
        /// <param name="restclient">rest client used to access hubspot</param>
        /// <param name="options">options for hubspot api</param>
        public HubSpot(HubSpotRestClient restclient, HubSpotOptions options = null)
        {
            options = options ?? new HubSpotOptions();
            ModelRegistry registry = new ModelRegistry();

            Contacts     = new ContactApi(options, restclient, registry);
            Companies    = new CompanyApi(restclient, registry);
            Associations = new AssociationApi(restclient);
            Deals        = new DealsApi(restclient, registry);
            Tickets      = new TicketsApi(restclient, registry);
            BlogPosts    = new BlogPostApi(restclient, registry);
            Engagements  = new EngagementsApi(options, restclient, registry);
        }
Exemplo n.º 2
0
 /// <summary>
 /// creates a new <see cref="HubSpot"/>
 /// </summary>
 /// <remarks>this connects to the default endpoint hubspot provides</remarks>
 /// <param name="apikey">key used to access api</param>
 public HubSpot(HubSpotOptions options)
     : this(new HubSpotRestClient(options.ApiKey, new Uri(options.ApiUrl)), options)
 {
 }