File manager - Edit - /opt/gsutil/gslib/__pycache__/pubsub_api.cpython-39.pyc
Back
a +(Wg�, � @ sF d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlZddlZddlZddl m Z ddlm Z dd lmZ dd lmZ ddlmZ ddlmZ dd lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z ddlm!Z! ddlm"Z" ddlm#Z# ddl$m%Z% ej&Z'e�(� �r.dZ)ndZ)G dd� de*�Z+dS )z>JSON gsutil Cloud API implementation for Google Cloud Storage.� )�absolute_import)�print_function)�division)�unicode_literalsN)� exceptions)�config)�AccessDeniedException)�BadRequestException)�NotFoundException)�PreconditionException)�ServiceException)�SetUpJsonCredentialsAndCache)�NoOpCredentials)�pubsub_v1_client)�pubsub_v1_messages)�system_util)�GetCertsFile)�GetMaxRetryDelay)� GetNewHttp)� GetNumRetries)�UTF8zVInsufficient OAuth2 scope to perform this operation. Please re-run `gcloud auth login`zRInsufficient OAuth2 scope to perform this operation. Please re-run `gsutil config`c sn e Zd ZdZd� fdd� Zdd� Zdd � Zd d� Zdd � Zdd� Z ddd�Z dd� Zdd� Zddd�Z � ZS )� PubsubApiz;Wraps calls to the Cloud Pub/Sub v1 interface via apitools.Nr c s� t t| ��� || _t� | _t� | _d| _t � ddd�| _t � ddd�}|rTd| nd| _| j| j | j | _ t| ||d � |d k}|d k}tj| j | j||| jd�| _t� | _| j| j_t� | _| j| j_t| jt�r�| j�dd � dS )a' Performs necessary setup for interacting with Google Cloud Pub/Sub. Args: logger: logging.logger for outputting log messages. credentials: Credentials to be used for interacting with Google Cloud Pub/Sub debug: Debug level for the API implementation (0..3). zhttps://�CredentialsZgs_pubsub_hostzpubsub.googleapis.com�gs_pubsub_portN�:� )�credentials� )�url�http�log_request�log_responser �key�'AIzaSyDnacJHrKma0048b13sh8cgxNUwulubmJM)�superr �__init__�loggerr � certs_filer r � http_baser �get� host_base� host_port�url_baser �apitools_clientZPubsubV1r � api_clientr �num_retriesr �max_retry_wait� isinstancer �AddGlobalParam)�selfr&