# Path: scar/utils.py
# class StrUtils:
# 
#     """Common methods for string management."""
# 
#     @staticmethod
#     def decode_base64(value: Union[bytes, str]) -> bytes:
#         """Decode a Base64 encoded bytes-like object or
#         ASCII string and return the decoded bytes"""
#         return base64.b64decode(value)
# 
#     @staticmethod
#     def encode_base64(value: bytes) -> bytes:
#         """Encode a bytes-like object using Base64
#         and return the encoded bytes."""
#         return base64.b64encode(value)
# 
#     @staticmethod
#     def base64_to_utf8_string(value: Union[bytes, str]) -> str:
#         """Decode a Base64 encoded bytes-like object or ASCII
#         string and return the decoded value as a string."""
#         return StrUtils.decode_base64(value).decode('utf-8')
# 
#     @staticmethod
#     def utf8_to_base64_string(value: str) -> str:
#         """Encode a 'utf-8' string using Base64 and return
#         the encoded value as a string."""
#         return StrUtils.encode_base64(bytes(value, 'utf-8')).decode('utf-8')
# 
#     @staticmethod
#     def bytes_to_base64str(value, encoding='utf-8') -> str:
#         """Encode a 'utf-8' string using Base64 and return
#         the encoded value as a string."""
#         return StrUtils.encode_base64(value).decode(encoding)
# 
#     @staticmethod
#     def dict_to_base64_string(value: Dict) -> str:
#         """Encodes a dictionary to base64 and returns a string."""
#         return StrUtils.utf8_to_base64_string(json.dumps(value))
# 
#     @staticmethod
#     def find_expression(string_to_search: str, rgx_pattern: str) -> Optional[str]:
#         """Returns the first group that matches the rgx_pattern in the string_to_search."""
#         if string_to_search:
#             pattern = re.compile(rgx_pattern)
#             match = pattern.search(string_to_search)
#             if match:
#                 return match.group()
#         return None
# 
#     @staticmethod
#     def get_random_uuid4_str() -> str:
#         """Returns a random generated uuid4 string."""
#         return str(uuid.uuid4())
# 
#     @staticmethod
#     def compare_versions(ver1: str, ver2: str) -> int:
#         """Returns value < 0 to indicate that ver1 is less than ver2.
#         Returns value > 0 to indicate that ver1 is greater than ver2.
#         Returns value == 0 to indicate that ver1 is equal to ver2."""
#         res = 0
#         if version.parse(ver1) < version.parse(ver2):
#             res = -1
#         elif version.parse(ver1) > version.parse(ver2):
#             res = 1
#         return res


import json
import scar.logger as logger
from typing import Dict
from enum import Enum
from tabulate import tabulate
from scar.utils import StrUtils
from requests import Response
# Copyright (C) GRyCAP - I3M - UPV
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# 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.



class OutputType(Enum):
    PLAIN_TEXT = 1
    JSON = 2
    VERBOSE = 3
    BINARY = 4


# Path: scar/utils.py
# class StrUtils:
# 
#     """Common methods for string management."""
# 
#     @staticmethod
#     def decode_base64(value: Union[bytes, str]) -> bytes:
#         """Decode a Base64 encoded bytes-like object or
#         ASCII string and return the decoded bytes"""
#         return base64.b64decode(value)
# 
#     @staticmethod
#     def encode_base64(value: bytes) -> bytes:
#         """Encode a bytes-like object using Base64
#         and return the encoded bytes."""
#         return base64.b64encode(value)
# 
#     @staticmethod
#     def base64_to_utf8_string(value: Union[bytes, str]) -> str:
#         """Decode a Base64 encoded bytes-like object or ASCII
#         string and return the decoded value as a string."""
#         return StrUtils.decode_base64(value).decode('utf-8')
# 
#     @staticmethod
#     def utf8_to_base64_string(value: str) -> str:
#         """Encode a 'utf-8' string using Base64 and return
#         the encoded value as a string."""
#         return StrUtils.encode_base64(bytes(value, 'utf-8')).decode('utf-8')
# 
#     @staticmethod
#     def bytes_to_base64str(value, encoding='utf-8') -> str:
#         """Encode a 'utf-8' string using Base64 and return
#         the encoded value as a string."""
#         return StrUtils.encode_base64(value).decode(encoding)
# 
#     @staticmethod
#     def dict_to_base64_string(value: Dict) -> str:
#         """Encodes a dictionary to base64 and returns a string."""
#         return StrUtils.utf8_to_base64_string(json.dumps(value))
# 
#     @staticmethod
#     def find_expression(string_to_search: str, rgx_pattern: str) -> Optional[str]:
#         """Returns the first group that matches the rgx_pattern in the string_to_search."""
#         if string_to_search:
#             pattern = re.compile(rgx_pattern)
#             match = pattern.search(string_to_search)
#             if match:
#                 return match.group()
#         return None
# 
#     @staticmethod
#     def get_random_uuid4_str() -> str:
#         """Returns a random generated uuid4 string."""
#         return str(uuid.uuid4())
# 
#     @staticmethod
#     def compare_versions(ver1: str, ver2: str) -> int:
#         """Returns value < 0 to indicate that ver1 is less than ver2.
#         Returns value > 0 to indicate that ver1 is greater than ver2.
#         Returns value == 0 to indicate that ver1 is equal to ver2."""
#         res = 0
#         if version.parse(ver1) < version.parse(ver2):
#             res = -1
#         elif version.parse(ver1) > version.parse(ver2):
#             res = 1
#         return res


# Path: scar/providers/aws/response.py
import json
import scar.logger as logger
from typing import Dict
from enum import Enum
from tabulate import tabulate
from scar.utils import StrUtils
from requests import Response

# Copyright (C) GRyCAP - I3M - UPV
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# 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.



class OutputType(Enum):
    PLAIN_TEXT = 1
    JSON = 2
    VERBOSE = 3
    BINARY = 4


def parse_http_response(response: Response, resources_info: Dict, scar_info: Dict) -> None: