# Generated by Django 3.2.1 on 2023-06-02 16:22

import django.core.validators
from django.db import migrations, models

import log_outgoing_requests.models


class Migration(migrations.Migration):
    dependencies = [
        ("log_outgoing_requests", "0001_initial"),
    ]

    operations = [
        migrations.CreateModel(
            name="OutgoingRequestsLogConfig",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "save_to_db",
                    models.CharField(
                        choices=[
                            ("use_default", "Use default"),
                            ("yes", "Yes"),
                            ("no", "No"),
                        ],
                        default="use_default",
                        max_length=11,
                        verbose_name="Save logs to database",
                    ),
                ),
                (
                    "save_body",
                    models.CharField(
                        choices=[
                            ("use_default", "Use default"),
                            ("yes", "Yes"),
                            ("no", "No"),
                        ],
                        default="use_default",
                        max_length=11,
                        verbose_name="Save request + response body",
                    ),
                ),
                (
                    "max_content_length",
                    models.IntegerField(
                        default=log_outgoing_requests.models.get_default_max_content_length,
                        help_text="The maximal size of the request/response content (in bytes). If 'Require content length' is not checked, this setting has no effect.",
                        validators=[django.core.validators.MinValueValidator(0)],
                        verbose_name="Maximal content size",
                    ),
                ),
            ],
            options={
                "verbose_name": "Outgoing Requests Log Configuration",
            },
        ),
        migrations.AddField(
            model_name="outgoingrequestslog",
            name="req_body",
            field=models.BinaryField(
                default=b"", help_text="The request body.", verbose_name="Request body"
            ),
        ),
        migrations.AddField(
            model_name="outgoingrequestslog",
            name="req_body_encoding",
            field=models.CharField(default="", max_length=24),
        ),
        migrations.AddField(
            model_name="outgoingrequestslog",
            name="res_body",
            field=models.BinaryField(
                default=b"",
                help_text="The response body.",
                verbose_name="Response body",
            ),
        ),
        migrations.AddField(
            model_name="outgoingrequestslog",
            name="res_body_encoding",
            field=models.CharField(default="", max_length=24),
        ),
        migrations.AlterField(
            model_name="outgoingrequestslog",
            name="hostname",
            field=models.CharField(
                default="",
                help_text="The netloc/hostname part of the url.",
                max_length=255,
                verbose_name="Hostname",
            ),
        ),
        migrations.AlterField(
            model_name="outgoingrequestslog",
            name="method",
            field=models.CharField(
                blank=True,
                help_text="The type of request method.",
                max_length=10,
                verbose_name="Method",
            ),
        ),
        migrations.AlterField(
            model_name="outgoingrequestslog",
            name="req_content_type",
            field=models.CharField(
                default="",
                help_text="The content type of the request.",
                max_length=50,
                verbose_name="Request content type",
            ),
        ),
        migrations.AlterField(
            model_name="outgoingrequestslog",
            name="req_headers",
            field=models.TextField(
                default="",
                help_text="The request headers.",
                verbose_name="Request headers",
            ),
        ),
        migrations.AlterField(
            model_name="outgoingrequestslog",
            name="res_content_type",
            field=models.CharField(
                default="",
                help_text="The content type of the response.",
                max_length=50,
                verbose_name="Response content type",
            ),
        ),
        migrations.AlterField(
            model_name="outgoingrequestslog",
            name="res_headers",
            field=models.TextField(
                default="",
                help_text="The response headers.",
                verbose_name="Response headers",
            ),
        ),
        migrations.AlterField(
            model_name="outgoingrequestslog",
            name="response_ms",
            field=models.PositiveIntegerField(
                default=0,
                help_text="This is the response time in ms.",
                verbose_name="Response in ms",
            ),
        ),
        migrations.AlterField(
            model_name="outgoingrequestslog",
            name="trace",
            field=models.TextField(
                default="",
                help_text="Text providing information in case of request failure.",
                verbose_name="Trace",
            ),
        ),
        migrations.AlterField(
            model_name="outgoingrequestslog",
            name="url",
            field=models.URLField(
                default="",
                help_text="The url of the outgoing request.",
                max_length=1000,
                verbose_name="URL",
            ),
        ),
    ]
