# Google Affiliate Network API . links

## Instance Methods

Retrieves data about a single link if the requesting advertiser/publisher has access to it. Advertisers can look up their own links. Publishers can look up visible links or links belonging to advertisers they are in a relationship with.

Inserts a new link.

Retrieves all links that match the query parameters.

Retrieves the next page of results.

### Method Details

`get(role, roleId, linkId)`

    Retrieves data about a single link if the requesting advertiser/publisher has access to it. Advertisers can look up their own links. Publishers can look up visible links or links belonging to advertisers they are in a relationship with.

    Args:
      role: string, The role of the requester. Valid values: 'advertisers' or 'publishers'. (required)
        Allowed values
          advertisers - The requester is requesting as an advertiser.
          publishers - The requester is requesting as a publisher.
      roleId: string, The ID of the requesting advertiser or publisher. (required)
      linkId: string, The ID of the link to look up. (required)

    Returns:
      An object of the form:

        { # A LinkResource.
          "isActive": True or False, # Flag for if this link is active.
          "linkType": "A String", # The link type.
          "kind": "gan#link", # The kind for one entity.
          "endDate": "A String", # Date that this link becomes inactive.
          "description": "A String", # Description.
          "name": "A String", # The logical name for this link.
          "specialOffers": { # Special offers on the link.
            "priceCut": { # An ApiMoneyProto. # Price cut on the purchase
              "amount": 3.14, # The amount of money.
              "currencyCode": "A String", # The 3-letter code of the currency in question.
            },
            "priceCutMin": { # An ApiMoneyProto. # Minimum purchase amount for price cut promotion
              "amount": 3.14, # The amount of money.
              "currencyCode": "A String", # The 3-letter code of the currency in question.
            },
            "freeShipping": True or False, # Whether there is free shipping
            "promotionCodes": [ # List of promotion code associated with the link
              "A String",
            ],
            "percentOff": 3.14, # Percent off on the purchase
            "percentOffMin": { # An ApiMoneyProto. # Minimum purchase amount for percent off promotion
              "amount": 3.14, # The amount of money.
              "currencyCode": "A String", # The 3-letter code of the currency in question.
            },
            "freeGift": True or False, # Whether there is a free gift
            "freeShippingMin": { # An ApiMoneyProto. # Minimum purchase amount for free shipping promotion
              "amount": 3.14, # The amount of money.
              "currencyCode": "A String", # The 3-letter code of the currency in question.
            },
          },
          "epcSevenDayAverage": { # An ApiMoneyProto. # The sum of fees paid to publishers divided by the total number of clicks over the past seven days on this link. This value should be multiplied by 100 at the time of display.
            "amount": 3.14, # The amount of money.
            "currencyCode": "A String", # The 3-letter code of the currency in question.
          },
          "createDate": "A String", # Date that this link was created.
          "imageAltText": "A String", # image alt text.
          "epcNinetyDayAverage": { # An ApiMoneyProto. # The sum of fees paid to publishers divided by the total number of clicks over the past three months on this link. This value should be multiplied by 100 at the time of display.
            "amount": 3.14, # The amount of money.
            "currencyCode": "A String", # The 3-letter code of the currency in question.
          },
          "advertiserId": "A String", # The advertiser id for the advertiser who owns this link.
          "id": "A String", # The ID of this link.
          "impressionTrackingUrl": "A String", # Tracking url for impressions.
          "promotionType": "A String", # Promotion Type
          "duration": "A String", # Duration
          "authorship": "A String", # Authorship
          "startDate": "A String", # Date that this link becomes active.
          "availability": "A String", # Availability.
          "clickTrackingUrl": "A String", # Tracking url for clicks.
          "destinationUrl": "A String", # The destination URL for the link.
        }

