File: //lib/python3/dist-packages/uaclient/__pycache__/serviceclient.cpython-310.pyc
o
0xvc� � @ s� d dl Z d dlZd dlZd dlmZ d dlmZmZm Z m
Z
mZ d dlm
Z
d dlmZ d dlmZmZmZmZmZ G dd� de jd �ZdS )
� N)�join)�Any�Dict�Optional�Tuple�Type)�error)� urlencode)�config�
exceptions�system�util�versionc @ s� e Zd ZdZdZeejdee fdd���Z
eejdefdd���Zdde
ej ddfd d
�Zdd� Z
ddede
e fdd�Zdefdd�Zdedee
eeef e
eeef f fdd�ZdS )�UAServiceClient� N�returnc C � dS )z1Set in subclasses to the type of API error raisedN� ��selfr r �8/usr/lib/python3/dist-packages/uaclient/serviceclient.py�
api_error_cls � zUAServiceClient.api_error_clsc C r )z@String in subclasses, the UAConfig attribute containing base urlNr r r r r �cfg_url_base_attr r z!UAServiceClient.cfg_url_base_attr�cfgc C s, |st �� dk}tj|d�| _d S || _d S )Nr )� root_mode)�os�getuidr
�UAConfigr )r r r r r r �__init__ s
zUAServiceClient.__init__c C s d� t�� �ddd�S )NzUA-Client/{}�application/json)z
user-agent�accept�content-type)�formatr �get_versionr r r r �headers&