Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .librarian/state.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
image: us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/python-librarian-generator@sha256:d3ae275c61acca91e1398581edfb9119c521b4e93f9ebb00ecbd4e87b71648f5
image: us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/python-librarian-generator@sha256:121325a77939bb0df3e78b84556b166115ec6447dfc174165bb7702d5d2e96eb
libraries:
- id: google-ads-admanager
version: 0.8.0
Expand Down
36 changes: 34 additions & 2 deletions packages/google-ads-admanager/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
##
# google-ads-admanager documentation build configuration file
#
# This file is execfile()d with the current directory set to its
Expand All @@ -25,9 +24,11 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import logging
import os
import shlex
import sys
from typing import Any

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand Down Expand Up @@ -383,3 +384,34 @@
napoleon_use_ivar = False
napoleon_use_param = True
napoleon_use_rtype = True


# Setup for sphinx behaviors such as warning filters.
class UnexpectedUnindentFilter(logging.Filter):
"""Filter out warnings about unexpected unindentation following bullet lists."""

def filter(self, record: logging.LogRecord) -> bool:
"""Filter the log record.

Args:
record (logging.LogRecord): The log record.

Returns:
bool: False to suppress the warning, True to allow it.
"""
msg = record.getMessage()
if "Bullet list ends without a blank line" in msg:
return False
return True


def setup(app: Any) -> None:
"""Setup the Sphinx application.

Args:
app (Any): The Sphinx application.
"""
# Sphinx's logger is hierarchical. Adding a filter to the
# root 'sphinx' logger will catch warnings from all sub-loggers.
logger = logging.getLogger("sphinx")
logger.addFilter(UnexpectedUnindentFilter())
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@
_LOGGER = std_logging.getLogger(__name__)

from google.longrunning import operations_pb2 # type: ignore
from google.protobuf import duration_pb2 # type: ignore
from google.protobuf import field_mask_pb2 # type: ignore
from google.protobuf import timestamp_pb2 # type: ignore
import google.protobuf.duration_pb2 as duration_pb2 # type: ignore
import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore
import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore

from google.ads.admanager_v1.services.ad_break_service import pagers
from google.ads.admanager_v1.types import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from google.longrunning import operations_pb2 # type: ignore
from google.oauth2 import service_account # type: ignore
import google.protobuf
from google.protobuf import empty_pb2 # type: ignore
import google.protobuf.empty_pb2 as empty_pb2 # type: ignore

from google.ads.admanager_v1 import gapic_version as package_version
from google.ads.admanager_v1.types import ad_break_messages, ad_break_service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
from google.auth.transport.requests import AuthorizedSession # type: ignore
from google.longrunning import operations_pb2 # type: ignore
import google.protobuf
from google.protobuf import empty_pb2 # type: ignore
from google.protobuf import json_format
import google.protobuf.empty_pb2 as empty_pb2 # type: ignore
from requests import __version__ as requests_version

from google.ads.admanager_v1.types import ad_break_messages, ad_break_service
Expand Down Expand Up @@ -659,7 +659,7 @@ def __call__(
)
method = transcoded_request["method"]
try:
request_payload = json_format.MessageToJson(request)
request_payload = type(request).to_json(request)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

While this change to use type(request).to_json(request) is an improvement, the following line uses a bare except:, which is discouraged. A bare except catches all exceptions, including system-exiting ones like SystemExit and KeyboardInterrupt, which can hide critical bugs and make debugging difficult. It is recommended to catch a more specific exception, such as except Exception:. This feedback applies to all similar try...except blocks modified in this pull request.

except:
request_payload = None
http_request = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

from google.api_core import gapic_v1, path_template
from google.longrunning import operations_pb2 # type: ignore
from google.protobuf import empty_pb2 # type: ignore
from google.protobuf import json_format
import google.protobuf.empty_pb2 as empty_pb2 # type: ignore

from google.ads.admanager_v1.types import ad_break_messages, ad_break_service

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@

_LOGGER = std_logging.getLogger(__name__)

from google.api_core import operation # type: ignore
from google.api_core import operation_async # type: ignore
import google.api_core.operation as operation # type: ignore
import google.api_core.operation_async as operation_async # type: ignore
from google.longrunning import operations_pb2 # type: ignore