`insert(role, roleId, body)`

    Inserts a new link.

    Args:
      role: string, The role of the requester. Valid values: 'advertisers' or 'publishers'. (required)
        Allowed values
          advertisers - The requester is requesting as an advertiser.
          publishers - The requester is requesting as a publisher.
      roleId: string, The ID of the requesting advertiser or publisher. (required)
      body: object, The request body. (required)
        The object takes the form of:

    { # A LinkResource.
        "isActive": True or False, # Flag for if this link is active.
        "linkType": "A String", # The link type.
        "kind": "gan#link", # The kind for one entity.
        "endDate": "A String", # Date that this link becomes inactive.
        "description": "A String", # Description.
        "name": "A String", # The logical name for this link.
        "specialOffers": { # Special offers on the link.
          "priceCut": { # An ApiMoneyProto. # Price cut on the purchase
            "amount": 3.14, # The amount of money.
            "currencyCode": "A String", # The 3-letter code of the currency in question.
          },
          "priceCutMin": { # An ApiMoneyProto. # Minimum purchase amount for price cut promotion
            "amount": 3.14, # The amount of money.
            "currencyCode": "A String", # The 3-letter code of the currency in question.
          },
          "freeShipping": True or False, # Whether there is free shipping
          "promotionCodes": [ # List of promotion code associated with the link
            "A String",
          ],
          "percentOff": 3.14, # Percent off on the purchase
          "percentOffMin": { # An ApiMoneyProto. # Minimum purchase amount for percent off promotion
            "amount": 3.14, # The amount of money.
            "currencyCode": "A String", # The 3-letter code of the currency in question.
          },
          "freeGift": True or False, # Whether there is a free gift
          "freeShippingMin": { # An ApiMoneyProto. # Minimum purchase amount for free shipping promotion
            "amount": 3.14, # The amount of money.
            "currencyCode": "A String", # The 3-letter code of the currency in question.
          },
        },
        "epcSevenDayAverage": { # An ApiMoneyProto. # The sum of fees paid to publishers divided by the total number of clicks over the past seven days on this link. This value should be multiplied by 100 at the time of display.
          "amount": 3.14, # The amount of money.
          "currencyCode": "A String", # The 3-letter code of the currency in question.
        },
        "createDate": "A String", # Date that this link was created.
        "imageAltText": "A String", # image alt text.
        "epcNinetyDayAverage": { # An ApiMoneyProto. # The sum of fees paid to publishers divided by the total number of clicks over the past three months on this link. This value should be multiplied by 100 at the time of display.
          "amount": 3.14, # The amount of money.
          "currencyCode": "A String", # The 3-letter code of the currency in question.
        },
        "advertiserId": "A String", # The advertiser id for the advertiser who owns this link.
        "id": "A String", # The ID of this link.
        "impressionTrackingUrl": "A String", # Tracking url for impressions.
        "promotionType": "A String", # Promotion Type
        "duration": "A String", # Duration
        "authorship": "A String", # Authorship
        "startDate": "A String", # Date that this link becomes active.
        "availability": "A String", # Availability.
        "clickTrackingUrl": "A String", # Tracking url for clicks.
        "destinationUrl": "A String", # The destination URL for the link.
      }

    Returns:
      An object of the form:

        { # A LinkResource.
          "isActive": True or False, # Flag for if this link is active.
          "linkType": "A String", # The link type.
          "kind": "gan#link", # The kind for one entity.
          "endDate": "A String", # Date that this link becomes inactive.
          "description": "A String", # Description.
          "name": "A String", # The logical name for this link.
          "specialOffers": { # Special offers on the link.
            "priceCut": { # An ApiMoneyProto. # Price cut on the purchase
              "amount": 3.14, # The amount of money.
              "currencyCode": "A String", # The 3-letter code of the currency in question.
            },
            "priceCutMin": { # An ApiMoneyProto. # Minimum purchase amount for price cut promotion
              "amount": 3.14, # The amount of money.
              "currencyCode": "A String", # The 3-letter code of the currency in question.
            },
            "freeShipping": True or False, # Whether there is free shipping
            "promotionCodes": [ # List of promotion code associated with the link
              "A String",
            ],
            "percentOff": 3.14, # Percent off on the purchase
            "percentOffMin": { # An ApiMoneyProto. # Minimum purchase amount for percent off promotion
              "amount": 3.14, # The amount of money.
              "currencyCode": "A String", # The 3-letter code of the currency in question.
            },
            "freeGift": True or False, # Whether there is a free gift
            "freeShippingMin": { # An ApiMoneyProto. # Minimum purchase amount for free shipping promotion
              "amount": 3.14, # The amount of money.
              "currencyCode": "A String", # The 3-letter code of the currency in question.
            },
          },
          "epcSevenDayAverage": { # An ApiMoneyProto. # The sum of fees paid to publishers divided by the total number of clicks over the past seven days on this link. This value should be multiplied by 100 at the time of display.
            "amount": 3.14, # The amount of money.
            "currencyCode": "A String", # The 3-letter code of the currency in question.
          },
          "createDate": "A String", # Date that this link was created.
          "imageAltText": "A String", # image alt text.
          "epcNinetyDayAverage": { # An ApiMoneyProto. # The sum of fees paid to publishers divided by the total number of clicks over the past three months on this link. This value should be multiplied by 100 at the time of display.
            "amount": 3.14, # The amount of money.
            "currencyCode": "A String", # The 3-letter code of the currency in question.
          },
          "advertiserId": "A String", # The advertiser id for the advertiser who owns this link.
          "id": "A String", # The ID of this link.
          "impressionTrackingUrl": "A String", # Tracking url for impressions.
          "promotionType": "A String", # Promotion Type
          "duration": "A String", # Duration
          "authorship": "A String", # Authorship
          "startDate": "A String", # Date that this link becomes active.
          "availability": "A String", # Availability.
          "clickTrackingUrl": "A String", # Tracking url for clicks.
          "destinationUrl": "A String", # The destination URL for the link.
        }

