# Path: pygls/lsp/types/basic_structures.py
# class Command(Model):
#     title: str
#     command: str
#     arguments: Optional[List[Any]]
# 
# class Diagnostic(Model):
#     range: Range
#     message: str
#     severity: Optional[DiagnosticSeverity]
#     code: Optional[Union[int, str]]
#     code_description: Optional[CodeDescription]
#     source: Optional[str]
#     related_information: Optional[List[DiagnosticRelatedInformation]]
#     tags: Optional[List[DiagnosticTag]]
#     data: Optional[Any]
# 
# class Model(BaseModel):
#     class Config:
#         alias_generator = snake_to_camel
#         allow_population_by_field_name = True
#         fields = {
#             'from_': 'from'
#         }
# 
# class PartialResultParams(Model):
#     partial_result_token: Optional[ProgressToken]
# 
# class Range(Model):
#     start: Position
#     end: Position
# 
#     def __eq__(self, other):
#         return (
#             isinstance(other, Range)
#             and self.start == other.start
#             and self.end == other.end)
# 
#     def __hash__(self):
#         return hash((self.start, self.end))
# 
#     def __iter__(self):
#         return iter((self.start, self.end))
# 
#     def __repr__(self):
#         return f'{self.start!r}-{self.end!r}'
# 
# class ResolveSupportClientCapabilities(Model):
#     properties: List[str]
# 
# class TextDocumentIdentifier(Model):
#     uri: str
# 
# class TextDocumentRegistrationOptions(Model):
#     document_selector: Optional[DocumentSelector]
# 
# class WorkDoneProgressOptions(Model):
#     work_done_progress: Optional[ProgressToken]
# 
# class WorkDoneProgressParams(Model):
#     work_done_token: Optional[ProgressToken]
# 
# class WorkspaceEdit(Model):
#     changes: Optional[Dict[str, List[TextEdit]]]
#     document_changes: Optional[Any]
#     change_annotations: Optional[Dict[ChangeAnnotationIdentifier, ChangeAnnotation]]
# 
#     @root_validator
#     def check_result_or_error(cls, values):
#         # Workaround until pydantic supports StrictUnion
#         # https://github.com/samuelcolvin/pydantic/pull/2092
# 
#         document_changes_val = values.get('document_changes')
#         check_type(
#             '',
#             document_changes_val,
#             Optional[Union[
#                 List[TextDocumentEdit],
#                 List[Union[TextDocumentEdit, CreateFile, RenameFile, DeleteFile]],
#             ]]
#         )
# 
#         return values


import enum
from typing import Any, List, Optional, Union
from pygls.lsp.types.basic_structures import (Command, Diagnostic, Model, PartialResultParams,
                                              Range, ResolveSupportClientCapabilities,
                                              TextDocumentIdentifier,
                                              TextDocumentRegistrationOptions,
                                              WorkDoneProgressOptions, WorkDoneProgressParams,
                                              WorkspaceEdit)
    honors_change_annotations: Optional[bool]


class CodeActionOptions(WorkDoneProgressOptions):
    code_action_kinds: Optional[List[CodeActionKind]]
    resolve_provider: Optional[bool]


class CodeActionRegistrationOptions(TextDocumentRegistrationOptions, CodeActionOptions):
    pass


class CodeActionContext(Model):
    diagnostics: List[Diagnostic]
    only: Optional[List[CodeActionKind]]


class CodeActionParams(WorkDoneProgressParams, PartialResultParams):
    text_document: TextDocumentIdentifier
    range: Range
    context: CodeActionContext


class CodeActionDisabled(Model):
    reason: str


class CodeAction(Model):
    title: str
    kind: Optional[CodeActionKind]

# Path: pygls/lsp/types/basic_structures.py
# class Command(Model):
#     title: str
#     command: str
#     arguments: Optional[List[Any]]
# 
# class Diagnostic(Model):
#     range: Range
#     message: str
#     severity: Optional[DiagnosticSeverity]
#     code: Optional[Union[int, str]]
#     code_description: Optional[CodeDescription]
#     source: Optional[str]
#     related_information: Optional[List[DiagnosticRelatedInformation]]
#     tags: Optional[List[DiagnosticTag]]
#     data: Optional[Any]
# 
# class Model(BaseModel):
#     class Config:
#         alias_generator = snake_to_camel
#         allow_population_by_field_name = True
#         fields = {
#             'from_': 'from'
#         }
# 
# class PartialResultParams(Model):
#     partial_result_token: Optional[ProgressToken]
# 
# class Range(Model):
#     start: Position
#     end: Position
# 
#     def __eq__(self, other):
#         return (
#             isinstance(other, Range)
#             and self.start == other.start
#             and self.end == other.end)
# 
#     def __hash__(self):
#         return hash((self.start, self.end))
# 
#     def __iter__(self):
#         return iter((self.start, self.end))
# 
#     def __repr__(self):
#         return f'{self.start!r}-{self.end!r}'
# 
# class ResolveSupportClientCapabilities(Model):
#     properties: List[str]
# 
# class TextDocumentIdentifier(Model):
#     uri: str
# 
# class TextDocumentRegistrationOptions(Model):
#     document_selector: Optional[DocumentSelector]
# 
# class WorkDoneProgressOptions(Model):
#     work_done_progress: Optional[ProgressToken]
# 
# class WorkDoneProgressParams(Model):
#     work_done_token: Optional[ProgressToken]
# 
# class WorkspaceEdit(Model):
#     changes: Optional[Dict[str, List[TextEdit]]]
#     document_changes: Optional[Any]
#     change_annotations: Optional[Dict[ChangeAnnotationIdentifier, ChangeAnnotation]]
# 
#     @root_validator
#     def check_result_or_error(cls, values):
#         # Workaround until pydantic supports StrictUnion
#         # https://github.com/samuelcolvin/pydantic/pull/2092
# 
#         document_changes_val = values.get('document_changes')
#         check_type(
#             '',
#             document_changes_val,
#             Optional[Union[
#                 List[TextDocumentEdit],
#                 List[Union[TextDocumentEdit, CreateFile, RenameFile, DeleteFile]],
#             ]]
#         )
# 
#         return values


# Path: pygls/lsp/types/language_features/code_action.py
import enum
from typing import Any, List, Optional, Union
from pygls.lsp.types.basic_structures import (Command, Diagnostic, Model, PartialResultParams,
                                              Range, ResolveSupportClientCapabilities,
                                              TextDocumentIdentifier,
                                              TextDocumentRegistrationOptions,
                                              WorkDoneProgressOptions, WorkDoneProgressParams,
                                              WorkspaceEdit)

    honors_change_annotations: Optional[bool]


class CodeActionOptions(WorkDoneProgressOptions):
    code_action_kinds: Optional[List[CodeActionKind]]
    resolve_provider: Optional[bool]


class CodeActionRegistrationOptions(TextDocumentRegistrationOptions, CodeActionOptions):
    pass


class CodeActionContext(Model):
    diagnostics: List[Diagnostic]
    only: Optional[List[CodeActionKind]]


class CodeActionParams(WorkDoneProgressParams, PartialResultParams):
    text_document: TextDocumentIdentifier
    range: Range
    context: CodeActionContext


class CodeActionDisabled(Model):
    reason: str


class CodeAction(Model):
    title: str
    kind: Optional[CodeActionKind]

    diagnostics: Optional[List[Diagnostic]]