Skip to content

Commit

Permalink
Add v25.0.0 support (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
henribru authored Aug 16, 2024
1 parent 0161c69 commit f42ad15
Show file tree
Hide file tree
Showing 3,426 changed files with 66,049 additions and 137,893 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![PyPI version](https://badge.fury.io/py/google-ads-stubs.svg)](https://badge.fury.io/py/google-ads-stubs)

This package provides type stubs for the [Google Ads API Client Library for Python](https://github.com/googleads/google-ads-python).
It's currently compatible with v23.1.0 of this library (v16 of the API). It allows you to type check usage of the library with e.g. [mypy](http://mypy-lang.org/) and will also improve autocomplete in many editors.
It's currently compatible with v25.0.0 of this library (v17.1 of the API). It allows you to type check usage of the library with e.g. [mypy](http://mypy-lang.org/) and will also improve autocomplete in many editors.

**This is in no way affiliated with Google.**

Expand All @@ -30,10 +30,10 @@ method of `GoogleAdsClient`.The workaround is to explicitly state the type. You
# Replace this:
campaign_operation = client.get_type('CampaignOperation')
# With this:
from google.ads.googleads.v16 import CampaignOperation
from google.ads.googleads.v17 import CampaignOperation
campaign_operation: CampaignOperation = client.get_type('CampaignOperation')
# Or this:
from google.ads.googleads.v16 import CampaignOperation
from google.ads.googleads.v17 import CampaignOperation
campaign_operation = CampaignOperation()
```
While it is technically possible to type this method using a combination of overloading and literal types,
Expand All @@ -51,7 +51,7 @@ AdGroupAd({
"ad": {"type": 2},
})
# With this:
from google.ads.googleads.v16 import AdGroupAdStatusEnum, AdStrengtEnum, AdTypeEnum, Ad
from google.ads.googleads.v17 import AdGroupAdStatusEnum, AdStrengtEnum, AdTypeEnum, Ad
AdGroupAd(
status=AdGroupAdStatusEnum.AdGroupAdStatus.ENABLED,
ad=Ad(type=AdTypeEnum.AdType.TEXT_AD),
Expand Down
2,360 changes: 989 additions & 1,371 deletions google-stubs/ads/googleads/client.pyi

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions google-stubs/ads/googleads/errors.pyi
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import grpc

from google.ads.googleads.v14 import GoogleAdsFailure as GoogleAdsFailureV14
from google.ads.googleads.v15 import GoogleAdsFailure as GoogleAdsFailureV15
from google.ads.googleads.v16 import GoogleAdsFailure as GoogleAdsFailureV16
from google.ads.googleads.v17 import GoogleAdsFailure as GoogleAdsFailureV17

GoogleAdsFailure = GoogleAdsFailureV14 | GoogleAdsFailureV15 | GoogleAdsFailureV16
GoogleAdsFailure = GoogleAdsFailureV16 | GoogleAdsFailureV17

class GoogleAdsException(Exception):
error: grpc.RpcError = ...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,16 @@ from typing import TypeVar

import grpc

from google.ads.googleads import v14, v15, v16
from google.ads.googleads import v16, v17

from .interceptor import Interceptor

_Request = TypeVar(
"_Request",
v14.SearchGoogleAdsRequest,
v14.SearchGoogleAdsStreamRequest,
v15.SearchGoogleAdsRequest,
v15.SearchGoogleAdsStreamRequest,
v16.SearchGoogleAdsRequest,
v16.SearchGoogleAdsStreamRequest,
v17.SearchGoogleAdsRequest,
v17.SearchGoogleAdsStreamRequest,
)
_Response = TypeVar("_Response")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,16 @@ from typing import TypeVar
import grpc
from google.protobuf.message import Message

from google.ads.googleads import v14, v15, v16
from google.ads.googleads import v16, v17

from .interceptor import Interceptor

_Request = TypeVar(
"_Request",
v14.SearchGoogleAdsRequest,
v14.SearchGoogleAdsStreamRequest,
v15.SearchGoogleAdsRequest,
v15.SearchGoogleAdsStreamRequest,
v16.SearchGoogleAdsRequest,
v16.SearchGoogleAdsStreamRequest,
v17.SearchGoogleAdsRequest,
v17.SearchGoogleAdsStreamRequest,
)
_Response = TypeVar("_Response")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,16 @@ from typing import TypeVar

import grpc

from google.ads.googleads import v14, v15, v16
from google.ads.googleads import v16, v17

from .interceptor import Interceptor

_Request = TypeVar(
"_Request",
v14.SearchGoogleAdsRequest,
v14.SearchGoogleAdsStreamRequest,
v15.SearchGoogleAdsRequest,
v15.SearchGoogleAdsStreamRequest,
v16.SearchGoogleAdsRequest,
v16.SearchGoogleAdsStreamRequest,
v17.SearchGoogleAdsRequest,
v17.SearchGoogleAdsStreamRequest,
)
_Response = TypeVar("_Response")

Expand Down
Loading

0 comments on commit f42ad15

Please sign in to comment.