`list(role, roleId, linkType=None, promotionType=None, createDateMax=None, advertiserId=None, pageToken=None, relationshipStatus=None, maxResults=None, authorship=None, startDateMin=None, assetSize=None, searchText=None, startDateMax=None, createDateMin=None)`

    Retrieves all links that match the query parameters.

    Args:
      role: string, The role of the requester. Valid values: 'advertisers' or 'publishers'. (required)
        Allowed values
          advertisers - The requester is requesting as an advertiser.
          publishers - The requester is requesting as a publisher.
      roleId: string, The ID of the requesting advertiser or publisher. (required)
      linkType: string, The type of the link.
        Allowed values
          banner -
          text -
      promotionType: string, The promotion type. (repeated)
        Allowed values
          coupon -
          free_gift -
          free_shipping -
          percent_off -
          price_cut -
      createDateMax: string, The end of the create date range.
      advertiserId: string, Limits the resulting links to the ones belonging to the listed advertisers. (repeated)
      pageToken: string, The value of 'nextPageToken' from the previous page. Optional.
      relationshipStatus: string, The status of the relationship.
        Allowed values
          approved -
          available -
      maxResults: integer, Max number of items to return in this page. Optional. Defaults to 20.
      authorship: string, The role of the author of the link.
        Allowed values
          advertiser -
          publisher -
      startDateMin: string, The beginning of the start date range.
      assetSize: string, The size of the given asset. (repeated)
      searchText: string, Field for full text search across title and merchandising text, supports link id search.
      startDateMax: string, The end of the start date range.
      createDateMin: string, The beginning of the create date range.

    Returns:
      An object of the form:

        {
        "nextPageToken": "A String", # The next page token.
        "items": [ # The links.
          { # A LinkResource.
              "isActive": True or False, # Flag for if this link is active.
              "linkType": "A String", # The link type.
              "kind": "gan#link", # The kind for one entity.
              "endDate": "A String", # Date that this link becomes inactive.
              "description": "A String", # Description.
              "name": "A String", # The logical name for this link.
              "specialOffers": { # Special offers on the link.
                "priceCut": { # An ApiMoneyProto. # Price cut on the purchase
                  "amount": 3.14, # The amount of money.
                  "currencyCode": "A String", # The 3-letter code of the currency in question.
                },
                "priceCutMin": { # An ApiMoneyProto. # Minimum purchase amount for price cut promotion
                  "amount": 3.14, # The amount of money.
                  "currencyCode": "A String", # The 3-letter code of the currency in question.
                },
                "freeShipping": True or False, # Whether there is free shipping
                "promotionCodes": [ # List of promotion code associated with the link
                  "A String",
                ],
                "percentOff": 3.14, # Percent off on the purchase
                "percentOffMin": { # An ApiMoneyProto. # Minimum purchase amount for percent off promotion
                  "amount": 3.14, # The amount of money.
                  "currencyCode": "A String", # The 3-letter code of the currency in question.
                },
                "freeGift": True or False, # Whether there is a free gift
                "freeShippingMin": { # An ApiMoneyProto. # Minimum purchase amount for free shipping promotion
                  "amount": 3.14, # The amount of money.
                  "currencyCode": "A String", # The 3-letter code of the currency in question.
                },
              },
              "epcSevenDayAverage": { # An ApiMoneyProto. # The sum of fees paid to publishers divided by the total number of clicks over the past seven days on this link. This value should be multiplied by 100 at the time of display.
                "amount": 3.14, # The amount of money.
                "currencyCode": "A String", # The 3-letter code of the currency in question.
              },
              "createDate": "A String", # Date that this link was created.
              "imageAltText": "A String", # image alt text.
              "epcNinetyDayAverage": { # An ApiMoneyProto. # The sum of fees paid to publishers divided by the total number of clicks over the past three months on this link. This value should be multiplied by 100 at the time of display.
                "amount": 3.14, # The amount of money.
                "currencyCode": "A String", # The 3-letter code of the currency in question.
              },
              "advertiserId": "A String", # The advertiser id for the advertiser who owns this link.
              "id": "A String", # The ID of this link.
              "impressionTrackingUrl": "A String", # Tracking url for impressions.
              "promotionType": "A String", # Promotion Type
              "duration": "A String", # Duration
              "authorship": "A String", # Authorship
              "startDate": "A String", # Date that this link becomes active.
              "availability": "A String", # Availability.
              "clickTrackingUrl": "A String", # Tracking url for clicks.
              "destinationUrl": "A String", # The destination URL for the link.
            },
        ],
        "kind": "gan#links", # The kind for a page of links.
      }

`list_next(previous_request, previous_response)`

    Retrieves the next page of results.

    Args:
      previous_request: The request for the previous page. (required)
      previous_response: The response from the request for the previous page. (required)

    Returns:
      A request object that you can call 'execute()' on to request the next
      page. Returns None if there are no more items in the collection.