Documentation
¶
Index ¶
- type Client
- func (c *Client) CreateSbCampaigns(r ...RequestOption) *Response
- func (c *Client) CreateSbKeywords(r ...RequestOption) *Response
- func (c *Client) CreateSbTargets(r ...RequestOption) *Response
- func (c *Client) CreateSdAdGroups(r ...RequestOption) *Response
- func (c *Client) CreateSdCampaigns(r ...RequestOption) *Response
- func (c *Client) CreateSdTargets(r ...RequestOption) *Response
- func (c *Client) CreateSpAdGroups(r ...RequestOption) *Response
- func (c *Client) CreateSpCampaigns(r ...RequestOption) *Response
- func (c *Client) CreateSpKeywords(r ...RequestOption) *Response
- func (c *Client) CreateSpTargets(r ...RequestOption) *Response
- func (c *Client) DeleteSbCampaignById(campaignId int) *Response
- func (c *Client) DeleteSbKeywordById(keywordId int) *Response
- func (c *Client) DeleteSbTargetById(targetId int) *Response
- func (c *Client) DeleteSpAdGroupById(adGroupId int) *Response
- func (c *Client) DeleteSpCampaignById(campaignId int) *Response
- func (c *Client) DoRequest(preReq PrepareRequest, options ...RequestOption) *Response
- func (c *Client) GetNewAccessToken() (res TokenResponse, err error)
- func (c *Client) GetPortfolios(r ...RequestOption) *Response
- func (c *Client) GetSbAdGroupById(adGroupId int) *Response
- func (c *Client) GetSbAdGroups(r ...RequestOption) *Response
- func (c *Client) GetSbBidRecommendations(r ...RequestOption) *Response
- func (c *Client) GetSbCampaignById(campaignId int) *Response
- func (c *Client) GetSbCampaigns(r ...RequestOption) *Response
- func (c *Client) GetSbKeywordById(keywordId int) *Response
- func (c *Client) GetSbKeywords(r ...RequestOption) *Response
- func (c *Client) GetSbTargetById(targetId int) *Response
- func (c *Client) GetSbTargets(r ...RequestOption) *Response
- func (c *Client) GetSdAdGroupById(adGroupId int) *Response
- func (c *Client) GetSdAdGroupExtendedById(adGroupId int) *Response
- func (c *Client) GetSdAdGroups(r ...RequestOption) *Response
- func (c *Client) GetSdAdGroupsExtended(r ...RequestOption) *Response
- func (c *Client) GetSdCampaignById(campaignId int) *Response
- func (c *Client) GetSdCampaignExtendedById(campaignId int) *Response
- func (c *Client) GetSdCampaigns(r ...RequestOption) *Response
- func (c *Client) GetSdCampaignsExtended(r ...RequestOption) *Response
- func (c *Client) GetSdTargetById(targetId int) *Response
- func (c *Client) GetSdTargetExtendedById(targetId int) *Response
- func (c *Client) GetSdTargets(r ...RequestOption) *Response
- func (c *Client) GetSdTargetsBidRecommendations(r ...RequestOption) *Response
- func (c *Client) GetSdTargetsExtended(r ...RequestOption) *Response
- func (c *Client) GetSpAdGroupById(adGroupId int) *Response
- func (c *Client) GetSpAdGroupExtendedById(adGroupId int) *Response
- func (c *Client) GetSpAdGroups(r ...RequestOption) *Response
- func (c *Client) GetSpAdGroupsExtended(r ...RequestOption) *Response
- func (c *Client) GetSpBidRecommendationByAdGroupId(adGroupId int) *Response
- func (c *Client) GetSpBidRecommendationByKeywordId(keywordId int) *Response
- func (c *Client) GetSpCampaignById(campaignId int) *Response
- func (c *Client) GetSpCampaignExtendedById(campaignId int) *Response
- func (c *Client) GetSpCampaigns(r ...RequestOption) *Response
- func (c *Client) GetSpCampaignsExtended(r ...RequestOption) *Response
- func (c *Client) GetSpKeywordById(keywordId int) *Response
- func (c *Client) GetSpKeywordExtendedById(keywordId int) *Response
- func (c *Client) GetSpKeywords(r ...RequestOption) *Response
- func (c *Client) GetSpKeywordsBidRecommendations(r ...RequestOption) *Response
- func (c *Client) GetSpKeywordsExtended(r ...RequestOption) *Response
- func (c *Client) GetSpTargets(r ...RequestOption) *Response
- func (c *Client) GetSpTargetsBidRecommendations(r ...RequestOption) *Response
- func (c *Client) GetSpTargetsById(targetId int) *Response
- func (c *Client) GetSpTargetsExtended(r ...RequestOption) *Response
- func (c *Client) GetSpTargetsExtendedById(targetId int) *Response
- func (c *Client) UpdateSbCampaigns(r ...RequestOption) *Response
- func (c *Client) UpdateSbKeywords(r ...RequestOption) *Response
- func (c *Client) UpdateSbTargets(r ...RequestOption) *Response
- func (c *Client) UpdateSdAdGroups(r ...RequestOption) *Response
- func (c *Client) UpdateSdCampaigns(r ...RequestOption) *Response
- func (c *Client) UpdateSdTargets(r ...RequestOption) *Response
- func (c *Client) UpdateSpAdGroups(r ...RequestOption) *Response
- func (c *Client) UpdateSpCampaigns(r ...RequestOption) *Response
- func (c *Client) UpdateSpKeywords(r ...RequestOption) *Response
- func (c *Client) UpdateSpTargets(r ...RequestOption) *Response
- type Credentials
- type PortfoliosResponse
- type PrepareRequest
- type Request
- type RequestOption
- type Response
- type TokenResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶ added in v1.0.2
type Client struct {
Credentials
AccessToken string
ProfileId int64
AutoAccessToken bool
}
func NewClient ¶ added in v1.0.2
func NewClient(cre Credentials) *Client
func (*Client) CreateSbCampaigns ¶ added in v1.0.3
func (c *Client) CreateSbCampaigns(r ...RequestOption) *Response
func (*Client) CreateSbKeywords ¶ added in v1.0.3
func (c *Client) CreateSbKeywords(r ...RequestOption) *Response
func (*Client) CreateSbTargets ¶ added in v1.0.3
func (c *Client) CreateSbTargets(r ...RequestOption) *Response
func (*Client) CreateSdAdGroups ¶ added in v1.0.3
func (c *Client) CreateSdAdGroups(r ...RequestOption) *Response
func (*Client) CreateSdCampaigns ¶ added in v1.0.3
func (c *Client) CreateSdCampaigns(r ...RequestOption) *Response
func (*Client) CreateSdTargets ¶ added in v1.0.3
func (c *Client) CreateSdTargets(r ...RequestOption) *Response
func (*Client) CreateSpAdGroups ¶ added in v1.0.2
func (c *Client) CreateSpAdGroups(r ...RequestOption) *Response
func (*Client) CreateSpCampaigns ¶ added in v1.0.2
func (c *Client) CreateSpCampaigns(r ...RequestOption) *Response
func (*Client) CreateSpKeywords ¶ added in v1.0.2
func (c *Client) CreateSpKeywords(r ...RequestOption) *Response
func (*Client) CreateSpTargets ¶ added in v1.0.2
func (c *Client) CreateSpTargets(r ...RequestOption) *Response
func (*Client) DeleteSbCampaignById ¶ added in v1.0.3
func (*Client) DeleteSbKeywordById ¶ added in v1.0.3
func (*Client) DeleteSbTargetById ¶ added in v1.0.3
func (*Client) DeleteSpAdGroupById ¶ added in v1.0.2
func (*Client) DeleteSpCampaignById ¶ added in v1.0.2
func (*Client) DoRequest ¶ added in v1.0.2
func (c *Client) DoRequest(preReq PrepareRequest, options ...RequestOption) *Response
func (*Client) GetNewAccessToken ¶ added in v1.0.2
func (c *Client) GetNewAccessToken() (res TokenResponse, err error)
func (c *Credential) GetGrantUrl() (string, error) {
hostUrl := c.getHostUrl()
fmt.Println("aaa")
return fmt.Sprintf("%s?client_id=%s&scope=%s&response_type=%s&redirect_uri=%s", hostUrl, c.ClientId, c.Scope, c.ResponseType, c.RedirectUri), nil
}
func (c *Credential) GetRefreshToken() (res response.Token, err error) {
//data := map[string]string{
// "grant_type": "authorization_code",
// "code": code,
// "redirect_uri": c.RedirectUri,
// "client_id": c.ClientId,
// "client_secret": c.ClientSecret,
//}
//dataStr, err := json.Marshal(data)
//if err != nil {
// return res, errors.New("failed to convert json")
//}
//tokenUrl := c.getTokenUrl()
//req, err := http.Post(tokenUrl)
return res, nil
}
func (*Client) GetPortfolios ¶ added in v1.0.2
func (c *Client) GetPortfolios(r ...RequestOption) *Response
func (*Client) GetSbAdGroupById ¶ added in v1.0.3
func (*Client) GetSbAdGroups ¶ added in v1.0.3
func (c *Client) GetSbAdGroups(r ...RequestOption) *Response
func (*Client) GetSbBidRecommendations ¶ added in v1.0.3
func (c *Client) GetSbBidRecommendations(r ...RequestOption) *Response
func (*Client) GetSbCampaignById ¶ added in v1.0.3
func (*Client) GetSbCampaigns ¶ added in v1.0.3
func (c *Client) GetSbCampaigns(r ...RequestOption) *Response
func (*Client) GetSbKeywordById ¶ added in v1.0.3
func (*Client) GetSbKeywords ¶ added in v1.0.3
func (c *Client) GetSbKeywords(r ...RequestOption) *Response
func (*Client) GetSbTargetById ¶ added in v1.0.3
func (*Client) GetSbTargets ¶ added in v1.0.3
func (c *Client) GetSbTargets(r ...RequestOption) *Response
func (*Client) GetSdAdGroupById ¶ added in v1.0.3
func (*Client) GetSdAdGroupExtendedById ¶ added in v1.0.3
func (*Client) GetSdAdGroups ¶ added in v1.0.3
func (c *Client) GetSdAdGroups(r ...RequestOption) *Response
func (*Client) GetSdAdGroupsExtended ¶ added in v1.0.3
func (c *Client) GetSdAdGroupsExtended(r ...RequestOption) *Response
func (*Client) GetSdCampaignById ¶ added in v1.0.3
func (*Client) GetSdCampaignExtendedById ¶ added in v1.0.3
func (*Client) GetSdCampaigns ¶ added in v1.0.3
func (c *Client) GetSdCampaigns(r ...RequestOption) *Response
func (*Client) GetSdCampaignsExtended ¶ added in v1.0.3
func (c *Client) GetSdCampaignsExtended(r ...RequestOption) *Response
func (*Client) GetSdTargetById ¶ added in v1.0.3
func (*Client) GetSdTargetExtendedById ¶ added in v1.0.3
func (*Client) GetSdTargets ¶ added in v1.0.3
func (c *Client) GetSdTargets(r ...RequestOption) *Response
func (*Client) GetSdTargetsBidRecommendations ¶ added in v1.0.3
func (c *Client) GetSdTargetsBidRecommendations(r ...RequestOption) *Response
func (*Client) GetSdTargetsExtended ¶ added in v1.0.3
func (c *Client) GetSdTargetsExtended(r ...RequestOption) *Response
func (*Client) GetSpAdGroupById ¶ added in v1.0.2
func (*Client) GetSpAdGroupExtendedById ¶ added in v1.0.2
func (*Client) GetSpAdGroups ¶ added in v1.0.2
func (c *Client) GetSpAdGroups(r ...RequestOption) *Response
func (*Client) GetSpAdGroupsExtended ¶ added in v1.0.2
func (c *Client) GetSpAdGroupsExtended(r ...RequestOption) *Response
func (*Client) GetSpBidRecommendationByAdGroupId ¶ added in v1.0.2
func (*Client) GetSpBidRecommendationByKeywordId ¶ added in v1.0.2
func (*Client) GetSpCampaignById ¶ added in v1.0.2
func (*Client) GetSpCampaignExtendedById ¶ added in v1.0.2
func (*Client) GetSpCampaigns ¶ added in v1.0.2
func (c *Client) GetSpCampaigns(r ...RequestOption) *Response
func (*Client) GetSpCampaignsExtended ¶ added in v1.0.2
func (c *Client) GetSpCampaignsExtended(r ...RequestOption) *Response
func (*Client) GetSpKeywordById ¶ added in v1.0.2
func (*Client) GetSpKeywordExtendedById ¶ added in v1.0.2
func (*Client) GetSpKeywords ¶ added in v1.0.2
func (c *Client) GetSpKeywords(r ...RequestOption) *Response
func (*Client) GetSpKeywordsBidRecommendations ¶ added in v1.0.2
func (c *Client) GetSpKeywordsBidRecommendations(r ...RequestOption) *Response
func (*Client) GetSpKeywordsExtended ¶ added in v1.0.2
func (c *Client) GetSpKeywordsExtended(r ...RequestOption) *Response
func (*Client) GetSpTargets ¶ added in v1.0.2
func (c *Client) GetSpTargets(r ...RequestOption) *Response
func (*Client) GetSpTargetsBidRecommendations ¶ added in v1.0.2
func (c *Client) GetSpTargetsBidRecommendations(r ...RequestOption) *Response
func (*Client) GetSpTargetsById ¶ added in v1.0.2
func (*Client) GetSpTargetsExtended ¶ added in v1.0.2
func (c *Client) GetSpTargetsExtended(r ...RequestOption) *Response
func (*Client) GetSpTargetsExtendedById ¶ added in v1.0.2
func (*Client) UpdateSbCampaigns ¶ added in v1.0.3
func (c *Client) UpdateSbCampaigns(r ...RequestOption) *Response
func (*Client) UpdateSbKeywords ¶ added in v1.0.3
func (c *Client) UpdateSbKeywords(r ...RequestOption) *Response
func (*Client) UpdateSbTargets ¶ added in v1.0.3
func (c *Client) UpdateSbTargets(r ...RequestOption) *Response
func (*Client) UpdateSdAdGroups ¶ added in v1.0.3
func (c *Client) UpdateSdAdGroups(r ...RequestOption) *Response
func (*Client) UpdateSdCampaigns ¶ added in v1.0.3
func (c *Client) UpdateSdCampaigns(r ...RequestOption) *Response
func (*Client) UpdateSdTargets ¶ added in v1.0.3
func (c *Client) UpdateSdTargets(r ...RequestOption) *Response
func (*Client) UpdateSpAdGroups ¶ added in v1.0.2
func (c *Client) UpdateSpAdGroups(r ...RequestOption) *Response
func (*Client) UpdateSpCampaigns ¶ added in v1.0.2
func (c *Client) UpdateSpCampaigns(r ...RequestOption) *Response
func (*Client) UpdateSpKeywords ¶ added in v1.0.2
func (c *Client) UpdateSpKeywords(r ...RequestOption) *Response
func (*Client) UpdateSpTargets ¶ added in v1.0.2
func (c *Client) UpdateSpTargets(r ...RequestOption) *Response
type Credentials ¶ added in v1.0.2
type PortfoliosResponse ¶ added in v1.0.2
type PrepareRequest ¶ added in v1.0.2
type Request ¶ added in v1.0.2
func NewRequest ¶ added in v1.0.2
func NewRequest(options ...RequestOption) *Request
type RequestOption ¶ added in v1.0.2
type RequestOption func(*Request)
func WithBody ¶ added in v1.0.2
func WithBody(body io.Reader) RequestOption
func WithQueries ¶ added in v1.0.2
func WithQueries(queries map[string]string) RequestOption
Click to show internal directories.
Click to hide internal directories.