from google.ads.admanager_v1.services.ad_review_center_ad_service import pagers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ def __call__(
)
method = transcoded_request["method"]
try:
request_payload = json_format.MessageToJson(request)
request_payload = type(request).to_json(request)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The following line uses a bare except:, which is discouraged. A bare except catches all exceptions, including system-exiting ones like SystemExit and KeyboardInterrupt, which can hide critical bugs and make debugging difficult. It is recommended to catch a more specific exception, such as except Exception:. This feedback applies to all similar try...except blocks modified in this pull request.

except:
request_payload = None
http_request = {
Expand Down Expand Up @@ -653,7 +653,7 @@ def __call__(
)
method = transcoded_request["method"]
try:
request_payload = json_format.MessageToJson(request)
request_payload = type(request).to_json(request)
except:
request_payload = None
http_request = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@
_LOGGER = std_logging.getLogger(__name__)

from google.longrunning import operations_pb2 # type: ignore
from google.protobuf import duration_pb2 # type: ignore
from google.protobuf import field_mask_pb2 # type: ignore
from google.protobuf import timestamp_pb2 # type: ignore
import google.protobuf.duration_pb2 as duration_pb2 # type: ignore
import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore
import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore

from google.ads.admanager_v1.services.ad_unit_service import pagers
from google.ads.admanager_v1.types import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
_LOGGER = std_logging.getLogger(__name__)

from google.longrunning import operations_pb2 # type: ignore
from google.protobuf import timestamp_pb2 # type: ignore
import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore

from google.ads.admanager_v1.services.company_service import pagers
from google.ads.admanager_v1.types import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
_LOGGER = std_logging.getLogger(__name__)

from google.longrunning import operations_pb2 # type: ignore
from google.protobuf import field_mask_pb2 # type: ignore
import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore

from google.ads.admanager_v1.services.contact_service import pagers
from google.ads.admanager_v1.types import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
_LOGGER = std_logging.getLogger(__name__)

from google.longrunning import operations_pb2 # type: ignore
from google.protobuf import field_mask_pb2 # type: ignore
import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore

from google.ads.admanager_v1.services.custom_field_service import pagers
from google.ads.admanager_v1.types import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
_LOGGER = std_logging.getLogger(__name__)

from google.longrunning import operations_pb2 # type: ignore
from google.protobuf import field_mask_pb2 # type: ignore
import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore

from google.ads.admanager_v1.services.custom_targeting_key_service import pagers
from google.ads.admanager_v1.types import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
_LOGGER = std_logging.getLogger(__name__)

from google.longrunning import operations_pb2 # type: ignore
from google.protobuf import field_mask_pb2 # type: ignore
import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore

from google.ads.admanager_v1.services.entity_signals_mapping_service import pagers
from google.ads.admanager_v1.types import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@
_LOGGER = std_logging.getLogger(__name__)

from google.longrunning import operations_pb2 # type: ignore
from google.protobuf import timestamp_pb2 # type: ignore
from google.type import money_pb2 # type: ignore
import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore
import google.type.money_pb2 as money_pb2 # type: ignore

from google.ads.admanager_v1.services.line_item_service import pagers
from google.ads.admanager_v1.types import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
_LOGGER = std_logging.getLogger(__name__)

from google.longrunning import operations_pb2 # type: ignore
from google.protobuf import timestamp_pb2 # type: ignore
import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore

from google.ads.admanager_v1.services.order_service import pagers
from google.ads.admanager_v1.types import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@
_LOGGER = std_logging.getLogger(__name__)

from google.longrunning import operations_pb2 # type: ignore
from google.protobuf import field_mask_pb2 # type: ignore
from google.protobuf import timestamp_pb2 # type: ignore
import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore
import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore

from google.ads.admanager_v1.services.placement_service import pagers
from google.ads.admanager_v1.types import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@
_LOGGER = std_logging.getLogger(__name__)

from google.longrunning import operations_pb2 # type: ignore
from google.protobuf import field_mask_pb2 # type: ignore
from google.protobuf import timestamp_pb2 # type: ignore
from google.type import money_pb2 # type: ignore
import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore
import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore
import google.type.money_pb2 as money_pb2 # type: ignore

from google.ads.admanager_v1.services.private_auction_deal_service import pagers
from google.ads.admanager_v1.types import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@
_LOGGER = std_logging.getLogger(__name__)

from google.longrunning import operations_pb2 # type: ignore
from google.protobuf import field_mask_pb2 # type: ignore
from google.protobuf import timestamp_pb2 # type: ignore
import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore
import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore

from google.ads.admanager_v1.services.private_auction_service import pagers
from google.ads.admanager_v1.types import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@

_LOGGER = std_logging.getLogger(__name__)

from google.api_core import operation # type: ignore
from google.api_core import operation_async # type: ignore
import google.api_core.operation as operation # type: ignore
import google.api_core.operation_async as operation_async # type: ignore
from google.longrunning import operations_pb2 # type: ignore
from google.protobuf import field_mask_pb2 # type: ignore
from google.protobuf import timestamp_pb2 # type: ignore
import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore
import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore

from google.ads.admanager_v1.services.report_service import pagers
from google.ads.admanager_v1.types import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1260,7 +1260,7 @@ def __call__(
)
method = transcoded_request["method"]
try:
request_payload = json_format.MessageToJson(request)
request_payload = type(request).to_json(request)
except:
request_payload = None
http_request = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@
_LOGGER = std_logging.getLogger(__name__)

from google.longrunning import operations_pb2 # type: ignore
from google.protobuf import field_mask_pb2 # type: ignore
from google.protobuf import timestamp_pb2 # type: ignore
import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore
import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore

from google.ads.admanager_v1.services.site_service import pagers
from google.ads.admanager_v1.types import site_enums, site_messages, site_service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
_LOGGER = std_logging.getLogger(__name__)

from google.longrunning import operations_pb2 # type: ignore
from google.protobuf import field_mask_pb2 # type: ignore
import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore

from google.ads.admanager_v1.services.team_service import pagers
from google.ads.admanager_v1.types import team_enums, team_messages, team_service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

from typing import MutableMapping, MutableSequence

from google.protobuf import duration_pb2 # type: ignore
from google.protobuf import timestamp_pb2 # type: ignore
import google.protobuf.duration_pb2 as duration_pb2 # type: ignore
import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore
import proto # type: ignore

from google.ads.admanager_v1.types import early_ad_break_notification_enums
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

from typing import MutableMapping, MutableSequence

from google.protobuf import field_mask_pb2 # type: ignore
import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore
import proto # type: ignore

from google.ads.admanager_v1.types import ad_break_messages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

from typing import MutableMapping, MutableSequence

from google.rpc import status_pb2 # type: ignore
from google.type import interval_pb2 # type: ignore
import google.rpc.status_pb2 as status_pb2 # type: ignore
import google.type.interval_pb2 as interval_pb2 # type: ignore
import proto # type: ignore

from google.ads.admanager_v1.types import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

from typing import MutableMapping, MutableSequence

from google.protobuf import duration_pb2 # type: ignore
from google.protobuf import timestamp_pb2 # type: ignore
import google.protobuf.duration_pb2 as duration_pb2 # type: ignore
import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore
import proto # type: ignore

from google.ads.admanager_v1.types import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

from typing import MutableMapping, MutableSequence

from google.protobuf import field_mask_pb2 # type: ignore
import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore
import proto # type: ignore

from google.ads.admanager_v1.types import ad_unit_messages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

from typing import MutableMapping, MutableSequence

from google.protobuf import any_pb2 # type: ignore
import google.protobuf.any_pb2 as any_pb2 # type: ignore
import proto # type: ignore

__protobuf__ = proto.module(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

from typing import MutableMapping, MutableSequence

from google.protobuf import timestamp_pb2 # type: ignore
import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore
import proto # type: ignore

from google.ads.admanager_v1.types import applied_label, company_enums
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

from typing import MutableMapping, MutableSequence

from google.protobuf import field_mask_pb2 # type: ignore
import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore
import proto # type: ignore

from google.ads.admanager_v1.types import contact_messages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

from typing import MutableMapping, MutableSequence

from google.protobuf import field_mask_pb2 # type: ignore
import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore
import proto # type: ignore

from google.ads.admanager_v1.types import custom_field_messages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

from typing import MutableMapping, MutableSequence

from google.protobuf import field_mask_pb2 # type: ignore
import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore
import proto # type: ignore

from google.ads.admanager_v1.types import custom_targeting_key_messages
Expand Down
Loading